Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Privacy
Imprint
Contact
Login methods
Sign in
Toggle navigation
Menu
Open sidebar
Fabian Gruenwald
frag.jetzt
Commits
0c51f490
Commit
0c51f490
authored
Apr 25, 2021
by
Klaus-Dieter Quibeldey-Cirkel
Browse files
let students delete their own comments
parent
dd3009b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/components/shared/comment/comment.component.html
View file @
0c51f490
<mat-card
id=
"comment-card"
class=
"border"
<mat-card
id=
"comment-card"
class=
"border"
[ngClass]=
"{'highlighted': comment.highlighted, '': !comment.highlighted,
'moderator': moderator,
'border-notMarked': user !== undefined && comment.correct === 0 && comment.bookmark === false && comment.favorite === false && !comment.answer && comment.creatorId !== user.id,
...
...
@@ -91,12 +92,25 @@
(click)=
"setBookmark(comment)"
tabindex=
"0"
attr.aria-labelledby=
"comment_grade{{ comment.id }}"
>
<mat-icon
[ngClass]=
"{'bookmark-icon' : comment.bookmark, 'not-marked' : !comment.bookmark}"
[matTooltip]=
"!comment.bookmark ? ('comment-page.mark-bookmark' | translate)
<mat-icon
[ngClass]=
"{'bookmark-icon' : comment.bookmark, 'not-marked' : !comment.bookmark}"
[matTooltip]=
"!comment.bookmark ? ('comment-page.mark-bookmark' | translate)
: ('comment-page.mark-not-bookmark' | translate)"
>
bookmark
</mat-icon>
</mat-icon>
</button>
</ng-container>
<button
mat-icon-button
class=
"delete-own-comment"
*ngIf=
"(isStudent && (comment.creatorId && user && comment.creatorId === user.id)) && (!comment.bookmark || !comment.favorite || !comment.correct || !comment.answer)"
(click)=
"openDeleteCommentDialog()"
tabindex=
"0"
attr.aria-labelledby=
"comment_delete{{ comment.id }}"
>
<mat-icon>
delete
</mat-icon>
</button>
<ng-container
*ngIf=
"!isStudent"
>
<button
mat-icon-button
class=
"edit-button"
...
...
src/app/components/shared/comment/comment.component.scss
View file @
0c51f490
...
...
@@ -19,6 +19,10 @@ mat-card-content > :first-child {
margin-top
:
20px
;
}
.delete-own-comment
{
color
:
var
(
--
on-surface
)
!
important
;
}
.voting-icon
{
width
:
35px
;
height
:
35px
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment