Display like button

This commit is contained in:
Pierre
2017-12-29 08:58:22 +01:00
parent 2bdcf71809
commit 697482c071
6 changed files with 192 additions and 2 deletions

View File

@ -115,7 +115,7 @@ ComunicWeb.pages.userPage.main = {
* Display a user page
*
* @param {Object} infos Informations about the user to display
* @param {Object} params Parametres required to open the page
* @param {Object} params Parameters required to open the page
* @param {HTMLElement} target Target of the user page
*/
displayUserPage: function(infos, params, target){
@ -146,6 +146,16 @@ ComunicWeb.pages.userPage.main = {
//Display profile informations
ComunicWeb.pages.userPage.profileInfos.display(infos, leftColumn);
//Create right column
var rightColumn = createElem2({
appendTo: row,
type: "div",
class: "col-md-9"
});
//Display text
ComunicWeb.pages.userPage.posts.display(infos, params, rightColumn);
}
}

View File

@ -0,0 +1,32 @@
/**
* Posts function
*
* @author Pierre HUBERT
*/
ComunicWeb.pages.userPage.posts = {
/**
* Display the posts
*
* @param {Object} userInfos Informations about the user
* @param {Object} params Additionnal parametres passed with the request
* @param {HTMLElement} target The target where the posts will be applied
*/
display: function(userInfos, params, target){
//Create posts blocks
var postsBlock = createElem2({
appendTo: target,
type: "div",
class: "box box-primary"
});
//Check whether a precise post has to be opened or not
//TODO implement
}
};

View File

@ -63,6 +63,28 @@ ComunicWeb.pages.userPage.profileInfos = {
innerHTML: infos.firstName + " " + infos.lastName
});
//Show user likes
var userLikesTarget = createElem2({
appendTo: boxBody,
type: "div"
});
userLikesTarget.style.textAlign = "center";
//Check wether user is linking or not
var userLiking = null;
if(signed_in()){
userLiking = infos.user_like_page;
}
//Call component
ComunicWeb.components.like.button.display(
"user",
infos.userID,
infos.pageLikes,
userLiking,
userLikesTarget,
);
//Add list of informations about user
var listInfos = createElem2({
appendTo: boxBody,