mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-29 15:26:27 +00:00
Added delete comment button.
This commit is contained in:
parent
b8e76b05ff
commit
298d0b37d1
@ -16,4 +16,13 @@
|
||||
width: 100px !important;
|
||||
height: auto !important;
|
||||
float: none;
|
||||
}
|
||||
|
||||
.post-comments .delete-comment-link {
|
||||
margin-left: 5px;
|
||||
color: #b5bbc8;
|
||||
}
|
||||
|
||||
.post-comments .delete-comment-link:active {
|
||||
color: black;
|
||||
}
|
@ -96,7 +96,7 @@ ComunicWeb.components.comments.ui = {
|
||||
innerHTML: userFullName(user)
|
||||
});
|
||||
|
||||
//Add right text
|
||||
//Add right elements
|
||||
var rightContener = createElem2({
|
||||
appendTo: userNameContener,
|
||||
type: "span",
|
||||
@ -110,6 +110,24 @@ ComunicWeb.components.comments.ui = {
|
||||
innerHTML: ComunicWeb.common.date.timeDiffToStr(infos.time_sent) + " ago"
|
||||
});
|
||||
|
||||
//Offer the user the possibility to delete the comment if he is allowed to do so
|
||||
if(userID() == infos.userID){
|
||||
|
||||
//Create a button to delete the comment
|
||||
var deleteCommentLink = createElem2({
|
||||
appendTo: rightContener,
|
||||
type: "a",
|
||||
class: "delete-comment-link"
|
||||
});
|
||||
|
||||
createElem2({
|
||||
appendTo: deleteCommentLink,
|
||||
type: "i",
|
||||
class: "fa fa-trash"
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//Add comment content
|
||||
var commentContent = createElem2({
|
||||
appendTo: commentText,
|
||||
|
Loading…
Reference in New Issue
Block a user