mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-24 01:48:50 +00:00
Created settings page
This commit is contained in:
parent
71932197fa
commit
991a950a42
11
assets/css/pages/settings/main.css
Normal file
11
assets/css/pages/settings/main.css
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Main settings styleesheet
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
.settings-page-container {
|
||||
max-width: 1000px;
|
||||
margin: auto;
|
||||
margin-top: 10px;
|
||||
}
|
@ -1057,6 +1057,26 @@ var ComunicWeb = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* User settings page
|
||||
*/
|
||||
settings: {
|
||||
|
||||
/**
|
||||
* Main script
|
||||
*/
|
||||
main: {
|
||||
//TODO : implement
|
||||
},
|
||||
|
||||
/**
|
||||
* Navigation pane
|
||||
*/
|
||||
navigationPane: {
|
||||
//TODO : implement
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* Login controller
|
||||
*/
|
||||
|
@ -75,6 +75,20 @@ ComunicWeb.components.menuBar.authenticated = {
|
||||
dropdownContent.className = "dropdown-menu"
|
||||
dropdownContent.setAttribute("role", "menu");
|
||||
|
||||
//Add settings link
|
||||
var settingsButton = createElem2({
|
||||
appendTo: dropdownContent,
|
||||
type: "li"
|
||||
});
|
||||
var settingsLink = createElem2({
|
||||
appendTo: settingsButton,
|
||||
type: "a",
|
||||
innerHTML: "Settings"
|
||||
});
|
||||
settingsButton.onclick = function(){
|
||||
openPage("settings");
|
||||
};
|
||||
|
||||
//Add logout link
|
||||
var logoutButton = createElem("li", dropdownContent);
|
||||
var logoutButtonLink = createElem("a", logoutButton);
|
||||
|
39
assets/js/pages/settings/main.js
Normal file
39
assets/js/pages/settings/main.js
Normal file
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* User settings main script file
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
ComunicWeb.pages.settings.main = {
|
||||
|
||||
/**
|
||||
* Open settings page
|
||||
*
|
||||
* @param {object} args Optionnal arguments
|
||||
* @param {HTMLElement} target The target for the page
|
||||
*/
|
||||
open: function(args, target){
|
||||
|
||||
//Settings page is organized like an array with two columns
|
||||
//Left column : settings sections menu
|
||||
//Rigth column : current settings section
|
||||
|
||||
//Create a row
|
||||
var row = createElem2({
|
||||
appendTo: target,
|
||||
type: "div",
|
||||
class: "row settings-page-container"
|
||||
});
|
||||
|
||||
//Left area
|
||||
var leftArea = createElem2({
|
||||
appendTo: row,
|
||||
type: "div",
|
||||
class: "col-md-3"
|
||||
});
|
||||
|
||||
//Display left navigation pane
|
||||
ComunicWeb.pages.settings.navigationPane.display(leftArea);
|
||||
},
|
||||
|
||||
}
|
65
assets/js/pages/settings/navigationPane.js
Normal file
65
assets/js/pages/settings/navigationPane.js
Normal file
@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Settings navigation pane
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
ComunicWeb.pages.settings.navigationPane = {
|
||||
|
||||
/**
|
||||
* Display the settings navigation pane
|
||||
*
|
||||
* @param {HTMLElement} target The target for the navigation pane
|
||||
*/
|
||||
display: function(target){
|
||||
|
||||
//Create a box
|
||||
var navigationBox = createElem2({
|
||||
appendTo: target,
|
||||
type: "div",
|
||||
class: "box box-solid"
|
||||
});
|
||||
|
||||
//Set box header
|
||||
var boxHeader = createElem2({
|
||||
appendTo: navigationBox,
|
||||
type: "div",
|
||||
class: "box-header with-border",
|
||||
|
||||
});
|
||||
|
||||
//Set box title
|
||||
createElem2({
|
||||
appendTo: boxHeader,
|
||||
type: "h3",
|
||||
class: "box-title",
|
||||
innerHTML: "Sections"
|
||||
});
|
||||
|
||||
//Create box body
|
||||
var boxBody = createElem2({
|
||||
appendTo: navigationBox,
|
||||
type: "div",
|
||||
class: "box-body no-padding"
|
||||
});
|
||||
|
||||
//Display the list of sections
|
||||
var elemList = createElem2({
|
||||
appendTo: boxBody,
|
||||
type: "ul",
|
||||
class: "nav nav-pills nav-stacked"
|
||||
});
|
||||
|
||||
//General account information
|
||||
var sectionGeneral = createElem2({
|
||||
appendTo: elemList,
|
||||
type: "li",
|
||||
});
|
||||
var sectionGeneralLink = createElem2({
|
||||
appendTo: sectionGeneral,
|
||||
type: "a",
|
||||
innerHTML: "<i class='fa fa-user'></i> General"
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -41,6 +41,15 @@ ComunicWeb.pagesList = {
|
||||
disableMenus: false
|
||||
},
|
||||
|
||||
/**
|
||||
* User settings page
|
||||
*/
|
||||
settings: {
|
||||
pageTitle: "Settings",
|
||||
methodHandler: "ComunicWeb.pages.settings.main.open",
|
||||
disableMenus: false
|
||||
},
|
||||
|
||||
/**
|
||||
* Login page
|
||||
*/
|
||||
|
@ -167,6 +167,9 @@ class Dev {
|
||||
//Latest post page stylesheet
|
||||
"css/pages/latestPosts/main.css",
|
||||
|
||||
//User account page
|
||||
"css/pages/settings/main.css",
|
||||
|
||||
//Create account page
|
||||
"css/pages/createAccount.css",
|
||||
);
|
||||
@ -315,6 +318,10 @@ class Dev {
|
||||
//Latest posts page
|
||||
"js/pages/latestPosts/main.js",
|
||||
|
||||
//User settings page
|
||||
"js/pages/settings/main.js",
|
||||
"js/pages/settings/navigationPane.js",
|
||||
|
||||
//Login page
|
||||
"js/pages/login.js",
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user