diff options
| author | Aaron Bohy <aab@odoo.com> | 2015-11-18 11:16:18 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2015-11-23 16:29:08 +0100 |
| commit | faf5cea9480bfdd0635bccbc3a9ea88c19ceeb64 (patch) | |
| tree | 58fdebc6cc9b1b2a1148ad6fbcf80b3c35fd113e /addons/mail/static/src | |
| parent | 00630c5fd7844304122f7cbae59c5f329515fea5 (diff) | |
[FIX] mail: various UI improvements
- emoji are no more clickable in threads (they are only in the popover)
- correctly update channel needaction counter
- don't display 'New message' notification when the channel in detached
- display in the ui channels that send emails and other channels
- prevent notifications in mass mailing channels
- increase bottom padding in client action thread
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/js/chat_manager.js | 11 | ||||
| -rw-r--r-- | addons/mail/static/src/js/window_manager.js | 2 | ||||
| -rw-r--r-- | addons/mail/static/src/less/client_action.less | 5 | ||||
| -rw-r--r-- | addons/mail/static/src/less/composer.less | 6 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/client_action.xml | 4 |
5 files changed, 20 insertions, 8 deletions
diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index d16683d3647..239291628f0 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -200,6 +200,7 @@ function make_channel (data, options) { autoswitch: 'autoswitch' in options ? options.autoswitch : true, hidden: options.hidden, display_needactions: options.display_needactions, + mass_mailing: data.mass_mailing, needaction_counter: data.message_needaction_counter || 0, unread_counter: data.message_unread_counter || 0, last_seen_message_id: data.seen_message_id, @@ -330,10 +331,12 @@ function on_notification (notification) { function on_needaction_notification (message) { message = add_message(message, { channel_id: 'channel_inbox', show_notification: true} ); needaction_counter++; - var channel = chat_manager.get_channel(message.channel_ids[0]); - if (channel) { - channel.needaction_counter++; - } + _.each(message.channel_ids, function (channel_id) { + var channel = chat_manager.get_channel(channel_id); + if (channel) { + channel.needaction_counter++; + } + }); chat_manager.bus.trigger('update_needaction', needaction_counter); } diff --git a/addons/mail/static/src/js/window_manager.js b/addons/mail/static/src/js/window_manager.js index aacf2a2919f..2326ef14dc2 100644 --- a/addons/mail/static/src/js/window_manager.js +++ b/addons/mail/static/src/js/window_manager.js @@ -100,7 +100,7 @@ core.bus.on('web_client_ready', null, function () { chat_manager.bus.on('anyone_listening', null, function (channel, query) { _.each(chat_sessions, function (session) { - if (_.contains(channel.id, session.id)) { + if (channel.id === session.id) { query.is_displayed = true; } }); diff --git a/addons/mail/static/src/less/client_action.less b/addons/mail/static/src/less/client_action.less index 5e077caedd2..64f0afe507a 100644 --- a/addons/mail/static/src/less/client_action.less +++ b/addons/mail/static/src/less/client_action.less @@ -47,6 +47,10 @@ .o_mail_partner_unpin { padding: 2px 6px; } + i.fa-envelope-o { + margin-left: 3px; + } + } .o_mail_add_channel { width: 100%; @@ -76,6 +80,7 @@ .o-flex(1, 0, 0); overflow: auto; .o-webclient-padding(); + padding-bottom: 15px; .o_chat_help_message { padding: 25px 0; diff --git a/addons/mail/static/src/less/composer.less b/addons/mail/static/src/less/composer.less index f44d8b381d4..11cfbae04d3 100644 --- a/addons/mail/static/src/less/composer.less +++ b/addons/mail/static/src/less/composer.less @@ -7,17 +7,19 @@ text-align: justify; } -// Emoji size in the popover +// Emoji .o_mail_emoji { display: inline-block; height: 24px; width: 24px; > img { - cursor: pointer; width: 100%; } } +.o_composer_emoji .o_mail_emoji { + cursor: pointer; // only in the popover +} // Attachment Icons (common for chat thread and chat composer) // ------------------------------------------------------------------ diff --git a/addons/mail/static/src/xml/client_action.xml b/addons/mail/static/src/xml/client_action.xml index 89d7395073d..e3c2c1aeee2 100644 --- a/addons/mail/static/src/xml/client_action.xml +++ b/addons/mail/static/src/xml/client_action.xml @@ -78,7 +78,9 @@ <div t-if="channel.type === channel_type" t-att-data-channel-id="channel.id" t-attf-class="o_mail_chat_channel_item #{channel.unread_counter ? ' o_unread_message' : ''} #{(active_channel_id == channel.id) ? 'o_active': ''}"> <span><i t-if="display_status" t-att-class="'o_user_status fa ' + (channel.status == 'online' ? 'fa-circle' : 'fa-circle-o')"/></span> - <span t-if="display_hash" class="o_mail_hash">#</span> <t t-esc="channel.name"/> + <span t-if="display_hash" class="o_mail_hash">#</span> + <t t-esc="channel.name"/> + <i t-if="channel.mass_mailing" class="fa fa-envelope-o"/> <t t-call="mail.chat.SidebarNeedaction"/> <span t-attf-class="fa fa-times pull-right o_mail_partner_unpin #{counter ? 'hide' : ''}" t-att-title="_t('Close')" t-att-data-channel-id="channel.id"/> |
