[REM] Remove LoginForm javascript
bzr revid: fme@openerp.com-20140205091749-39333kr3hz0dt4wg
This commit is contained in:
@@ -637,7 +637,10 @@ class Home(http.Controller):
|
|||||||
if uid is not False:
|
if uid is not False:
|
||||||
return http.redirect_with_hash(redirect)
|
return http.redirect_with_hash(redirect)
|
||||||
values['error'] = "Wrong login/password"
|
values['error'] = "Wrong login/password"
|
||||||
return render_bootstrap_template(request.session.db, 'web.login', values, lazy=True)
|
|
||||||
|
def callback(template, values):
|
||||||
|
return request.registry['ir.ui.view'].render(request.cr, openerp.SUPERUSER_ID, template, values)
|
||||||
|
return LazyResponse(callback, template='web.login', values=values)
|
||||||
|
|
||||||
@http.route('/login', type='http', auth="none")
|
@http.route('/login', type='http', auth="none")
|
||||||
def login(self, db, login, key, redirect="/web", **kw):
|
def login(self, db, login, key, redirect="/web", **kw):
|
||||||
|
|||||||
@@ -513,7 +513,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
|
|||||||
var fields = $(form).serializeArray();
|
var fields = $(form).serializeArray();
|
||||||
self.rpc("/web/database/create", {'fields': fields}).done(function(result) {
|
self.rpc("/web/database/create", {'fields': fields}).done(function(result) {
|
||||||
if (result) {
|
if (result) {
|
||||||
instance.web.redirect('/web')
|
instance.web.redirect('/web');
|
||||||
} else {
|
} else {
|
||||||
alert("Failed to create database");
|
alert("Failed to create database");
|
||||||
}
|
}
|
||||||
@@ -1483,24 +1483,6 @@ instance.web.embed = function (origin, dbname, login, key, action, options) {
|
|||||||
client.insertAfter(currentScript);
|
client.insertAfter(currentScript);
|
||||||
};
|
};
|
||||||
|
|
||||||
openerp.web.LoginForm = openerp.web.Widget.extend({
|
|
||||||
init: function ($form) {
|
|
||||||
this._super(/* no parent */);
|
|
||||||
this.setElement($form);
|
|
||||||
this.$el.on('submit', this.on_submit);
|
|
||||||
this.start();
|
|
||||||
},
|
|
||||||
start: function () {
|
|
||||||
if (location.hash) {
|
|
||||||
this.$el.attr('action', this.$el.attr('action') + location.hash);
|
|
||||||
}
|
|
||||||
return this._super();
|
|
||||||
},
|
|
||||||
on_submit: function () {
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:
|
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:
|
||||||
|
|||||||
@@ -47,6 +47,10 @@
|
|||||||
|
|
||||||
<template id="web.login_layout" name="Login Layout">
|
<template id="web.login_layout" name="Login Layout">
|
||||||
<t t-call="web.layout">
|
<t t-call="web.layout">
|
||||||
|
<t t-set="head">
|
||||||
|
<link href="/web/static/src/css/base.css" rel="stylesheet"/>
|
||||||
|
<link href="/web/static/lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
|
||||||
|
</t>
|
||||||
<t t-set="body_classname" t-value="'oe_single_form'"/>
|
<t t-set="body_classname" t-value="'oe_single_form'"/>
|
||||||
<div class="oe_single_form_container modal-content">
|
<div class="oe_single_form_container modal-content">
|
||||||
<div class="oe_single_form_logo">
|
<div class="oe_single_form_logo">
|
||||||
@@ -79,22 +83,7 @@
|
|||||||
|
|
||||||
<template id="web.login" name="Login">
|
<template id="web.login" name="Login">
|
||||||
<t t-call="web.login_layout">
|
<t t-call="web.login_layout">
|
||||||
<t t-set="head">
|
<form class="oe_login_form" role="form" t-attf-action="/web/login{{ '?debug' if debug else '' }}" method="post" onsubmit="this.action = this.action + location.hash">
|
||||||
<t t-foreach="css" t-as="css_file">
|
|
||||||
<link rel="stylesheet" t-att-href="css_file"/>
|
|
||||||
</t>
|
|
||||||
<t t-foreach="js" t-as="js_file">
|
|
||||||
<script type="text/javascript" t-att-src="js_file"></script>
|
|
||||||
</t>
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(function() {
|
|
||||||
var s = new openerp.init(<t t-raw="modules"/>);
|
|
||||||
var login_form = new openerp.web.LoginForm($('.oe_login_form'));
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</t>
|
|
||||||
|
|
||||||
<form class="oe_login_form" role="form" t-attf-action="/web/login{{ '?debug' if debug else '' }}" method="post">
|
|
||||||
|
|
||||||
<t t-call="web.database_select"/>
|
<t t-call="web.database_select"/>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user