empresa-libre/source/templates/login.html

40 lines
837 B
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
}
var values = form.getValues();
webix.ajax().post("/", values, function(text, data, xhr) {
var values = data.json();
if (values.login) {
window.location = "/main";
} else {
webix.message({ type:"error", text: values.msg });
}
});
};
webix.ready(function(){
webix.ui(ui_login);
});
</script>
</%block>