mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-25 21:39:21 +00:00
Created create account form
This commit is contained in:
parent
b6ec8f53e2
commit
99adb1ec0a
26
assets/css/pages/createAccount.css
Normal file
26
assets/css/pages/createAccount.css
Normal file
@ -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;
|
||||
}
|
@ -1065,6 +1065,15 @@ var ComunicWeb = {
|
||||
displayLoginError: function(){},
|
||||
},
|
||||
|
||||
/**
|
||||
* Create account controller
|
||||
*/
|
||||
createAccount: {
|
||||
|
||||
//TODO : implement
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Logout controller
|
||||
*/
|
||||
|
104
assets/js/pages/createAccount.js
Normal file
104
assets/js/pages/createAccount.js
Normal file
@ -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 <small><i class='fa fa-warning'></i> Warning! You will not be able to change this later !</small>",
|
||||
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"
|
||||
});
|
||||
},
|
||||
|
||||
}
|
@ -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
|
||||
*/
|
||||
|
@ -13,7 +13,7 @@
|
||||
<h3>Free social network that respect your privacy.</h3>
|
||||
<br />
|
||||
|
||||
<div class="btn btn-lg btn-primary">Create account</div>
|
||||
<a class="btn btn-lg btn-primary" target="create_account">Create account</a>
|
||||
<a class="btn btn-lg btn-success" target="login">Sign in</a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -166,6 +166,9 @@ class Dev {
|
||||
|
||||
//Latest post page stylesheet
|
||||
"css/pages/latestPosts/main.css",
|
||||
|
||||
//Create account page
|
||||
"css/pages/createAccount.css",
|
||||
);
|
||||
|
||||
/**
|
||||
@ -312,6 +315,9 @@ class Dev {
|
||||
//Login page
|
||||
"js/pages/login.js",
|
||||
|
||||
//Create account page
|
||||
"js/pages/createAccount.js",
|
||||
|
||||
//Logout page
|
||||
"js/pages/logout.js",
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user