empresa-libre/source/templates/login.html

49 lines
1.1 KiB
HTML
Raw Normal View History

2017-06-27 15:43:02 -05:00
<%inherit file="base.html"/>
<%block name="media">
<script src="/static/js/ui/login.js" type="text/javascript" ></script>
</%block>
<%block name="content">
<div id="form_login"></div>
<script type="text/javascript" charset="utf-8">
function validate_login(){
var form = this.getFormView();
if (!form.validate()) {
webix.message({ type:"error", text:"Valores inválidos" });
return
}
2017-09-21 23:24:18 -05:00
var values = form.getValues()
2017-06-27 15:43:02 -05:00
webix.ajax().post("/", values, function(text, data, xhr) {
var values = data.json();
if (values.login) {
2017-09-21 23:24:18 -05:00
if (values.super) {
window.location = "/admin"
}else{
window.location = "/main"
}
2017-06-27 15:43:02 -05:00
} else {
2017-09-21 23:24:18 -05:00
webix.message({ type:"error", text: values.msg })
2017-06-27 15:43:02 -05:00
}
});
};
webix.ready(function(){
webix.ui(ui_login);
2018-01-25 23:06:03 -06:00
webix.ajax().get("/values/titlelogin", function(text, data, xhr){
var value = data.json();
$$("title_login").setHTML(value);
})
2021-01-18 18:41:03 -06:00
$$("txt_rfc").focus();
2017-06-27 15:43:02 -05:00
});
</script>
</%block>