From 42952bb7cf514b43eac598397e7bfad4cd943bc7 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 5 Feb 2014 10:17:49 +0100 Subject: [PATCH 001/221] [REM] Remove LoginForm javascript bzr revid: fme@openerp.com-20140205091749-39333kr3hz0dt4wg --- addons/web/controllers/main.py | 5 ++++- addons/web/static/src/js/chrome.js | 20 +------------------- addons/web/views/webclient_templates.xml | 21 +++++---------------- 3 files changed, 10 insertions(+), 36 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 02a909c5c92..d87d2b3cb1e 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -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): diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index afa761d7025..377c5755ce9 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -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: diff --git a/addons/web/views/webclient_templates.xml b/addons/web/views/webclient_templates.xml index 0e08f743f6c..6e80af9c32c 100644 --- a/addons/web/views/webclient_templates.xml +++ b/addons/web/views/webclient_templates.xml @@ -47,6 +47,10 @@