Progress on login page

This commit is contained in:
Pierre
2017-02-21 12:37:26 +01:00
parent 7ead57ce24
commit 59004555ec
7 changed files with 338 additions and 14 deletions

View File

@ -10,9 +10,40 @@ ComunicWeb.pages.login = {
*
* @param {Object} additionnalData Additionnal data passed in the method
* @param {element} targetElement Where the template will be applied
* @returns {Boolean} False if it fails
* @returns {Boolean} False if it fails
*/
openLoginPage: function(additionnalData, targetElement){
alert("login page to open !");
//First, check if user is already logged in or not
if(ComunicWeb.user.userLogin.getUserLoginState() === true){
//Log message
ComunicWeb.debug.logMessage("Couldn't open login page because user is already logged in !");
//Open home page
ComunicWeb.common.page.openPage("home");
//Quit page
return false;
}
//Prepare additional data
var additionalData = {};
//Preparing next actions
var afterParsingTemplate = function(){
//Change body class name
document.body.className = "login-page hold-transition";
//Enable iCheck
$(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
};
//Apply template
ComunicWeb.common.page.getAndShowTemplate(targetElement, additionalData, "pages/login/loginPage.tpl", afterParsingTemplate, true);
}
};