summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/xml
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-10-26 16:46:09 +0100
committerAaron Bohy <aab@odoo.com>2015-11-03 16:19:35 +0100
commit388f7a7db9cd42142d86a768d1438af5af2f3b73 (patch)
tree1b1f7963d4ddcb253580b81d1893f0bd100f5798 /addons/mail/static/src/xml
parentb61c0d24993761b936766665823869f831fbb737 (diff)
[IMP] mail: composer: mention channels feature
Generalizes the mention mechanism to allow mentionning partners (@) and channels (#). When a user clicks on a mentionned channel, it subscribes to it and joins it. If the mention is in a chatter, the user is redirected to the Discuss client action. Moves the RPCs to get the menu and action id of the Discuss client action from systray.js to chat_managaer.js as they are now needed in the chatter as well. Also fixes the on_channel_clicked redirection for notification message (created/joined/left #channel). Those three messages are now of type notification, and correctly redirect on click.
Diffstat (limited to 'addons/mail/static/src/xml')
-rw-r--r--addons/mail/static/src/xml/composer.xml20
-rw-r--r--addons/mail/static/src/xml/thread.xml2
2 files changed, 18 insertions, 4 deletions
diff --git a/addons/mail/static/src/xml/composer.xml b/addons/mail/static/src/xml/composer.xml
index 77917c14924..d3f7d8875a0 100644
--- a/addons/mail/static/src/xml/composer.xml
+++ b/addons/mail/static/src/xml/composer.xml
@@ -3,7 +3,6 @@
<div t-name="mail.ChatComposer" class="o_chat_composer">
<div class="o_composer">
- <div class="dropup o_composer_mention_dropdown"/>
<textarea class="o_composer_input" placeholder="Write something"/>
<div class="btn-group o_composer_buttons">
<button class="btn btn-sm btn-primary o_composer_button_send" type="button">Send</button>
@@ -34,14 +33,14 @@
</t>
</t>
- <t t-name="mail.ChatComposer.MentionMenu">
+ <t t-name="mail.ChatComposer.MentionPartnerSuggestions">
<ul class="dropdown-menu" aria-labelledby="dropdownMailMentionMenu">
<t t-set="show_divider" t-value="false"/>
<t t-foreach="suggestions" t-as="group">
<t t-foreach="group" t-as="partner">
<li t-if="show_divider &amp;&amp; (partner_index === 0)" class="divider"/>
<t t-set="show_divider" t-value="true"/>
- <li class="o_mention_proposition" t-att-data-partner-id="partner.id">
+ <li class="o_mention_proposition" t-att-data-id="partner.id">
<a href="#">
<t t-esc="partner.name"/> <t t-if="partner.email">(<t t-esc="partner.email"/>)</t>
</a>
@@ -51,6 +50,21 @@
</ul>
</t>
+ <t t-name="mail.ChatComposer.MentionChannelSuggestions">
+ <ul class="dropdown-menu" aria-labelledby="dropdownMailMentionMenu">
+ <t t-set="show_divider" t-value="false"/>
+ <t t-foreach="suggestions" t-as="group">
+ <t t-foreach="group" t-as="channel">
+ <li t-if="show_divider &amp;&amp; (channel_index === 0)" class="divider"/>
+ <t t-set="show_divider" t-value="true"/>
+ <li class="o_mention_proposition" t-att-data-id="channel.id">
+ <a href="#"><t t-esc="channel.name"/></a>
+ </li>
+ </t>
+ </t>
+ </ul>
+ </t>
+
<t t-name="mail.ChatComposer.MentionTags">
<t t-if="partners.length">Mention(s): </t>
<t t-foreach="partners" t-as="partner">
diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml
index c2d09d1db57..006a4306876 100644
--- a/addons/mail/static/src/xml/thread.xml
+++ b/addons/mail/static/src/xml/thread.xml
@@ -84,7 +84,7 @@
on <a class="o_mail_redirect" href="#" t-att-data-oe-model="message.model" t-att-data-oe-id="message.res_id"><t t-esc="message.record_name"/></a>
</t>
<t t-if="message.origin_id &amp;&amp; (message.origin_id !== options.channel_id)">
- (in channel <a class="o_channel_redirect" t-att-data-channel-id="message.origin_id" href="#"><t t-esc="message.origin_name"/>)</a>
+ (in channel <a class="o_channel_redirect" t-att-data-oe-id="message.origin_id" href="#"><t t-esc="message.origin_name"/>)</a>
</t>
</p>
<t t-if="message.tracking_value_ids &amp;&amp; message.tracking_value_ids.length &gt; 0">