Created action contener in friends list

This commit is contained in:
Pierre 2018-03-11 16:22:26 +01:00
parent a4ec170d8a
commit 38a9c96078
4 changed files with 61 additions and 19 deletions

View File

@ -11,16 +11,14 @@
margin: 5px; margin: 5px;
} }
.personnal-friends-list .friend a,
.friends-list-ro .friend a { .friends-list-ro .friend a {
color: white; color: white;
} }
.personnal-friends-list .friend a:hover,
.friends-list-ro .friend a:hover { .friends-list-ro .friend a:hover {
color: #001F3F; color: #001F3F;
} }
.personnal-friends-list .friend img,
.friends-list-ro .friend img { .friends-list-ro .friend img {
margin: auto 10px auto auto; margin: auto 10px auto auto;
max-width: 40px; max-width: 40px;
@ -29,20 +27,10 @@
visibility: visible; visibility: visible;
} }
.personnal-friends-list .friend .friends-name,
.friends-list-ro .friend .friends-name { .friends-list-ro .friend .friends-name {
display: inline-block; display: inline-block;
white-space: normal; white-space: normal;
max-width: 100px; max-width: 100px;
text-align: left; text-align: left;
vertical-align: middle; vertical-align: middle;
}
.personnal-friends-list .friend {
margin-bottom: 10px;
}
.personnal-friends-list .friend .friends-name {
width: 200px;
max-width: 200px;
} }

View File

@ -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;
}

View File

@ -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 //Check if the friendship has been accepted or not
if(friend.accepted == 0){ if(friend.accepted == 0){
//Offer the user to accept or reject friendship request //Offer the user to accept or reject friendship request
//Reject //Reject
var rejectRequestBtn = createElem2({ var rejectRequestBtn = createElem2({
appendTo: friendContener, appendTo: actionsOnFriendArea,
type: "input", type: "input",
elemType: "button", elemType: "button",
class: "btn btn-danger", class: "btn btn-danger",
@ -76,18 +83,18 @@ ComunicWeb.components.friends.ui = {
}); });
rejectRequestBtn.setAttribute("data-accept-request", "false"); rejectRequestBtn.setAttribute("data-accept-request", "false");
add_space(friendContener); add_space(actionsOnFriendArea);
//Accept //Accept
var acceptRequestBtn = createElem2({ var acceptRequestBtn = createElem2({
appendTo: friendContener, appendTo: actionsOnFriendArea,
type: "button", type: "button",
class: "btn btn-success", class: "btn btn-success",
innerHTML: "Accepter" innerHTML: "Accepter"
}); });
acceptRequestBtn.setAttribute("data-accept-request", "true"); acceptRequestBtn.setAttribute("data-accept-request", "true");
add_space(friendContener); add_space(actionsOnFriendArea);
//Make the buttons lives //Make the buttons lives
var respond = function(){ var respond = function(){
@ -125,7 +132,7 @@ ComunicWeb.components.friends.ui = {
//Display following state //Display following state
var followButton = createElem2({ var followButton = createElem2({
appendTo: friendContener, appendTo: actionsOnFriendArea,
type: "button", type: "button",
class: "btn btn-primary" class: "btn btn-primary"
}); });
@ -139,7 +146,7 @@ ComunicWeb.components.friends.ui = {
followButton.setAttribute("data-set-following", "false"); followButton.setAttribute("data-set-following", "false");
} }
add_space(friendContener); add_space(actionsOnFriendArea);
//Check if the user can post text on user page //Check if the user can post text on user page
followButton.onclick = function(){ followButton.onclick = function(){

View File

@ -123,6 +123,7 @@ class Dev {
//Friendbar stylesheet //Friendbar stylesheet
"css/components/friends/friendsBar.css", "css/components/friends/friendsBar.css",
"css/components/friends/listModal.css", "css/components/friends/listModal.css",
"css/components/friends/ui.css",
//Conversations stylesheet //Conversations stylesheet
"css/components/conversations/manager.css", "css/components/conversations/manager.css",