diff --git a/src/app/components/shared/comment-list/comment-list.component.html b/src/app/components/shared/comment-list/comment-list.component.html index 17a1deb185f2e5457779d369e37a5259ef82e675..1adaeb9a11ea1415f929ba5d0812bfdeafedb397 100644 --- a/src/app/components/shared/comment-list/comment-list.component.html +++ b/src/app/components/shared/comment-list/comment-list.component.html @@ -148,10 +148,15 @@ </div> <div *ngIf="!isLoading"> - <app-comment *ngFor="let current of hideCommentsList ? filteredComments : comments" [comment]="current" - [parseVote]="getVote(current)" [userRole]="userRole" [moderator]="false" - (clickedOnTag)="clickedOnTag($event)" (clickedUserNumber)="clickedUserNumber($event)"> - </app-comment> + <app-comment *ngFor="let current of hideCommentsList ? filteredComments : comments" + [comment]="current" + [parseVote]="getVote(current)" + [userRole]="userRole" + [moderator]="false" + [user]="user" + (clickedOnTag)="clickedOnTag($event)" + (clickedUserNumber)="clickedUserNumber($event)"> + </app-comment> </div> <!-- No Questions Present --> <div *ngIf="comments && comments.length < 1 && !isLoading" fxLayout="row" fxLayoutAlign="center center" diff --git a/src/app/components/shared/comment/comment.component.html b/src/app/components/shared/comment/comment.component.html index 7718edf8700674b3f31b92f46e88a28370220ad2..5dbdc15ff623535e8910791e3bce00e5ebe47b71 100644 --- a/src/app/components/shared/comment/comment.component.html +++ b/src/app/components/shared/comment/comment.component.html @@ -52,7 +52,8 @@ : ('comment-page.mark-not-favorite' | translate)">grade </mat-icon> </button> - <button mat-icon-button *ngIf="isCreator && !comment.favorite && !inAnswerView" (click)="openDeleteCommentDialog()" + <button mat-icon-button + *ngIf="(isCreator || comment.creatorId === user.id) && !comment.favorite && !inAnswerView" (click)="openDeleteCommentDialog()" tabindex="0" attr.aria-labelledby="comment_delete{{ comment.id }}"> <mat-icon class="not-marked" matTooltip="{{ 'comment-page.delete' | translate }}">delete </mat-icon> diff --git a/src/app/components/shared/comment/comment.component.ts b/src/app/components/shared/comment/comment.component.ts index 40af32129f1ac6537698750352e440f9e51ed6a3..ca7f9526f167765693c77728c966866b6782e3f6 100644 --- a/src/app/components/shared/comment/comment.component.ts +++ b/src/app/components/shared/comment/comment.component.ts @@ -17,6 +17,7 @@ import { CorrectWrong } from '../../../models/correct-wrong.enum'; import { UserRole } from '../../../models/user-roles.enum'; import { Rescale } from '../../../models/rescale'; import { RowComponent } from '../../../../../projects/ars/src/lib/components/layout/frame/row/row.component'; +import { User } from '../../../models/user'; @Component({ selector: 'app-comment', @@ -38,6 +39,7 @@ export class CommentComponent implements OnInit, AfterViewInit { @Input() comment: Comment; @Input() moderator: boolean; @Input() userRole: UserRole; + @Input() user: User; @Output() clickedOnTag = new EventEmitter<string>(); @Output() clickedUserNumber = new EventEmitter<number>(); isStudent = false; diff --git a/src/assets/i18n/participant/de.json b/src/assets/i18n/participant/de.json index 2890ebe50d8a22ae69fc2ccbb77f2faf9a57eccd..dda0337cc197233c235c300f1246efaa57042965 100644 --- a/src/assets/i18n/participant/de.json +++ b/src/assets/i18n/participant/de.json @@ -57,7 +57,12 @@ "unread": "Nicht im Hörsaal besprochen", "vote-asc": "Aufsteigende Bewertungen", "vote-desc": "Absteigende Bewertungen", - "wrong": "Verneint" + "wrong": "Verneint", + "really-delete": "Willst du die Frage wirklich löschen?" + }, + "content": { + "cancel": "Abbrechen", + "delete": "Löschen" }, "comment-page": { "a11y-comment_input": "Gib deine Frage ein", @@ -99,7 +104,8 @@ "write-comment": "Schreiben", "preview-comment": "Vorschau", "show-more": "mehr ansehen", - "show-less": "weniger anzeigen" + "show-less": "weniger anzeigen", + "sure": "Bist du sicher?" }, "home-page": { @@ -121,7 +127,8 @@ "live-feedback": "Live Feedback", "session-id": "Code", "bonus-token": "Tokens für Bonuspunkte", - "bonus-token-header": "Tokens für Bonuspunkte" + "bonus-token-header": "Tokens für Bonuspunkte", + "delete": "Frage löschen" }, "question-wall": { "next-comment": "Nächste Frage", diff --git a/src/assets/i18n/participant/en.json b/src/assets/i18n/participant/en.json index b4c9015d76283506363b12caceb7bd35f50f9b71..2362558c44de99b0172af828d94f12a41cc35fb1 100644 --- a/src/assets/i18n/participant/en.json +++ b/src/assets/i18n/participant/en.json @@ -57,7 +57,12 @@ "unread": "Not yet discussed", "vote-desc": "Descending votes", "vote-asc": "Ascending votes", - "wrong": "Marked as wrong by the professor" + "wrong": "Marked as wrong by the professor", + "really-delete": "Do you really want to delete this question?" + }, + "content": { + "cancel": "Cancel", + "delete": "Delete" }, "comment-page": { "a11y-comment_input": "Enter your question", @@ -99,7 +104,8 @@ "write-comment": "Write", "preview-comment": "Preview", "show-more": "show more", - "show-less": "show less" + "show-less": "show less", + "delete": "Delete question" }, "home-page": { "exactly-8": "A session key is a combination of exactly 8 digits.", @@ -120,7 +126,8 @@ "live-feedback": "Live feedback", "session-id": "Key", "bonus-token": "Tokens for bonus points", - "bonus-token-header": "Tokens for bonus points" + "bonus-token-header": "Tokens for bonus points", + "sure": "Are you sure?" }, "question-wall": { "next-comment": "Next question",