From 38a9c960786b775172c28be650f63fc40a991bbe Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 11 Mar 2018 16:22:26 +0100 Subject: [PATCH] Created action contener in friends list --- assets/css/components/friends/listModal.css | 14 +------ assets/css/components/friends/ui.css | 46 +++++++++++++++++++++ assets/js/components/friends/ui.js | 19 ++++++--- system/config/dev.config.php | 1 + 4 files changed, 61 insertions(+), 19 deletions(-) create mode 100644 assets/css/components/friends/ui.css diff --git a/assets/css/components/friends/listModal.css b/assets/css/components/friends/listModal.css index 1704ab14..cf6ee2b3 100644 --- a/assets/css/components/friends/listModal.css +++ b/assets/css/components/friends/listModal.css @@ -11,16 +11,14 @@ margin: 5px; } -.personnal-friends-list .friend a, .friends-list-ro .friend a { color: white; } -.personnal-friends-list .friend a:hover, + .friends-list-ro .friend a:hover { color: #001F3F; } -.personnal-friends-list .friend img, .friends-list-ro .friend img { margin: auto 10px auto auto; max-width: 40px; @@ -29,20 +27,10 @@ visibility: visible; } -.personnal-friends-list .friend .friends-name, .friends-list-ro .friend .friends-name { display: inline-block; white-space: normal; max-width: 100px; text-align: left; vertical-align: middle; -} - -.personnal-friends-list .friend { - margin-bottom: 10px; -} - -.personnal-friends-list .friend .friends-name { - width: 200px; - max-width: 200px; } \ No newline at end of file diff --git a/assets/css/components/friends/ui.css b/assets/css/components/friends/ui.css new file mode 100644 index 00000000..37abebc8 --- /dev/null +++ b/assets/css/components/friends/ui.css @@ -0,0 +1,46 @@ +/** + * Friends list script file + * + * @author Pierre HUBERT + */ + +.personnal-friends-list .friend a, +.friends-list-ro .friend a { + color: white; +} +.personnal-friends-list .friend a:hover, +.friends-list-ro .friend a:hover { + color: #001F3F; +} + +.personnal-friends-list .friend img, +.friends-list-ro .friend img { + margin: auto 10px auto auto; + max-width: 40px; + height: 40px; + border-radius: 50%; + visibility: visible; +} + +.personnal-friends-list .friend .friends-name, +.friends-list-ro .friend .friends-name { + display: inline-block; + white-space: normal; + max-width: 100px; + text-align: left; + vertical-align: middle; +} + +.personnal-friends-list .friend { + margin-bottom: 10px; +} + +.personnal-friends-list .friend .friends-name { + width: 200px; + max-width: 200px; +} + +.personnal-friends-list .friend .friends-actions { + display: inline-block; + width: 250px; +} \ No newline at end of file diff --git a/assets/js/components/friends/ui.js b/assets/js/components/friends/ui.js index 4879798a..af60fa88 100644 --- a/assets/js/components/friends/ui.js +++ b/assets/js/components/friends/ui.js @@ -62,13 +62,20 @@ ComunicWeb.components.friends.ui = { } + //Create actions area + var actionsOnFriendArea = createElem2({ + appendTo: friendContener, + type: "div", + class: "friends-actions" + }); + //Check if the friendship has been accepted or not if(friend.accepted == 0){ //Offer the user to accept or reject friendship request //Reject var rejectRequestBtn = createElem2({ - appendTo: friendContener, + appendTo: actionsOnFriendArea, type: "input", elemType: "button", class: "btn btn-danger", @@ -76,18 +83,18 @@ ComunicWeb.components.friends.ui = { }); rejectRequestBtn.setAttribute("data-accept-request", "false"); - add_space(friendContener); + add_space(actionsOnFriendArea); //Accept var acceptRequestBtn = createElem2({ - appendTo: friendContener, + appendTo: actionsOnFriendArea, type: "button", class: "btn btn-success", innerHTML: "Accepter" }); acceptRequestBtn.setAttribute("data-accept-request", "true"); - add_space(friendContener); + add_space(actionsOnFriendArea); //Make the buttons lives var respond = function(){ @@ -125,7 +132,7 @@ ComunicWeb.components.friends.ui = { //Display following state var followButton = createElem2({ - appendTo: friendContener, + appendTo: actionsOnFriendArea, type: "button", class: "btn btn-primary" }); @@ -139,7 +146,7 @@ ComunicWeb.components.friends.ui = { followButton.setAttribute("data-set-following", "false"); } - add_space(friendContener); + add_space(actionsOnFriendArea); //Check if the user can post text on user page followButton.onclick = function(){ diff --git a/system/config/dev.config.php b/system/config/dev.config.php index d58813f1..036ee0b2 100644 --- a/system/config/dev.config.php +++ b/system/config/dev.config.php @@ -123,6 +123,7 @@ class Dev { //Friendbar stylesheet "css/components/friends/friendsBar.css", "css/components/friends/listModal.css", + "css/components/friends/ui.css", //Conversations stylesheet "css/components/conversations/manager.css",