diff --git a/assets/css/pages/createAccount.css b/assets/css/pages/createAccount.css new file mode 100644 index 00000000..14475f81 --- /dev/null +++ b/assets/css/pages/createAccount.css @@ -0,0 +1,26 @@ +/** + * Create account stylesheet + * + * @author Pierre HUBERT + */ + +.create-account-form { + border: 1px gray solid; + max-width: 500px; + margin: auto; + margin-top: 30px; + padding: 0px 10px 10px 10px; +} + +.create-account-form h2 { + text-align: center; + margin-bottom: 20px; +} + +.create-account-form p { + text-align: center; +} + +.create-account-form .submit-form { + text-align: center; +} \ No newline at end of file diff --git a/assets/js/common/functionsSchema.js b/assets/js/common/functionsSchema.js index bd9ed2b7..ae5b5b0d 100644 --- a/assets/js/common/functionsSchema.js +++ b/assets/js/common/functionsSchema.js @@ -1065,6 +1065,15 @@ var ComunicWeb = { displayLoginError: function(){}, }, + /** + * Create account controller + */ + createAccount: { + + //TODO : implement + + }, + /** * Logout controller */ diff --git a/assets/js/pages/createAccount.js b/assets/js/pages/createAccount.js new file mode 100644 index 00000000..48a81433 --- /dev/null +++ b/assets/js/pages/createAccount.js @@ -0,0 +1,104 @@ +/** + * Create account page + * + * @author Pierre HUBERT + */ + +ComunicWeb.pages.createAccount = { + + /** + * Open create account page + * + * @param {Object} additionnalData Additionnal data passed in the method + * @param {element} target Where the page will be applied + */ + openPage: function(additionnalData, target){ + + //Display the account creation form + this._display_form(target); + + }, + + /** + * Display the account creation form + * + * @param {HTMLElement} target The target for the page + */ + _display_form: function(target){ + + //Create form root + var formRoot = createElem2({ + appendTo: target, + type: "div", + class: "create-account-form" + }); + + //Add a title + createElem2({ + appendTo: formRoot, + type: "h2", + innerHTML: "Create an account" + }); + + //Add a message + createElem2({ + appendTo: formRoot, + type: "p", + innerHTML: "Use the following form to create an account and join the network : " + }); + + //Input user first name + var firstNameInput = createFormGroup({ + target: formRoot, + label: "First name", + placeholder: "Your first name", + type: "text" + }); + + //Input user last name + var lastNameInput = createFormGroup({ + target: formRoot, + label: "Last name", + placeholder: "Your last name", + type: "text" + }); + + //Input user email + var emailInput = createFormGroup({ + target: formRoot, + label: "Email address Warning! You will not be able to change this later !", + placeholder: "Your email address", + type: "email" + }); + + //Input user password + var passwordInput = createFormGroup({ + target: formRoot, + label: "Password", + placeholder: "Your password", + type: "password" + }); + + //Confirm user password + var confirmPasswordInput = createFormGroup({ + target: formRoot, + label: "Confirm your password", + placeholder: "Your password", + type: "password" + }); + + //Submit form + var submitButtonContainer = createElem2({ + appendTo: formRoot, + type: "div", + class: "submit-form" + }); + var submitButton = createElem2({ + appendTo: submitButtonContainer, + type: "button", + class: "btn btn-primary", + innerHTML: "Create the account" + }); + }, + +} \ No newline at end of file diff --git a/assets/js/pagesList.js b/assets/js/pagesList.js index db93df0e..35a045b3 100644 --- a/assets/js/pagesList.js +++ b/assets/js/pagesList.js @@ -50,6 +50,15 @@ ComunicWeb.pagesList = { disableMenus: true, }, + /** + * Create account page + */ + create_account: { + pageTitle: "Create an account", + methodHandler: "ComunicWeb.pages.createAccount.openPage", + disableMenus: false + }, + /** * Logout page */ diff --git a/assets/templates/pages/home/landingPage/home.tpl b/assets/templates/pages/home/landingPage/home.tpl index 93148012..5c7f42ca 100644 --- a/assets/templates/pages/home/landingPage/home.tpl +++ b/assets/templates/pages/home/landingPage/home.tpl @@ -13,7 +13,7 @@

Free social network that respect your privacy.


-
Create account
+ Create account Sign in diff --git a/system/config/dev.config.php b/system/config/dev.config.php index f682ced6..c35c50f9 100644 --- a/system/config/dev.config.php +++ b/system/config/dev.config.php @@ -166,6 +166,9 @@ class Dev { //Latest post page stylesheet "css/pages/latestPosts/main.css", + + //Create account page + "css/pages/createAccount.css", ); /** @@ -311,6 +314,9 @@ class Dev { //Login page "js/pages/login.js", + + //Create account page + "js/pages/createAccount.js", //Logout page "js/pages/logout.js",