diff options
| author | Dhruv Patel <dhp@odoo.com> | 2020-06-02 07:19:05 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-06-10 08:36:05 +0000 |
| commit | 3288304f59bb473be6d5a5f8caf66f54c131b116 (patch) | |
| tree | 26c4d6bf082ae11199930943c5593386d26a9c00 /addons/web/static/src/xml/notification.xml | |
| parent | 6c44424cd9230a23ba0262e5725698815530129e (diff) | |
[IMP] web,*: make notification title optional
*odoo_referral,portal
Currently, it is not possible to have one line notification,
when you are not passing the title parameter as an option when
generating the notification,then it will display the blank div
with the default button icon only. so it is not possible to have
one-line notifications since the title is mandatory.
So the purpose of the task is to make the title optional, allowing
for more minimalistic notification.
Also removed some unnecessary titles from the notification and
some stying change.
This commit also increase the autoclose delay of non sticky
notifications, from 2.5s to 4s.
task : 2264749
closes odoo/odoo#52229
Related: odoo/enterprise#10981
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Dhruv Patel <dhp@odoo.com>
Diffstat (limited to 'addons/web/static/src/xml/notification.xml')
| -rw-r--r-- | addons/web/static/src/xml/notification.xml | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/addons/web/static/src/xml/notification.xml b/addons/web/static/src/xml/notification.xml index 592c3ee23b0..03ff4cd637b 100644 --- a/addons/web/static/src/xml/notification.xml +++ b/addons/web/static/src/xml/notification.xml @@ -4,23 +4,27 @@ <t t-name="Notification"> <div t-attf-class="toast o_notification #{widget.className}" role="alert" aria-live="assertive" aria-atomic="true"> - <div class="toast-header"> + <t t-set="closeButton"> + <button t-if="widget.sticky" type="button" + class="close o_notification_close" + data-dismiss="toast" aria-label="Close"> + <span class="d-inline" aria-hidden="true">&times;</span> + </button> + </t> + <div t-if="widget.title" class="toast-header"> <span t-attf-class="fa fa-2x mr-3 #{widget.icon} o_notification_icon" role="img" t-attf-aria-label="Notification #{widget.name}" t-attf-title="Notification #{widget.name}"/> <div class="d-flex align-items-center mr-auto font-weight-bold o_notification_title" t-raw="widget.title"/> - <button t-if="widget.sticky" type="button" - class="mb-1 close o_notification_close" - data-dismiss="toast" aria-label="Close"> - <span class="d-inline" aria-hidden="true">&times;</span> - </button> + <t t-raw="closeButton"/> </div> - <div t-if="widget.message or widget.subtitle or widget.buttons.length" class="toast-body"> + <div t-if="widget.message or widget.subtitle or widget.buttons.length" class="toast-body d-flex"> <strong t-if="widget.subtitle" t-raw="widget.subtitle" class="o_notification_subtitle"/> <div t-if="widget.message" t-raw="widget.message" - class="o_notification_content"/> + class="mr-auto o_notification_content"/> + <t t-if="!widget.title" t-raw="closeButton"/> <div t-if="widget.buttons.length" class="mt-2 o_notification_buttons"> <button t-foreach="widget.buttons" t-as="button" type="button" t-attf-class="btn #{button.primary ? 'btn-primary' : 'btn-secondary'}"> |
