diff options
| author | Aaron Bohy <aab@odoo.com> | 2015-11-10 12:19:38 +0100 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2015-11-12 08:51:56 +0100 |
| commit | 5264ccf0d0ebbfc6600ba5d3c0efc16bbe05c4d4 (patch) | |
| tree | 00a61360f7c5855b37f16d9bc728e64becdd9b2c /addons/mail/static/src/xml/client_action.xml | |
| parent | dbc1061854c42578905f2aa6ecd0e77e3732c01a (diff) | |
[IMP] mail: needactions and messages read
Mainly concern the client action:
- Display needactions per channels
- For all channels except Inbox, clear needactions when opening the channel
- Add snackbar to undo needactions clearing
- Display a separator between read and unread messages in threads
- Fix active channel (for Inbox and Starred) display in sidebar
Various minor changes in chat_manager:
- Code refactoring of bus notification handler
- get_channel() don't fallback anymore on first channel
Diffstat (limited to 'addons/mail/static/src/xml/client_action.xml')
| -rw-r--r-- | addons/mail/static/src/xml/client_action.xml | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/addons/mail/static/src/xml/client_action.xml b/addons/mail/static/src/xml/client_action.xml index aa6a9bad802..b6dcbb7e18a 100644 --- a/addons/mail/static/src/xml/client_action.xml +++ b/addons/mail/static/src/xml/client_action.xml @@ -10,11 +10,14 @@ </t> <t t-name="mail.chat.Sidebar"> <div class="o_mail_chat_sidebar"> - <div class="o_mail_chat_channel_item" data-channel-id="channel_inbox"> + <div t-attf-class="o_mail_chat_channel_item #{(active_channel_id == 'channel_inbox') ? 'o_active': ''}" + data-channel-id="channel_inbox"> @ Inbox + <t t-set="counter" t-value="needaction_counter"/> <t t-call="mail.chat.SidebarNeedaction"/> </div> - <div class="o_mail_chat_channel_item" data-channel-id="channel_starred"> + <div t-attf-class="o_mail_chat_channel_item #{(active_channel_id == 'channel_starred') ? 'o_active': ''}" + data-channel-id="channel_starred"> <span class="fa fa-star-o"/> Starred </div> @@ -47,8 +50,8 @@ </div> </t> <t t-name="mail.chat.SidebarNeedaction"> - <span t-attf-class="o_mail_sidebar_needaction badge pull-right #{(!needaction_counter ? 'hide' : '')}"> - <t t-esc="needaction_counter"/> + <span t-attf-class="o_mail_sidebar_needaction badge pull-right #{(!counter ? 'hide' : '')}"> + <t t-esc="counter"/> </span> </t> <t t-name="mail.chat.SidebarTitle"> @@ -71,10 +74,14 @@ </t> <t t-name="mail.chat.SidebarItems"> <t t-foreach="channels" t-as="channel"> - <div t-if="channel.type === channel_type" class="o_mail_chat_channel_item" t-att-data-channel-id="channel.id"> + <t t-set="counter" t-value="channel.needaction_counter"/> + <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 class="fa fa-times pull-right o_mail_partner_unpin" t-att-title="_t('Close')" t-att-data-channel-id="channel.id"/> + <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"/> </div> </t> <div t-if="!disable_add_channel" class="o_mail_add_channel" t-attf-data-type="#{channel_type}"> @@ -83,6 +90,16 @@ </div> </t> + <t t-name="mail.chat.UndoSnackbar"> + <div class="alert alert-dismissible o_mail_snackbar" role="alert"> + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> + <span aria-hidden="true">&times;</span> + </button> + <t t-esc="nb_needactions"/> message(s) marked as read. + <a href="#" class="alert-link o_snackbar_undo">Undo</a> + </div> + </t> + <!-- Buttons of the Control Panel --> <t t-name="mail.chat.ControlButtons"> <div> |
