From 67d1173bf381befc136d840e232514c2c9ef7e1b Mon Sep 17 00:00:00 2001 From: Sanjay Jamod Date: Mon, 11 Sep 2017 16:22:16 +0530 Subject: [PATCH] [IMP] auth_signup: Disable 'Sign Up' button to prevent user from continuous clicking --- addons/auth_signup/__manifest__.py | 1 + addons/auth_signup/static/src/js/signup.js | 16 ++++++++++++++++ addons/auth_signup/views/auth_signup_assets.xml | 8 ++++++++ .../views/auth_signup_login_templates.xml | 2 +- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 addons/auth_signup/static/src/js/signup.js create mode 100644 addons/auth_signup/views/auth_signup_assets.xml diff --git a/addons/auth_signup/__manifest__.py b/addons/auth_signup/__manifest__.py index 4aa4ef77662..bf3c9d64c81 100644 --- a/addons/auth_signup/__manifest__.py +++ b/addons/auth_signup/__manifest__.py @@ -20,6 +20,7 @@ Allow users to sign up and reset their password 'views/res_config_settings_views.xml', 'views/res_users_views.xml', 'views/auth_signup_login_templates.xml', + 'views/auth_signup_assets.xml', ], 'bootstrap': True, } diff --git a/addons/auth_signup/static/src/js/signup.js b/addons/auth_signup/static/src/js/signup.js new file mode 100644 index 00000000000..fc35d689d8a --- /dev/null +++ b/addons/auth_signup/static/src/js/signup.js @@ -0,0 +1,16 @@ +odoo.define('auth_signup.signup', function (require) { + 'use strict'; + +var base = require('web_editor.base'); + +base.ready().then(function() { + // Disable 'Sign Up' button to prevent user form continuous clicking + if ($('.oe_signup_form').length > 0) { + $('.oe_signup_form').on('submit', function () { + $('.o_signup_btn').attr('disabled', 'disabled'); + $('.o_signup_btn').prepend(' '); + }); + } +}); + +}); diff --git a/addons/auth_signup/views/auth_signup_assets.xml b/addons/auth_signup/views/auth_signup_assets.xml new file mode 100644 index 00000000000..23a1e01cf17 --- /dev/null +++ b/addons/auth_signup/views/auth_signup_assets.xml @@ -0,0 +1,8 @@ + + + + diff --git a/addons/auth_signup/views/auth_signup_login_templates.xml b/addons/auth_signup/views/auth_signup_login_templates.xml index a38596abe9c..46fee5ea375 100644 --- a/addons/auth_signup/views/auth_signup_login_templates.xml +++ b/addons/auth_signup/views/auth_signup_login_templates.xml @@ -50,7 +50,7 @@