summaryrefslogtreecommitdiff
path: root/addons/auth_signup/static/src
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2013-02-26 17:03:33 +0100
committerFabien Meghazi <fme@openerp.com>2013-02-26 17:03:33 +0100
commited5012ffb6ef0888893e4623da8ee45230f4a4b9 (patch)
tree69e98ea4c6d595c8eb6ed07892203dfb767466f1 /addons/auth_signup/static/src
parentce688b93e426c6f2edb0ad87181d0e937439b243 (diff)
[FIX] ... my own error
bzr revid: fme@openerp.com-20130226160333-nxshvoq8ydf4gfcp
Diffstat (limited to 'addons/auth_signup/static/src')
-rw-r--r--addons/auth_signup/static/src/js/auth_signup.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/addons/auth_signup/static/src/js/auth_signup.js b/addons/auth_signup/static/src/js/auth_signup.js
index 4cff913253e..d292febcc87 100644
--- a/addons/auth_signup/static/src/js/auth_signup.js
+++ b/addons/auth_signup/static/src/js/auth_signup.js
@@ -5,6 +5,8 @@ openerp.auth_signup = function(instance) {
instance.web.Login.include({
init: function() {
this._super.apply(this, arguments);
+ this.signup_enabled = false;
+ this.reset_password_enabled = false;
this.on('change:login-mode', this, function() {
/*
* Switches the login box to the select mode
@@ -16,6 +18,8 @@ openerp.auth_signup = function(instance) {
var modes = $(this).data('modes').split(/\s+/);
$(this).toggle(modes.indexOf(mode) > -1);
});
+ self.$('a.oe_signup_signup:visible').toggle(this.signup_enabled);
+ self.$('a.oe_signup_reset_password:visible').toggle(this.reset_password_enabled);
});
},
start: function() {
@@ -56,15 +60,10 @@ openerp.auth_signup = function(instance) {
self.$('a.oe_signup_reset_password').click(self.do_reset_password);
if (dbname) {
- self.rpc("/auth_signup/get_config", {dbname: dbname})
- .done(function(result) {
- if (result.signup) {
- self.set({ 'login-mode': 'signup' });
- }
- if (result.reset_password) {
- self.set({ 'login-mode': 'reset' });
- }
- });
+ self.rpc("/auth_signup/get_config", {dbname: dbname}).done(function(result) {
+ self.signup_enabled = result.signup;
+ self.reset_password_enabled = result.reset_password;
+ });
}
});
},
@@ -97,6 +96,7 @@ openerp.auth_signup = function(instance) {
this.show_error(_t("Invalid signup token"));
delete this.params.db;
delete this.params.token;
+ this.set({ 'login-mode': 'default' });
},
on_submit: function(ev) {