diff options
| author | Romain Derie <rde@odoo.com> | 2020-01-27 15:25:56 +0000 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2020-02-03 15:25:20 +0000 |
| commit | d92f76592c1929e4cf876c615e3be03621b17abd (patch) | |
| tree | 6ed7fde6097ee4172f7556cb97a2f46c597f89bb /addons/website/static/src | |
| parent | 9725e61969c0cedc8ec700c3e60a5e8a9e83e89a (diff) | |
[IMP] website(_blog/_slides): show a toaster when a record is published
This commit shows a toaster when publishing a record through the toggle in the
topbar.
The `_description` field is used to do that, as it is supposed to contains a
'business oriented' descriptive name, see task-37311. Indeed, this field is
used in studio and in mail templates.
task-2144335
Diffstat (limited to 'addons/website/static/src')
| -rw-r--r-- | addons/website/static/src/js/content/website_root.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/website/static/src/js/content/website_root.js b/addons/website/static/src/js/content/website_root.js index a851ea3d2a9..6f7f8f21bea 100644 --- a/addons/website/static/src/js/content/website_root.js +++ b/addons/website/static/src/js/content/website_root.js @@ -161,6 +161,13 @@ var WebsiteRoot = publicRootData.PublicRoot.extend({ $data.toggleClass("css_unpublished css_published"); $data.find('input').prop("checked", result); $data.parents("[data-publish]").attr("data-publish", +result ? 'on' : 'off'); + if (result) { + self.displayNotification({ + type: 'success', + title: _t("Congratulation"), + message: _t("You've published your ") + $data.data('description'), + }); + } }) .guardedCatch(function (err, data) { data = data || {statusText: err.message.message}; |
