mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 20:19:21 +00:00
Created groups main page
This commit is contained in:
parent
074b724d68
commit
7ff7bceca3
12
assets/css/pages/groups/pages/main.css
Normal file
12
assets/css/pages/groups/pages/main.css
Normal 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;
|
||||||
|
}
|
@ -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
|
* User settings page
|
||||||
*/
|
*/
|
||||||
|
@ -90,6 +90,20 @@ ComunicWeb.components.menuBar.authenticated = {
|
|||||||
openPage("conversations");
|
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
|
//Add settings link
|
||||||
var settingsButton = createElem2({
|
var settingsButton = createElem2({
|
||||||
appendTo: dropdownContent,
|
appendTo: dropdownContent,
|
||||||
|
42
assets/js/pages/groups/main.js
Normal file
42
assets/js/pages/groups/main.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
36
assets/js/pages/groups/pages/main.js
Normal file
36
assets/js/pages/groups/pages/main.js
Normal 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");
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
@ -51,6 +51,16 @@ ComunicWeb.pagesList = {
|
|||||||
needLogin: true
|
needLogin: true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Groups page
|
||||||
|
*/
|
||||||
|
groups: {
|
||||||
|
pageTitle: "Groups",
|
||||||
|
methodHandler: "ComunicWeb.pages.groups.main.open",
|
||||||
|
disableMenus: false,
|
||||||
|
needLogin: false
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User settings page
|
* User settings page
|
||||||
*/
|
*/
|
||||||
|
@ -216,6 +216,10 @@ class Dev {
|
|||||||
"css/pages/conversations/listPane.css",
|
"css/pages/conversations/listPane.css",
|
||||||
"css/pages/conversations/conversation.css",
|
"css/pages/conversations/conversation.css",
|
||||||
|
|
||||||
|
//Groups page
|
||||||
|
//Groups pages
|
||||||
|
"css/pages/groups/pages/main.css",
|
||||||
|
|
||||||
//Settings page
|
//Settings page
|
||||||
//Sections sections
|
//Sections sections
|
||||||
"css/pages/settings/sections/general.css",
|
"css/pages/settings/sections/general.css",
|
||||||
@ -404,6 +408,11 @@ class Dev {
|
|||||||
"js/pages/conversations/conversation.js",
|
"js/pages/conversations/conversation.js",
|
||||||
"js/pages/conversations/utils.js",
|
"js/pages/conversations/utils.js",
|
||||||
|
|
||||||
|
|
||||||
|
//Groups page
|
||||||
|
"js/pages/groups/main.js",
|
||||||
|
"js/pages/groups/pages/main.js",
|
||||||
|
|
||||||
//User settings page
|
//User settings page
|
||||||
"js/pages/settings/main.js",
|
"js/pages/settings/main.js",
|
||||||
"js/pages/settings/navigationPane.js",
|
"js/pages/settings/navigationPane.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user