[REM] Remove LoginForm javascript
bzr revid: fme@openerp.com-20140205091749-39333kr3hz0dt4wg
This commit is contained in:
parent
6400ffb5e5
commit
42952bb7cf
|
@ -637,7 +637,10 @@ class Home(http.Controller):
|
|||
if uid is not False:
|
||||
return http.redirect_with_hash(redirect)
|
||||
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")
|
||||
def login(self, db, login, key, redirect="/web", **kw):
|
||||
|
|
|
@ -513,7 +513,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
|
|||
var fields = $(form).serializeArray();
|
||||
self.rpc("/web/database/create", {'fields': fields}).done(function(result) {
|
||||
if (result) {
|
||||
instance.web.redirect('/web')
|
||||
instance.web.redirect('/web');
|
||||
} else {
|
||||
alert("Failed to create database");
|
||||
}
|
||||
|
@ -1483,24 +1483,6 @@ instance.web.embed = function (origin, dbname, login, key, action, options) {
|
|||
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:
|
||||
|
|
|
@ -47,6 +47,10 @@
|
|||
|
||||
<template id="web.login_layout" name="Login 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'"/>
|
||||
<div class="oe_single_form_container modal-content">
|
||||
<div class="oe_single_form_logo">
|
||||
|
@ -79,22 +83,7 @@
|
|||
|
||||
<template id="web.login" name="Login">
|
||||
<t t-call="web.login_layout">
|
||||
<t t-set="head">
|
||||
<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">
|
||||
<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-call="web.database_select"/>
|
||||
|
||||
|
|
Loading…
Reference in New Issue