From b0c49718380c192af02b26fc50b5efb92439b525 Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 21 May 2018 10:05:32 +0200 Subject: [PATCH] Create empty password forgotten page --- assets/css/pages/passwordForgotten/main.css | 11 ++++ assets/js/common/functionsSchema.js | 14 +++++ assets/js/pages/passwordForgotten/main.js | 65 +++++++++++++++++++++ assets/js/pagesList.js | 9 +++ assets/templates/pages/login/loginPage.tpl | 3 + system/config/dev.config.php | 6 ++ 6 files changed, 108 insertions(+) create mode 100644 assets/css/pages/passwordForgotten/main.css create mode 100644 assets/js/pages/passwordForgotten/main.js diff --git a/assets/css/pages/passwordForgotten/main.css b/assets/css/pages/passwordForgotten/main.css new file mode 100644 index 00000000..383d05a4 --- /dev/null +++ b/assets/css/pages/passwordForgotten/main.css @@ -0,0 +1,11 @@ +/** + * Password forgotten page main stylesheet + * + * @author Pierre HUBERT + */ + +.box-password-forgotten { + max-width: 350px; + margin: auto; + margin-top: 20px; +} \ No newline at end of file diff --git a/assets/js/common/functionsSchema.js b/assets/js/common/functionsSchema.js index c8f91fcf..96950ff1 100644 --- a/assets/js/common/functionsSchema.js +++ b/assets/js/common/functionsSchema.js @@ -1273,6 +1273,20 @@ var ComunicWeb = { //TODO : implement }, + /** + * Password forgotten page + */ + passwordForgotten: { + + /** + * Main script + */ + main: { + //TODO : implement + }, + + }, + /** * Logout controller */ diff --git a/assets/js/pages/passwordForgotten/main.js b/assets/js/pages/passwordForgotten/main.js new file mode 100644 index 00000000..113db40c --- /dev/null +++ b/assets/js/pages/passwordForgotten/main.js @@ -0,0 +1,65 @@ +/** + * Password forgotten page main script file + * + * @author Pierre HUBERT + */ + +ComunicWeb.pages.passwordForgotten.main = { + + /** + * Open page + * + * @param {Object} args Additionnal data passed in the method + * @param {element} target Where the page will be applied + */ + open: function(args, target){ + + //Create the main form box + var box = createElem2({ + appendTo: target, + type: "div", + class: "box box-primary box-password-forgotten" + }); + + //Box head + var boxHead = createElem2({ + appendTo: box, + type: "div", + class: "box-header" + }); + + //Add box title + createElem2({ + appendTo: boxHead, + type: "h3", + class: "box-title", + innerHTML: "Password forgotten" + }); + + //Put elements at the right of the head of the box + var rightElems = createElem2({ + appendTo: boxHead, + type: "div", + class: "pull-right", + }); + + //Add cancel button + var cancelButton = createElem2({ + appendTo: rightElems, + type: "div", + class: "btn btn-danger btn-xs btn-flat", + innerHTML: "Cancel" + }); + cancelButton.addEventListener("click", function(ev){ + openPage("home"); + }); + + //Add box body + var boxBody = createElem2({ + appendTo: box, + type: "div", + class: "box-body" + }); + }, + +} \ No newline at end of file diff --git a/assets/js/pagesList.js b/assets/js/pagesList.js index 126012f2..9d9312ed 100644 --- a/assets/js/pagesList.js +++ b/assets/js/pagesList.js @@ -96,6 +96,15 @@ ComunicWeb.pagesList = { disableMenus: true, }, + /** + * Password forgotten page + */ + forgot_password: { + pageTitle: "Password forgotten", + methodHandler: "ComunicWeb.pages.passwordForgotten.main.open", + disableMenus: false, + }, + /** * 404 Page not found */ diff --git a/assets/templates/pages/login/loginPage.tpl b/assets/templates/pages/login/loginPage.tpl index 91b70c15..d19d14b5 100644 --- a/assets/templates/pages/login/loginPage.tpl +++ b/assets/templates/pages/login/loginPage.tpl @@ -39,6 +39,9 @@ + + + {create_account} diff --git a/system/config/dev.config.php b/system/config/dev.config.php index c6b2cbd2..a8ae1f99 100644 --- a/system/config/dev.config.php +++ b/system/config/dev.config.php @@ -225,6 +225,9 @@ class Dev { //Create account page "css/pages/createAccount.css", + + //Password forgotten page + "css/pages/passwordForgotten/main.css" ); /** @@ -407,6 +410,9 @@ class Dev { //Create account page "js/pages/createAccount.js", "js/pages/accountCreated.js", + + //Password forgotten page + "js/pages/passwordForgotten/main.js", //Logout page "js/pages/logout.js",