Added login form

This commit is contained in:
Pierre 2017-05-24 16:21:34 +02:00
parent 3020abc4bf
commit e04326c9f3
6 changed files with 79 additions and 16 deletions

View File

@ -1,13 +0,0 @@
// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
require('../../js/transition.js')
require('../../js/alert.js')
require('../../js/button.js')
require('../../js/carousel.js')
require('../../js/collapse.js')
require('../../js/dropdown.js')
require('../../js/modal.js')
require('../../js/tooltip.js')
require('../../js/popover.js')
require('../../js/scrollspy.js')
require('../../js/tab.js')
require('../../js/affix.js')

View File

@ -0,0 +1,12 @@
/**
* Menubar stylesheet
*
* @author Pierre HUBERT
*/
/**
* Login form
*/
.menubar-loginForm .form-control {
margin-right: 1px;
}

View File

@ -0,0 +1,5 @@
/**
* Mail caching controller
*
* @author Pierre HUBERT
*/

View File

@ -70,6 +70,17 @@ ComunicWeb.components.menuBar.common = {
ComunicWeb.common.page.openPage("home"); ComunicWeb.common.page.openPage("home");
}); });
//Create navbar collapsed button
var navbarCollapsedButton = createElem("button", navbarHeader);
navbarCollapsedButton.type = "button";
navbarCollapsedButton.className = "navbar-toggle collapsed";
navbarCollapsedButton.setAttribute("data-toggle", "collapse");
navbarCollapsedButton.setAttribute("data-target", "#navbar-collapse");
//Create navbar icon
var navbarCollapsIcon = createElem("i", navbarCollapsedButton);
navbarCollapsIcon.className = "fa fa-bars";
//Now we need to know if user is logged in or not //Now we need to know if user is logged in or not
var userLoggedIn = ComunicWeb.user.userLogin.getUserLoginState(); var userLoggedIn = ComunicWeb.user.userLogin.getUserLoginState();

View File

@ -8,9 +8,52 @@ ComunicWeb.components.menuBar.notAuthenticated = {
/** /**
* Add not-authenticated user specific elements * Add not-authenticated user specific elements
* *
* @param {HTMLElement} addElements The container element of the Menubar * @param {HTMLElement} container The container element of the Menubar
*/ */
addElements: function(addElements){ addElements: function(container){
//Create an auto-collapsed element
var navbarCollapse = createElem("div", container);
navbarCollapse.id = "navbar-collapse";
navbarCollapse.className = "navbar-collapse pull-right collapse";
//Create login form
var loginForm = createElem("form", navbarCollapse);
loginForm.className = "navbar-form navbar-left menubar-loginForm";
loginForm.setAttribute("role", "login");
loginForm.onsubmit = function(){
//Try to login user; in case of failure redirect
}
//Add email address formGroup
var emailFormGroup = createElem("div", loginForm);
emailFormGroup.className = "form-group";
//Add email input
var emailInput = createElem("input", emailFormGroup);
emailInput.className = "form-control";
emailInput.placeholder = "Email address";
emailInput.type = "email";
//Add password formGroup
var passwordFormGroup = createElem("div", loginForm);
passwordFormGroup.className = "form-group";
//Add password input
var passwordInput = createElem("input", passwordFormGroup);
passwordInput.className = "form-control";
passwordInput.placeholder = "Password";
passwordInput.type = "password";
//Add submit button formGroup
var submitFromGroup = createElem("div", loginForm);
submitFromGroup.className = "form-group";
//Add submit input
var submitInput = createElem("input", submitFromGroup);
submitInput.className = "form-control";
submitInput.value = "Login";
submitInput.type = "submit";
} }
} }

View File

@ -21,14 +21,19 @@ $config['CSSfiles'] = array(
//App stylesheets //App stylesheets
"%PATH_ASSETS%css/common/global.css", "%PATH_ASSETS%css/common/global.css",
"%PATH_ASSETS%css/common/page/waitSplashScreen.css", "%PATH_ASSETS%css/common/page/waitSplashScreen.css",
//Components stylesheets
"%PATH_ASSETS%css/components/menuBar.css",
); );
//JS files to include (at the end of the page) //JS files to include (at the end of the page)
$config['JSfiles'] = array( $config['JSfiles'] = array(
//Framewokr inclusions //Framewokr inclusions
"%PATH_ASSETS%adminLTE/plugins/jQuery/jquery-2.2.3.min.js", "%PATH_ASSETS%adminLTE/plugins/jQuery/jquery-2.2.3.min.js",
"%PATH_ASSETS%adminLTE/bootstrap/js/bootstrap.min.js",
"%PATH_ASSETS%adminLTE/plugins/jquery-ui/jquery-ui.min.js", "%PATH_ASSETS%adminLTE/plugins/jquery-ui/jquery-ui.min.js",
"%PATH_ASSETS%adminLTE/plugins/iCheck/icheck.min.js", "%PATH_ASSETS%adminLTE/plugins/iCheck/icheck.min.js",
"%PATH_ASSETS%adminLTE/dist/js/app.min.js",
//Utilities //Utilities
"%PATH_ASSETS%js/common/utils.js", "%PATH_ASSETS%js/common/utils.js",