diff options
Diffstat (limited to 'addons/mail/static/src/xml/thread.xml')
| -rw-r--r-- | addons/mail/static/src/xml/thread.xml | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml new file mode 100644 index 00000000000..28717bc70a3 --- /dev/null +++ b/addons/mail/static/src/xml/thread.xml @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="UTF-8"?> +<templates xml:space="preserve"> + + <t t-name="mail.ChatThread"> + <t t-if="messages.length"> + <t t-if="options.display_load_more && options.display_order == ORDER.ASC" + t-call="mail.ChatThread.LoadMore"/> + <t t-call="mail.ChatThread.Content"/> + <t t-if="options.display_load_more && options.display_order == ORDER.DESC" + t-call="mail.ChatThread.LoadMore"/> + </t> + <t t-if="!messages.length && options.no_content_helper"> + <div class="o_chat_help_message"> + <t t-raw="options.no_content_helper"/> + </div> + </t> + </t> + + <t t-name="mail.ChatThread.Content"> + <t t-set="current_day" t-value="0"/> + <t t-foreach="messages" t-as="message"> + <div t-if="current_day != message.date.split(' ')[0]" class="o_thread_date_separator"> + <span class="o_thread_date"> + <t t-raw="moment(message.date, 'YYYY-MM-DD hh:mm:ss').format('LL')"/> + </span> + <t t-set="current_day" t-value="message.date.split(' ')[0]"/> + </div> + + <t t-call="mail.ChatThread.Message"/> + </t> + </t> + + <t t-name="mail.ChatThread.Message"> + <div class="o_thread_message" t-att-data-message-id="message.id"> + <div t-if="options.display_avatar" class="o_thread_message_avatar"> + <img t-if="message.avatar_src" t-att-src="message.avatar_src" class="o_thread_message_avatar_img"/> + </div> + <div class="o_thread_message_core"> + <span class="pull-right"> + <i t-if="message.is_needaction && options.display_needactions" class="fa fa-check o_thread_message_needaction" t-att-data-message-id="message.id" t-att-title="_t('Mark as Done')"/> + <i t-att-class="'fa fa-lg o_thread_message_star ' + (message.is_starred ? 'fa-star' : 'fa-star-o')" t-att-data-message-id="message.id" t-att-title="_t('Mark as Todo')"/> + </span> + <p class="text-muted"> + <t t-if="message.is_note"> + Note by + </t> + <t t-if="message.author_id && message.author_id[1]"> + <strong class="o_mail_redirect" data-oe-model="res.partner" t-att-data-oe-id="message.author_id[0]"><t t-esc="message.author_id[1]"/></strong> + </t> + <t t-if="!message.author_id || !message.author_id[1]"> + <strong class="o_mail_redirect"><t t-esc="message.displayed_author"/></strong> + </t> + + <small t-att-title="moment(message.date, 'YYYY-MM-DD hh:mm:ss').format('LLL')"> + - <t t-esc="moment(message.date, 'YYYY-MM-DD hh:mm:ss').format('hh:mm')"/> + </small> + <t t-if="message.model && (message.model != 'mail.channel') && options.display_document_link"> + 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> + </p> + <t t-if="message.tracking_value_ids && message.tracking_value_ids.length > 0"> + <t t-call="mail.ChatThread.MessageTracking"/> + </t> + <div t-if="message.subject" class="o_mail_subject">Subject: <t t-esc="message.subject"/></div> + <t t-if="!(message.tracking_value_ids && message.tracking_value_ids.length > 0)"> + <t t-raw="message.body"/> + </t> + <t t-foreach="message.attachment_ids" t-as="attachment"> + <t t-call="mail.Attachment"/> + </t> + </div> + </div> + </t> + + <t t-name="mail.ChatThread.MessageTracking"> + <ul class="o_mail_thread_message_tracking"> + <t t-foreach='message.tracking_value_ids' t-as='value'> + <li> + <t t-esc="value.changed_field"/>: + <t t-if="value.old_value"> + <span> <t t-esc="value.old_value"/> </span> + <span class="fa fa-long-arrow-right"/> + </t> + <span> <t t-esc="value.new_value"/> </span> + </li> + </t> + </ul> + </t> + + <t t-name="mail.ChatComposer.Attachments"> + <div class="o_attachments"> + <t t-foreach="attachments" t-as='attachment'> + <t t-call="mail.Attachment"> + <t t-set="editable" t-value="true"/> + </t> + </t> + </div> + </t> + + <t t-name="mail.Attachment"> + <div t-attf-class="o_attachment #{attachment.upload ? 'o_attachment_uploading' : ''}" t-att-title="attachment.name"> + <a class="o_image" t-att-href='attachment.url' target="_blank" t-att-data-mimetype="attachment.mimetype" t-attf-data-src="/web/image/#{attachment.id}/100x80"> + <span class='o_attachment_name'><t t-raw='attachment.name'/></span> + </a> + <t t-if="editable"> + <div class="o_attachment_delete"> + <i class='fa fa-times-circle' title="Delete this attachment" t-att-data-id="attachment.id"/> + </div> + <div class="o_attachment_progress_bar"> + Uploading + </div> + </t> + </div> + </t> + + <t t-name="mail.ChatThread.LoadMore"> + <div t-if="!all_messages_loaded" class="o_thread_show_more"> + <button class="btn btn-sm btn-link">-------- Show more messages --------</button> + </div> + </t> + +</templates> |
