summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/xml
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2018-12-05 14:35:02 +0000
committerAlexandre Kühn <aku@odoo.com>2018-12-06 14:51:28 +0000
commit7ad45a04e1a368f132fcc83bbe992ce0e98ed3d2 (patch)
tree5b106206817e1f73251374879f6d18d174704559 /addons/mail/static/src/xml
parent9117d968e056d7c4e1112079e7e0ea0dd63cf9a5 (diff)
[IMP] im_livechat, mail: improved "is typing" notification
With this commit, the UI for "is typing..." notifications has changed. ** before **: In Discuss & chat windows, "is typing..." notification bar at the bottom of the thread, inside the conversation. ** after ** In chat windows, animated '...' next to conversation name. In Discuss, animated '...' next to conversation name in sidebar, and text below the composer. Task-ID 1881001
Diffstat (limited to 'addons/mail/static/src/xml')
-rw-r--r--addons/mail/static/src/xml/abstract_thread_window.xml3
-rw-r--r--addons/mail/static/src/xml/composer.xml8
-rw-r--r--addons/mail/static/src/xml/discuss.xml4
-rw-r--r--addons/mail/static/src/xml/thread.xml28
4 files changed, 27 insertions, 16 deletions
diff --git a/addons/mail/static/src/xml/abstract_thread_window.xml b/addons/mail/static/src/xml/abstract_thread_window.xml
index de0418af3df..89c45323c7a 100644
--- a/addons/mail/static/src/xml/abstract_thread_window.xml
+++ b/addons/mail/static/src/xml/abstract_thread_window.xml
@@ -11,6 +11,7 @@
<t t-set="status" t-value="widget.getThreadStatus()"/>
<t t-set="title" t-value="widget.getTitle()"/>
<t t-set="unreadCounter" t-value="widget.getUnreadCounter()"/>
+ <t t-set="thread" t-value="widget.getThread()"/>
</t>
</div>
<div class="o_thread_window_content">
@@ -58,6 +59,7 @@
name of the document.
@param {integer} [unreadCounter] the number of unread messages on the
thread.
+ @param {mail.model.Thread|undefined} thread
@param {Object} widget
@param {function} widget.isMobile function without any param that
states whether it should render for desktop or mobile screen.
@@ -70,6 +72,7 @@
<t t-if="status" t-call="mail.UserStatus"/>
<t t-esc="title"/>
<span t-if="unreadCounter"> (<t t-esc="unreadCounter"/>)</span>
+ <t t-if="thread and thread.hasTypingNotification() and thread.isSomeoneTyping()" t-call="mail.ThreadTypingIcon"/>
</span>
<span t-if="!widget.isMobile()" class="o_thread_window_buttons">
<a href="#" class="o_thread_window_close fa fa-close"/>
diff --git a/addons/mail/static/src/xml/composer.xml b/addons/mail/static/src/xml/composer.xml
index 883c9752035..6147197cd17 100644
--- a/addons/mail/static/src/xml/composer.xml
+++ b/addons/mail/static/src/xml/composer.xml
@@ -24,6 +24,7 @@
</div>
</div>
<div class="o_composer_attachments_list"/>
+ <div class="o_composer_thread_typing"/>
</div>
<div class="o_composer_send">
<button tabindex="3" class="btn btn-primary o_composer_button_send d-none d-md-inline-block" type="button"><t t-esc="widget.options.sendText"/></button>
@@ -40,6 +41,13 @@
</span>
</div>
+ <!--
+ @param {mail.model.Thread} thread
+ -->
+ <t t-name="mail.Composer.ThreadTyping">
+ <t t-esc="thread.getTypingMembersToText()"/>
+ </t>
+
<div t-name="mail.Composer.emojis" class="o_mail_emoji_container">
<t t-foreach="emojis" t-as="emoji">
<button t-att-data-emoji="emoji.sources[0]" class="btn btn-link o_mail_emoji" t-att-title="emoji.description" t-att-aria-label="emoji.description">
diff --git a/addons/mail/static/src/xml/discuss.xml b/addons/mail/static/src/xml/discuss.xml
index 605dcb53956..f97e38768e4 100644
--- a/addons/mail/static/src/xml/discuss.xml
+++ b/addons/mail/static/src/xml/discuss.xml
@@ -140,6 +140,10 @@
<t t-esc="_.unescape(thread.getName())"/>
<i t-if="thread.isMassMailing()" class="fa fa-envelope-o" title="Sends messages by email" role="img" aria-label="Send by mail"/>
</span>
+ <t t-if="channel.hasTypingNotification() and channel.isSomeoneTyping()">
+ <t t-set="thread" t-value="channel"/>
+ <t t-call="mail.ThreadTypingIcon"/>
+ </t>
<span t-attf-class="fa fa-cog o_mail_channel_settings"
title="Channel settings" role="img" aria-label="Channel settings" t-att-data-thread-id="thread.getID()"/>
<t t-call="mail.discuss.SidebarCounter"/>
diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml
index f28e071b2f3..a1e2d52e2ad 100644
--- a/addons/mail/static/src/xml/thread.xml
+++ b/addons/mail/static/src/xml/thread.xml
@@ -191,7 +191,6 @@
<t t-if="options.displayBottomThreadFreeSpace">
<div class="o_thread_bottom_free_space"/>
</t>
- <t t-if="thread.hasTypingNotification()" t-call="mail.widget.Thread.TypingNotificationBar"/>
</div>
</t>
@@ -217,27 +216,12 @@
<div class="o_mail_thread_content">
<t t-if="options.messagesSeparatorPosition == 'top'" t-call="mail.MessagesSeparator"/>
<t t-set="messages" t-value="messages.slice().reverse()"/>
- <t t-if="thread.hasTypingNotification()" t-call="mail.widget.Thread.TypingNotificationBar"/>
<t t-call="mail.widget.Thread.Messages"/>
<t t-if="options.displayLoadMore" t-call="mail.widget.Thread.LoadMore"/>
</div>
</t>
<!--
- @param {mail.model.AbstractThread} thread
- -->
- <t t-name="mail.widget.Thread.TypingNotificationBar">
- <t t-if="options.displayOrder === ORDER.ASC">
- <div class="o_thread_typing_notification_free_space"/>
- <div class="o_thread_typing_notification_bar o_thread_order_asc"/>
- </t>
- <t t-else="">
- <div class="o_thread_typing_notification_free_space"/>
- <div class="o_thread_typing_notification_bar o_thread_order_desc"/>
- </t>
- </t>
-
- <!--
@param {mail.model.AbstractMessage[]} messages messages are ordered based
on desired display order
-->
@@ -550,4 +534,16 @@
</t>
</div>
</t>
+
+ <!--
+ @param {mail.model.Thread} thread with typing feature
+ -->
+ <t t-name="mail.ThreadTypingIcon">
+ <span class="o_mail_thread_typing_icon" t-att-title="thread.getTypingMembersToText()">
+ <span class="o_mail_thread_typing_icon_dot"/>
+ <span class="o_mail_thread_typing_icon_dot"/>
+ <span class="o_mail_thread_typing_icon_dot"/>
+ </span>
+ </t>
+
</templates>