diff --git a/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.html b/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.html index d635aa4d4ac94f10607a150799756cc64d500c63..7c5e66d5d4acdb5f02e1dfa2efd77bc4da7915c6 100644 --- a/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.html +++ b/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.html @@ -33,11 +33,6 @@ [matMenuTriggerFor]="filterMenu" matTooltip="{{ 'comment-list.filter-comments' | translate }}"> <mat-icon class="searchBarIcon">filter_list</mat-icon> </button> - - <button mat-fab class="addButton" *ngIf="!searchBox.value && !search" (click)="openCreateDialog()" - matTooltip="{{ 'comment-list.add-comment' | translate }}"> - <mat-icon class="addCommentIcon">add</mat-icon> - </button> </div> <mat-menu #sortMenu="matMenu" xPosition="before"> @@ -64,6 +59,11 @@ <mat-icon [ngClass]="{correct: 'correct-icon'}[currentFilter]">check_circle</mat-icon> </button> + <button mat-icon-button (focus)="hideCommentsList=true" matTooltip="{{ 'comment-list.wrong' | translate }}" + (click)="filterComments(wrong)"> + <mat-icon [ngClass]="{wrong: 'wrong-icon'}[currentFilter]">not_interested</mat-icon> + </button> + <button mat-icon-button (focus)="hideCommentsList=true" matTooltip="{{ 'comment-list.favorite' | translate }}" (click)="filterComments(favorite)"> <mat-icon [ngClass]="{favorite: 'favorite-icon'}[currentFilter]">grade</mat-icon> @@ -71,12 +71,7 @@ <button mat-icon-button (focus)="hideCommentsList=true" matTooltip="{{ 'comment-list.read' | translate }}" (click)="filterComments(read)"> - <mat-icon [ngClass]="{read: 'read-icon'}[currentFilter]">speaker_notes</mat-icon> - </button> - - <button mat-icon-button (focus)="hideCommentsList=true" matTooltip="{{ 'comment-list.unread' | translate }}" - (click)="filterComments(unread)"> - <mat-icon [ngClass]="{unread: 'unread-icon'}[currentFilter]">speaker_notes_off</mat-icon> + <mat-icon svgIcon="beamer" [ngClass]="{read: 'beamer-icon'}[currentFilter]"></mat-icon> </button> <button mat-icon-button (focus)="hideCommentsList=false" (click)="sortComments(currentSort); filterComments('')"> diff --git a/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.scss b/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.scss index 350cbe5bea621f8aaadde625a461139948545375..1e78d9909247c0e9927c626dce9c349a2bae2642 100644 --- a/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.scss +++ b/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.scss @@ -64,18 +64,6 @@ app-comment { color: var(--secondary); } -.addButton { - width: 40px; - height: 40px; - margin: 0 5% 0 5%; - background-color: var(--primary); -} - -.addCommentIcon { - transform: scale(1.5); - color: var(--surface) -} - .close { margin: 5px 0 5px 0; } @@ -104,8 +92,12 @@ h4 { color: var(--green); } -.read-icon { - color: var(--grey); +.wrong-icon { + color: var(--red); +} + +.beamer-icon { + color: var(--blue); } .favorite-icon { @@ -142,25 +134,6 @@ h3 { opacity: 1; } -.fab-extended { - width: 50%; - min-width: 270px; - max-width: 300px; - height: 40px; - border-radius: 32px; - margin: 10% 0 10% 0; - font-size: large; - background-color: var(--primary); - color: var(--on-primary); -} - -.add { - transform: scale(1.4); - margin-right: 4%; - margin-left: 4%; - color: var(--on-primary); -} - .scrollTop { position: fixed; bottom: 3%; diff --git a/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.ts b/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.ts index 7f0c51315c61456dac24cad84e34df7354164df5..014367c0443ad923c35cf367365645792fd1bff0 100644 --- a/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.ts +++ b/src/app/components/moderator/moderator-comment-list/moderator-comment-list.component.ts @@ -38,6 +38,7 @@ export class ModeratorCommentListComponent implements OnInit { unread = 'unread'; favorite = 'favorite'; correct = 'correct'; + wrong = 'wrong'; ack = 'ack'; currentFilter = ''; commentVoteMap = new Map<string, Vote>(); @@ -197,7 +198,9 @@ export class ModeratorCommentListComponent implements OnInit { this.filteredComments = this.comments.filter(c => { switch (type) { case this.correct: - return c.correct; + return c.correct === CorrectWrong.CORRECT ? 1 : 0; + case this.wrong: + return c.correct === CorrectWrong.WRONG ? 1 : 0; case this.favorite: return c.favorite; case this.read: @@ -212,13 +215,13 @@ export class ModeratorCommentListComponent implements OnInit { sort(array: any[], type: string): void { array.sort((a, b) => { if (type === this.voteasc) { - return a.score - b.score; + return (a.score > b.score) ? 1 : (b.score > a.score) ? -1 : 0; } else if (type === this.votedesc) { - return b.score - a.score; + return (b.score > a.score) ? 1 : (a.score > b.score) ? -1 : 0; } const dateA = new Date(a.timestamp), dateB = new Date(b.timestamp); if (type === this.time) { - return +dateB - +dateA; + return (+dateB > +dateA) ? 1 : (+dateA > +dateB) ? -1 : 0; } }); }