Created groups main page

This commit is contained in:
Pierre HUBERT 2018-07-02 08:07:59 +02:00
parent 074b724d68
commit 7ff7bceca3
7 changed files with 151 additions and 1 deletions

View File

@ -0,0 +1,12 @@
/**
* Groups main page stylesheet
*
* @author Pierre HUBERT
*/
.groups-main-page {
max-width: 450px;
margin: auto;
text-align: center;
padding-top: 50px;
}

View File

@ -1167,6 +1167,33 @@ var ComunicWeb = {
},
},
/**
* Groups page
*/
groups: {
/**
* Groups page main script
*/
main: {
//TODO : implement
},
/**
* Groups pages
*/
pages: {
/**
* Main page
*/
main: {
//TODO : implement
}
}
},
/**
* User settings page
*/

View File

@ -90,6 +90,20 @@ ComunicWeb.components.menuBar.authenticated = {
openPage("conversations");
};
//Add groups link
var groupsButton = createElem2({
appendTo: dropdownContent,
type: "li"
});
createElem2({
appendTo: groupsButton,
type: "a",
innerHTML: "Groups"
});
groupsButton.onclick = function(){
openPage("groups");
}
//Add settings link
var settingsButton = createElem2({
appendTo: dropdownContent,

View File

@ -0,0 +1,42 @@
/**
* Groups main script
*
* @author Pierre HUBERT
*/
ComunicWeb.pages.groups.main = {
/**
* Open settings page
*
* @param {object} args Optionnal arguments
* @param {HTMLElement} target The target for the page
*/
open: function(args, target){
//Determine which page / group should be opened
if(!args.subfolder)
var page = "main";
else {
//Extract the name of the page from the URL
if(!args.subfolder.includes("/"))
var page = args.subfolder;
else {
var page = args.subfolder.split("/")[0];
}
}
//Check if the main page has to be opened
if(page == "main"){
ComunicWeb.pages.groups.pages.main.open(target);
}
//Else the page was not found
else
ComunicWeb.common.error.pageNotFound(args, target);
}
};

View File

@ -0,0 +1,36 @@
/**
* Groups main page
*
* @author Pierre HUBERT
*/
ComunicWeb.pages.groups.pages.main = {
/**
* Open the page
*
* @param {HTMLElement} target The target for the page
*/
open: function(target){
//Create page container
var pageContainer = createElem2({
appendTo: target,
type: "div",
class: "groups-main-page"
});
//Add a button to offer to create a group
var createGroupBtn = createElem2({
appendTo: pageContainer,
type: "div",
class: "btn btn-primary btn-create-group",
innerHTML: "Create a group"
});
createGroupBtn.addEventListener("click", function(e){
openPage("groups/create");
});
},
}

View File

@ -51,6 +51,16 @@ ComunicWeb.pagesList = {
needLogin: true
},
/**
* Groups page
*/
groups: {
pageTitle: "Groups",
methodHandler: "ComunicWeb.pages.groups.main.open",
disableMenus: false,
needLogin: false
},
/**
* User settings page
*/

View File

@ -216,6 +216,10 @@ class Dev {
"css/pages/conversations/listPane.css",
"css/pages/conversations/conversation.css",
//Groups page
//Groups pages
"css/pages/groups/pages/main.css",
//Settings page
//Sections sections
"css/pages/settings/sections/general.css",
@ -404,6 +408,11 @@ class Dev {
"js/pages/conversations/conversation.js",
"js/pages/conversations/utils.js",
//Groups page
"js/pages/groups/main.js",
"js/pages/groups/pages/main.js",
//User settings page
"js/pages/settings/main.js",
"js/pages/settings/navigationPane.js",