From bc03c915d426409e8b1165eafb6cab61d539aa95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 5 Feb 2016 15:00:48 +0100 Subject: [PATCH] [FIX] mail: various UI fixes - correct template for undo snackbar - better padding for chat windows - recent messages now display 'now' instead of 'a few seconds ago' --- addons/mail/i18n/mail.pot | 5 +++++ addons/mail/static/src/js/client_action.js | 2 +- addons/mail/static/src/js/thread.js | 8 ++++++-- addons/mail/static/src/less/chat_window.less | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/addons/mail/i18n/mail.pot b/addons/mail/i18n/mail.pot index da6c9d4545a..7cad15e30fb 100644 --- a/addons/mail/i18n/mail.pot +++ b/addons/mail/i18n/mail.pot @@ -2058,6 +2058,11 @@ msgstr "" msgid "Notify followers of the document (mass post only)" msgstr "" +#. module: mail +#: code:addons/mail/static/src/js/thread.js:140 +msgid "now" +msgstr "" + #. module: mail #: model:ir.model.fields,field_description:mail.field_mail_channel_message_needaction_counter #: model:ir.model.fields,field_description:mail.field_mail_thread_message_needaction_counter diff --git a/addons/mail/static/src/js/client_action.js b/addons/mail/static/src/js/client_action.js index b2ea7eb732e..bc492aabcc6 100644 --- a/addons/mail/static/src/js/client_action.js +++ b/addons/mail/static/src/js/client_action.js @@ -390,7 +390,7 @@ var ChatAction = Widget.extend(ControlPanelMixin, { if (channel.type !== 'static') { // Display snackbar if needactions have been cleared if (channel.needaction_counter > 0) { - self.render_snackbar('mail.chat.MessageSentSnackbar', { + self.render_snackbar('mail.chat.UndoSnackbar', { nb_needactions: channel.needaction_counter, }); } diff --git a/addons/mail/static/src/js/thread.js b/addons/mail/static/src/js/thread.js index dc2467d3862..de61822b4de 100644 --- a/addons/mail/static/src/js/thread.js +++ b/addons/mail/static/src/js/thread.js @@ -137,8 +137,12 @@ var Thread = Widget.extend({ var date = msg.date.format('YYYY-MM-DD'); if (date === moment().format('YYYY-MM-DD')) { - msg.day = _t("Today"); - msg.hour = msg.date.fromNow(); + msg.day = _t("Today"); + if (moment().diff(msg.date, 'minutes') === 0) { + msg.hour = _t("now"); + } else { + msg.hour = msg.date.fromNow(); + } } else if (date === moment().subtract(1, 'days').format('YYYY-MM-DD')) { msg.day = _t("Yesterday"); msg.hour = msg.date.format('LT'); diff --git a/addons/mail/static/src/less/chat_window.less b/addons/mail/static/src/less/chat_window.less index 48efa703417..d4a621a5f43 100644 --- a/addons/mail/static/src/less/chat_window.less +++ b/addons/mail/static/src/less/chat_window.less @@ -60,7 +60,6 @@ .o_mail_thread { .o-flex(1, 1, auto); overflow: auto; - padding: 5px; .o_thread_date_separator { margin-top: 0px; @@ -74,6 +73,7 @@ .o_thread_message_sidebar { margin-right: 5px; } + padding: 4px 5px; } }