mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-24 01:48:50 +00:00
Added delete button
This commit is contained in:
parent
741dd8b75c
commit
825f88fe8e
@ -4,12 +4,33 @@
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
/**
|
||||
* Top right actions
|
||||
*/
|
||||
.post .top-right-buttons div {
|
||||
display: inline-block;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.post .top-right-buttons div .btn-group {
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
/**
|
||||
* For the visibility
|
||||
*/
|
||||
.post .visibility .read-only {
|
||||
.post .visibility .read-only {
|
||||
color: #b5bbc8;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Posts deletion
|
||||
*/
|
||||
.post .del-post-div a {
|
||||
color: #b5bbc8;
|
||||
}
|
||||
.post .del-post-div a:active {
|
||||
color: black;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,8 +75,8 @@ ComunicWeb.components.posts.ui = {
|
||||
var topRightArea = createElem2({
|
||||
insertAsFirstChild: userBlock,
|
||||
type: "div",
|
||||
class: "pull-right",
|
||||
})
|
||||
class: "pull-right top-right-buttons",
|
||||
});
|
||||
|
||||
//Load informations about visibility
|
||||
var visibilityTarget = createElem2({
|
||||
@ -93,8 +93,6 @@ ComunicWeb.components.posts.ui = {
|
||||
if(infos.user_access != "full"){
|
||||
|
||||
//The user can't change the visibility level of the post
|
||||
|
||||
|
||||
//Display visibility level as a simple icon
|
||||
createElem2({
|
||||
appendTo: visibilityTarget,
|
||||
@ -170,6 +168,23 @@ ComunicWeb.components.posts.ui = {
|
||||
|
||||
}
|
||||
|
||||
//Add a button to delete the post if the user is allowed
|
||||
if(infos.user_access == "full" || infos.user_access == "intermediate"){
|
||||
|
||||
var deleteButtonDiv = createElem2({
|
||||
appendTo: topRightArea,
|
||||
type: "div",
|
||||
class: "del-post-div"
|
||||
});
|
||||
|
||||
var deleteButtonLink = createElem2({
|
||||
appendTo: deleteButtonDiv,
|
||||
type: "a",
|
||||
innerHTML: "<i class='fa fa-trash'></i>"
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//Add post attachement (if any)
|
||||
if(infos.kind == "text"){
|
||||
//Do nothing
|
||||
|
Loading…
Reference in New Issue
Block a user