From 96f7bda09e2cec442046b34c80713894fd16bfb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Tue, 25 Sep 2018 18:29:16 +0200 Subject: [PATCH] [IMP] website: improve "new content" text & add block ui We don't want the user to click on the page while an installation is in progress. --- addons/website/static/src/js/menu/new_content.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/website/static/src/js/menu/new_content.js b/addons/website/static/src/js/menu/new_content.js index e764cc3f63f..397d7a5cf2b 100644 --- a/addons/website/static/src/js/menu/new_content.js +++ b/addons/website/static/src/js/menu/new_content.js @@ -23,10 +23,10 @@ var NewContentMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({ }), // allow text to be customized with inheritance newContentText: { - failed: _t('"%s" failed to install.'), + failed: _t('Failed to install "%s"'), installInProgress: _t("The installation of an App is already in progress."), - installNeeded: _t('You need to install the "%s" App in order to execute this action.'), - installPleaseWait: _t('Please wait while "%s" is being installed...'), + installNeeded: _t('Do you want to install the "%s" App?'), + installPleaseWait: _t('Installing "%s"'), }, /** @@ -135,10 +135,13 @@ var NewContentMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({ */ _install: function (moduleId) { this.pendingInstall = true; + $('body').css('pointer-events', 'none'); return this._rpc({ model: 'ir.module.module', method: 'button_immediate_install', args: [[moduleId]], + }).fail(function () { + $('body').css('pointer-events', ''); }); }, /**