From e67870a086e9195c5ad4283514ae34cf9eefcfe8 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 14 Jan 2018 08:09:04 +0100 Subject: [PATCH] Added edit post button --- assets/css/components/posts/ui.css | 8 +++++--- assets/js/components/posts/ui.js | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/assets/css/components/posts/ui.css b/assets/css/components/posts/ui.css index 0fa2437e..24c3ff6b 100644 --- a/assets/css/components/posts/ui.css +++ b/assets/css/components/posts/ui.css @@ -24,12 +24,14 @@ } /** - * Posts deletion + * Posts deletion and edition */ -.post .del-post-div a { +.post .del-post-div a, +.post .edit-post-div a { color: #b5bbc8; } -.post .del-post-div a:active { +.post .del-post-div a:active, +.post .edit-post-div a:active { color: black; } diff --git a/assets/js/components/posts/ui.js b/assets/js/components/posts/ui.js index 45076e23..bb6afd32 100644 --- a/assets/js/components/posts/ui.js +++ b/assets/js/components/posts/ui.js @@ -168,6 +168,23 @@ ComunicWeb.components.posts.ui = { } + //Add a button to edit the post if the user is allowed + if(infos.user_access == "full"){ + + var editButtonDiv = createElem2({ + appendTo: topRightArea, + type: "div", + class: "edit-post-div" + }); + + var editButtonLink = createElem2({ + appendTo: editButtonDiv, + type: "a", + innerHTML: "" + }); + + } + //Add a button to delete the post if the user is allowed if(infos.user_access == "full" || infos.user_access == "intermediate"){