diff options
| author | Mathieu Duckaerts-Antoine <dam@odoo.com> | 2018-05-24 15:27:28 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2018-06-06 16:01:33 +0200 |
| commit | 299ebb2cdf63de2e3967da0d2f3e7effd239812b (patch) | |
| tree | f2681c0fc1e283acdfd5942392db8f17ddc7801d /addons/mail/static/src/xml/thread.xml | |
| parent | eeab18d753db21bca0636836c40df91268549390 (diff) | |
[IMP] mail: add moderation on channels
Purpose of this commit is to allow moderation on incoming messages in
discussion channels. On some channels on which moderation is required
messages should be in a pending moderation stage. Moderators can accept
or refuse messages as well as always allow or ban messages coming from
a given set of emails.
Channels now have an option to be moderated. Moderators can be added on
channels. They have access to a specific UI in Discuss to see and take
action on messages waiting for moderation.
Concerning mail.thread message that are pending moderation are not notified.
It means nobody receives a notification about them. Moderation process calls
the notification once the message is validated.
Various features included in this commit :
* a model is added to store the decision about emails, allow or ban;
* access rights are updated so that only moderators can modify moderation
fields on message;
* specific bus notifications are send to moderated people as well as to
moderators on incoming emails as well as when a decision is taken;
* options are added on channels to send explanations to moderated emails;
* options are added on channels to write and send guidelines explaining
why and how moderation is performed;
* a reminder is send daily to moderators with remaining messages to moderate;
* discuss UI is adapted and a new channel is added below Inbox and Starred
giving access to moderation tools;
* chanenl UI is adapted allowing to moderate directly inside channels;
This commit is linked to task ID 29521. Closes #21921.
Diffstat (limited to 'addons/mail/static/src/xml/thread.xml')
| -rw-r--r-- | addons/mail/static/src/xml/thread.xml | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml index 5ef23d46c43..20049e89cf6 100644 --- a/addons/mail/static/src/xml/thread.xml +++ b/addons/mail/static/src/xml/thread.xml @@ -103,6 +103,10 @@ <div class="o_thread_title">No starred message</div> <div>You can mark any message as 'starred', and it shows up in this channel.</div> </t> + <t t-if="options.channel_id==='channel_moderation'"> + <div class="o_thread_title">You have no message to moderate</div> + <div>Pending moderation messages appear here.</div> + </t> </div> <t t-name="mail.ChatThread.Content"> @@ -144,6 +148,7 @@ </div> <div class="o_thread_message_core"> <p t-if="message.display_author" class="o_mail_info text-muted"> + <input t-if="message.needsModeration and message.isModerator" type="checkbox" class="moderation_checkbox" t-att-data-message-id="message.id"/> <t t-if="message.is_note"> Note by </t> @@ -185,7 +190,7 @@ </span> </span> <span t-attf-class="o_thread_icons"> - <i t-if="options.display_stars && !message.is_system_notification" + <i t-if="options.display_stars and !message.is_system_notification and !message.needsModeration" t-att-class="'fa fa-lg o_thread_icon o_thread_message_star ' + (message.is_starred ? 'fa-star' : 'fa-star-o')" t-att-data-message-id="message.id" title="Mark as Todo"/> <i t-if="message.record_name && message.model != 'mail.channel' && options.display_reply_icon" @@ -194,6 +199,15 @@ <i t-if="message.is_needaction && options.display_needactions" class="fa fa-check o_thread_icon o_thread_message_needaction" t-att-data-message-id="message.id" title="Mark as Read"/> + + <t t-if="message.needsModeration and message.model === 'mail.channel'"> + <t t-if="message.isModerator"> + <t t-call="mail.MessageModerationDecision"/> + </t> + <t t-elif="message.is_author"> + <t t-call="mail.MessageModerationFeedback"/> + </t> + </t> </span> </p> <div class="o_thread_message_content"> @@ -227,6 +241,26 @@ </t> </t> + <t t-name="mail.MessageModerationDecision"> + <i class="o_thread_icon ml4 o_thread_message_moderation text-success" + t-att-data-message-id="message.id" data-decision="accept" title="Accept"><b>Accept |</b></i> + <i class="o_thread_icon ml4 o_thread_message_moderation text-danger" + t-att-data-message-id="message.id" data-decision="reject" title="Remove message with explanation"><b>Reject |</b></i> + <i class="o_thread_icon ml4 o_thread_message_moderation text-danger" + t-att-data-message-id="message.id" data-decision="discard" title="Remove message without explanation"><b>Discard |</b></i> + <i class="o_thread_icon ml4 o_thread_message_moderation text-success" + t-att-data-message-id="message.id" data-decision="allow" title="Add this email address to white list of people"><b>Always Allow |</b></i> + <i class="o_thread_icon ml4 o_thread_message_moderation text-danger" + t-att-data-message-id="message.id" 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> |
