summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/xml/thread.xml
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2018-10-10 11:39:08 +0000
committerAlexandre Kühn <aku@odoo.com>2018-10-16 07:29:07 +0000
commitc0c2590a40594ef749aeda3dfdc4c6754572a218 (patch)
tree60820e4c5fcddff665aca488787bb928912491c8 /addons/mail/static/src/xml/thread.xml
parent510065ab67bf8c3c413991de937b4447f9f915a9 (diff)
[FIX] mail: no moderation in chat window
Before this commit, a moderator of a moderated channel could see commands on 'pending moderation' messages in a chat window, although none of them work in chat windows. Those commands only work in Discuss. Making them work in chat windows is not trivial, because some code must be redesigned for this. This commit disables moderation commands in chat window. Moderators of such channel now see 'Pending moderation' on such messages in chat window, and mouse-hovering on this annotation tells the user to moderate those messages in the Discuss app. Task-ID 1887963
Diffstat (limited to 'addons/mail/static/src/xml/thread.xml')
-rw-r--r--addons/mail/static/src/xml/thread.xml29
1 files changed, 18 insertions, 11 deletions
diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml
index 0286aba8320..83d40bc7af1 100644
--- a/addons/mail/static/src/xml/thread.xml
+++ b/addons/mail/static/src/xml/thread.xml
@@ -13,6 +13,7 @@
@param {mail.model.AbstractThread} thread
@param {Object} options
@param {boolean} [options.displayEmptyThread]
+ @param {boolean} [options.displayModerationCommands]
@param {boolean} [options.displayNoMatchFound]
@param {Array} [options.domain=[]] the domain to restrict messages on the thread.
-->
@@ -264,6 +265,8 @@
@param {boolean} [options.displayDocumentLinks]
@param {boolean} [options.displayEmailIcons]
@param {boolean} [options.displayMarkAsRead]
+ @param {boolean} [options.displayModerationCommands] when set, display the moderation commands on
+ the message. This includes the moderation checkboxes (needs a control panel such as in Discuss app).
@param {boolean} [options.displayReplyIcons]
@param {boolean} [options.displayStars]
@param {boolean} [options.displaySubjectsOnMessages]
@@ -297,7 +300,7 @@
</div>
<div class="o_thread_message_core">
<p t-if="displayAuthorMessages[message.getID()]" class="o_mail_info text-muted">
- <input t-if="message.needsModeration() and message.needsModerationByUser()" type="checkbox" class="moderation_checkbox" t-att-data-message-id="message.getID()"/>
+ <input t-if="message.needsModeration() and message.needsModerationByUser() and options.displayModerationCommands" type="checkbox" class="moderation_checkbox" t-att-data-message-id="message.getID()"/>
<t t-if="message.isNote()">
Note by
</t>
@@ -343,12 +346,7 @@
t-att-data-message-id="message.getID()" title="Mark as Read" role="img" aria-label="Mark as Read"/>
<t t-if="message.needsModeration() and message.originatesFromChannel()">
- <t t-if="message.needsModerationByUser()">
- <t t-call="mail.MessageModerationDecision"/>
- </t>
- <t t-elif="message.isMyselfAuthor()">
- <t t-call="mail.MessageModerationFeedback"/>
- </t>
+ <t t-call="mail.MessageModeration"/>
</t>
</span>
</p>
@@ -403,6 +401,19 @@
<!--
@param {mail.model.Message} message
+ @param {Object} options
+ @param {boolean} [options.displayModerationCommands]
+ -->
+ <t t-name="mail.MessageModeration">
+ <i t-if="message.isMyselfAuthor()" class="text-danger" title="Your message is pending moderation"><b>Pending moderation</b></i>
+ <t t-elif="message.needsModerationByUser()">
+ <t t-if="options.displayModerationCommands" t-call="mail.MessageModerationDecision"/>
+ <i t-else="" class="text-danger" title="Open Channel in Discuss to moderate"><b>Pending moderation</b></i>
+ </t>
+ </t>
+
+ <!--
+ @param {mail.model.Message} message
-->
<t t-name="mail.MessageModerationDecision">
<i class="o_thread_icon ml4 o_thread_message_moderation text-success"
@@ -417,10 +428,6 @@
t-att-data-message-id="message.getID()" data-decision="ban" title="Ban this email address"><b>Ban</b></i>
</t>
- <t t-name="mail.MessageModerationFeedback">
- <i class="text-danger" title="Your message is pending moderation"><b>Pending moderation</b></i>
- </t>
-
<t t-name="mail.MessagesSeparator">
<div class="o_thread_new_messages_separator">
<span class="o_thread_separator_label">New messages</span>