Send a request to the server to create the group

This commit is contained in:
Pierre HUBERT
2018-07-02 08:42:55 +02:00
parent 7ff7bceca3
commit 28cb1e22e7
6 changed files with 197 additions and 25 deletions

View File

@ -6,7 +6,7 @@
ComunicWeb.pages.groups.main = {
/**
/**
* Open settings page
*
* @param {object} args Optionnal arguments
@ -14,29 +14,34 @@ ComunicWeb.pages.groups.main = {
*/
open: function(args, target){
//Determine which page / group should be opened
if(!args.subfolder)
var page = "main";
else {
//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];
}
//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);
}
//Check if the main page has to be opened
if(page == "main" && signed_in()){
ComunicWeb.pages.groups.pages.main.open(target);
}
//Else the page was not found
else
ComunicWeb.common.error.pageNotFound(args, target);
}
//Check if the page to create a group has to be opened
else if (page == "create" && signed_in()){
ComunicWeb.pages.groups.pages.create.open(target);
}
//Else the page was not found
else
ComunicWeb.common.error.pageNotFound(args, target);
}
};