mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-29 23:36:27 +00:00
Added delete comment button.
This commit is contained in:
parent
b8e76b05ff
commit
298d0b37d1
@ -17,3 +17,12 @@
|
|||||||
height: auto !important;
|
height: auto !important;
|
||||||
float: none;
|
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)
|
innerHTML: userFullName(user)
|
||||||
});
|
});
|
||||||
|
|
||||||
//Add right text
|
//Add right elements
|
||||||
var rightContener = createElem2({
|
var rightContener = createElem2({
|
||||||
appendTo: userNameContener,
|
appendTo: userNameContener,
|
||||||
type: "span",
|
type: "span",
|
||||||
@ -110,6 +110,24 @@ ComunicWeb.components.comments.ui = {
|
|||||||
innerHTML: ComunicWeb.common.date.timeDiffToStr(infos.time_sent) + " ago"
|
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
|
//Add comment content
|
||||||
var commentContent = createElem2({
|
var commentContent = createElem2({
|
||||||
appendTo: commentText,
|
appendTo: commentText,
|
||||||
|
Loading…
Reference in New Issue
Block a user