forked from elmau/empresa-libre
39 lines
1.3 KiB
JavaScript
39 lines
1.3 KiB
JavaScript
|
|
|
|
var msg_user = 'El usuario es requerido'
|
|
var msg_pass = 'La contraseña es requerida'
|
|
var form_controls = [
|
|
{view: 'text', label: 'Usuario', name: 'user', labelPosition: 'top',
|
|
required: true, invalidMessage: msg_user},
|
|
{view: 'text', label: 'Contraseña', name: 'pass', type: 'password',
|
|
required: true, labelPosition: 'top', invalidMessage: msg_pass},
|
|
{margin: 10, cols:[{}, {view: 'button', value: 'Iniciar Sesión',
|
|
click: 'validate_login', hotkey: 'enter'}, {}]}
|
|
]
|
|
|
|
|
|
var msg_header = 'Bienvenido a Empresa Libre'
|
|
var ui_login = {
|
|
rows: [
|
|
{maxHeight: 50},
|
|
{view: 'template', template: msg_header, maxHeight: 50, css: 'login_header'},
|
|
{maxHeight: 50},
|
|
{cols: [{}, {type: 'space', padding: 5,
|
|
rows: [
|
|
{view: 'template', template: 'Acceso al sistema', type: 'header'},
|
|
{
|
|
container: 'form_login',
|
|
view: 'form',
|
|
id: 'form_login',
|
|
width: 400,
|
|
elements: form_controls,
|
|
rules:{
|
|
user:function(value){ return value.trim() != '';},
|
|
pass:function(value){ return value.trim() != '';},
|
|
}
|
|
},
|
|
]}, {}, ]
|
|
},
|
|
]
|
|
}
|