From 5fc705c8dc6569c0ad0b80931b243d7da86b2be1 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 23 Dec 2017 18:44:12 +0100 Subject: [PATCH] Can enter in conversation with users from their pages --- assets/js/pages/userPage/profileInfos.js | 29 +++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/assets/js/pages/userPage/profileInfos.js b/assets/js/pages/userPage/profileInfos.js index a9590f1d..80fe13a9 100644 --- a/assets/js/pages/userPage/profileInfos.js +++ b/assets/js/pages/userPage/profileInfos.js @@ -60,6 +60,33 @@ ComunicWeb.pages.userPage.profileInfos = { innerHTML: infos.firstName + " " + infos.lastName }); + //Create button area + var buttonsArea = createElem2({ + appendTo: boxBody, + type: "div", + }); + buttonsArea.style.textAlign = "center"; + buttonsArea.style.marginTop = "2px"; + buttonsArea.style.marginBottom = "2px"; + + if(signed_in()) { + + if(userID() != infos.userID){ + + //Add a button to help user create a conversation with the user + var conversationButton = createElem2({ + appendTo: buttonsArea, + type: "button", + class: "btn btn-default", + innerHTML: "" + }); + + conversationButton.onclick = function(){ + ComunicWeb.components.conversations.manager.openPrivate(infos.userID); + } + } + } + //Add list of informations about user var listInfos = createElem2({ appendTo: boxBody, @@ -94,7 +121,7 @@ ComunicWeb.pages.userPage.profileInfos = { createElem2({ appendTo: accountCreationLi, type: "b", - innerHTML: "Member since" + innerHTML: "Member for" }); createElem2({ appendTo: accountCreationLi,