mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 12:25:16 +00:00
Fixed error in login functions and prepared home controller
This commit is contained in:
26
assets/js/pages/home/home.js
Normal file
26
assets/js/pages/home/home.js
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Common homes functions
|
||||
*/
|
||||
ComunicWeb.pages.home.home = {
|
||||
/**
|
||||
* Open home page
|
||||
* @param {Object} additionnalData Additionnal data passed in the method
|
||||
* @param {element} targetElement Where the template will be applied
|
||||
* @returns {Boolean} False if it fails
|
||||
*/
|
||||
openHomePage: function(additionnalData, targetElement){
|
||||
//Check wether if user is logged in or not
|
||||
var userLoggedIn = ComunicWeb.user.userLogin.getUserLoginState();
|
||||
|
||||
//Dev feature : Show result
|
||||
if(userLoggedIn){
|
||||
targetElement.appendChild(ComunicWeb.common.messages.createCalloutElem("", "User logged in !", "info"));
|
||||
}
|
||||
else{
|
||||
targetElement.appendChild(ComunicWeb.common.messages.createCalloutElem("", "User not logged in !", "warning"));
|
||||
}
|
||||
|
||||
//Everything seems to be OK
|
||||
return true;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user