flectra/addons/mail/static/src/xml/thread.xml

340 lines
17 KiB
XML

<?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 and options.display_order == ORDER.ASC"
t-call="mail.ChatThread.LoadMore"/>
<t t-call="mail.ChatThread.Content"/>
<t t-if="options.display_load_more and options.display_order == ORDER.DESC"
t-call="mail.ChatThread.LoadMore"/>
</t>
<t t-if="options.display_empty_channel">
<t t-call="mail.EmptyChannel" />
</t>
<div t-if="options.display_no_match" class="o_mail_no_content">
<div class="o_thread_title">No matches found</div>
<div>No message matches your search. Try to change your search filters.</div>
</div>
</t>
<t t-name="DocumentViewer.Content">
<div class="o_viewer_content">
<div class="o_viewer-header">
<h2 class="o_image_caption"><t t-esc="widget.activeAttachment.name"/></h2>
<ul class="list-inline pull-right">
<li t-if="widget.activeAttachment.type == 'image'">
<a class="o_print_btn" href="#">
<i class="fa fa-2x fa-print"/>
</a>
</li>
<li>
<a class="o_close_btn" href="#">
<i class="fa fa-2x fa-times"/>
</a>
</li>
</ul>
</div>
<div class="o_viewer_img_wrapper">
<div class="o_viewer_zoomer">
<div t-if="widget.activeAttachment.type == 'image'" class="o_loading_img">
<i class="fa fa-spinner fa-spin fa-3x fa-fw" aria-hidden="true"/>
</div>
<img t-if="widget.activeAttachment.type == 'image'" class="o_viewer_img" t-attf-src="/web/image/#{widget.activeAttachment.id}?unique=1"/>
<iframe class="mb48 o_viewer_pdf" t-if="widget.activeAttachment.type == 'application/pdf'" t-attf-src="/web/static/lib/pdfjs/web/viewer.html?file=/web/content/#{widget.activeAttachment.id}" />
<video t-if="widget.activeAttachment.type == 'video'" class="o_viewer_video" controls="controls">
<source t-attf-src="/web/image/#{widget.activeAttachment.id}" t-att-data-type="widget.activeAttachment.mimetype"/>
</video>
</div>
</div>
<div t-if="widget.activeAttachment.type == 'image'" class="o_viewer_toolbar">
<ul class="list-inline">
<li>
<a class="o_rotate" href="#">
<i class="fa fa-2x fa-repeat"></i>
</a>
</li>
<li>
<a class="o_zoom_out" href="#">
<i class="fa fa-2x fa-search-minus"></i>
</a>
</li>
<li>
<a class="o_zoom_in" href="#">
<i class="fa fa-2x fa-search-plus"></i>
</a>
</li>
<li>
<a class="o_download_btn" href="#">
<i class="fa fa-2x fa-download"/>
</a>
</li>
</ul>
</div>
</div>
</t>
<t t-name="DocumentViewer">
<div class="modal o_modal_fullscreen" tabindex="-1" data-keyboard="false" role="dialog" aria-hidden="true">
<t t-call="DocumentViewer.Content"/>
<t t-if="widget.attachment.length != 1">
<a class="arrow arrow-left move_previous" href="#">
<span class="fa fa-3x fa-chevron-left"/>
</a>
<a class="arrow arrow-right move_next" href="#">
<span class="fa fa-3x fa-chevron-right"/>
</a>
</t>
</div>
</t>
<t t-name="PrintImage">
<html>
<head>
<script>
function onload_img() {
setTimeout('print_img()', 10);
}
function print_img() {
window.print();
window.close();
}
</script>
</head>
<body onload='onload_img()'>
<img t-att-src='src' />
</body>
</html>
</t>
<!-- When a channel is empty-->
<div t-name="mail.EmptyChannel" class="o_mail_no_content">
<t t-if="options.channel_id==='channel_inbox'">
<div class="o_thread_title">Congratulations, your inbox is empty</div>
<div>New messages appear here.</div>
</t>
<t t-if="options.channel_id==='channel_starred'">
<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>
</div>
<t t-name="mail.ChatThread.Content">
<t t-if="options.messages_separator_position == 'top'" t-call="mail.MessagesSeparator"/>
<t t-set="current_day" t-value="0"/>
<t t-foreach="messages" t-as="message">
<div t-if="current_day != message.day" class="o_thread_date_separator">
<span class="o_thread_date">
<t t-esc="message.day"/>
</span>
<t t-set="current_day" t-value="message.day"/>
</div>
<t t-call="mail.ChatThread.Message"/>
</t>
</t>
<t t-name="mail.ChatThread.Message">
<div t-att-class="'o_thread_message' + (message.expanded ? ' o_message_expanded ' : ' ') + (message.is_selected ? 'o_thread_selected_message' : '')" t-att-data-message-id="message.id">
<div t-if="options.display_avatar" class="o_thread_message_sidebar">
<t t-if="!message.mailto and message.author_id[0]">
<img t-if="message.avatar_src and message.display_author"
t-att-src="message.avatar_src"
data-oe-model="res.partner"
t-att-data-oe-id="message.author_redirect ? message.author_id[0] : ''"
t-attf-class="o_thread_message_avatar img-circle #{message.author_redirect ? 'o_mail_redirect' : ''}"/>
</t>
<t t-if="message.mailto || !message.author_id[0]">
<img t-if="message.avatar_src and message.display_author"
t-att-src="message.avatar_src"
class="o_thread_message_avatar img-circle"/>
</t>
<span t-if="!message.display_author" t-att-title="message.date.format(date_format)" class="o_thread_message_side_date">
<t t-esc="message.date.format('hh:mm')"/>
</span>
<i t-if="!message.display_author and options.display_stars and message.message_type != 'notification'"
t-att-class="'fa o_thread_message_star o_thread_icon ' + (message.is_starred ? 'fa-star' : 'fa-star-o')"
t-att-data-message-id="message.id" title="Mark as Todo"/>
</div>
<div t-att-class="'o_thread_message_core' + (message.is_note ? ' o_mail_note' : '')">
<p t-if="message.display_author" class="o_mail_info">
<t t-if="message.is_note">
Note by
</t>
<strong t-if="message.mailto">
<a class="o_mail_mailto" t-attf-href="mailto:#{message.mailto}?subject=Re: #{message.subject}">
<t t-esc="message.mailto"/>
</a>
</strong>
<strong t-if="!message.mailto and message.author_id[0]"
data-oe-model="res.partner" t-att-data-oe-id="message.author_redirect ? message.author_id[0] : ''"
t-attf-class="o_thread_author #{message.author_redirect ? 'o_mail_redirect' : ''}">
<t t-esc="message.displayed_author"/>
</strong>
<strong t-if="!message.mailto and !message.author_id[0]" class="o_thread_author">
<t t-esc="message.displayed_author"/>
</strong>
- <small class="o_mail_timestamp" t-att-title="message.date.format(date_format)"><t t-esc="message.hour"/></small>
<t t-if="message.model and (message.model != 'mail.channel') and options.display_document_link">
on <a t-att-href="message.url" t-att-data-oe-model="message.model" t-att-data-oe-id="message.res_id" class="o_document_link"><t t-esc="message.record_name"/></a>
</t>
<t t-if="message.origin_id and (message.origin_id !== options.channel_id)">
(from <a t-att-data-oe-id="message.origin_id" href="#">#<t t-esc="message.origin_name"/></a>)
</t>
<span t-if="options.display_email_icon and message.customer_email_data and message.customer_email_data.length" class="o_thread_tooltip_container">
<i t-att-class="'o_thread_tooltip o_thread_message_email o_thread_message_email_' + message.customer_email_status + ' fa fa-envelope-o'"/>
<span class="o_thread_tooltip_content">
<t t-foreach="message.customer_email_data" t-as="customer">
<span>
<t t-if="customer[2] == 'sent'"><i class='fa fa-check'/></t>
<t t-if="customer[2] == 'bounce'"><i class='fa fa-exclamation'/></t>
<t t-if="customer[2] == 'exception'"><i class='fa fa-exclamation'/></t>
<t t-if="customer[2] == 'ready'"><i class='fa fa-send-o'/></t>
<t t-esc="customer[1]"/>
</span>
<br />
</t>
</span>
</span>
<span t-attf-class="o_thread_icons">
<i t-if="options.display_stars &amp;&amp; !message.is_system_notification"
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 &amp;&amp; message.model != 'mail.channel' &amp;&amp; options.display_reply_icon"
class="fa fa-reply o_thread_icon o_thread_message_reply"
t-att-data-message-id="message.id" title="Reply"/>
<i t-if="message.is_needaction &amp;&amp; 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"/>
</span>
</p>
<div class="o_thread_message_content">
<t t-if="message.tracking_value_ids and message.tracking_value_ids.length &gt; 0">
<t t-if="message.subtype_description">
<p><t t-esc="message.subtype_description"/></p>
</t>
<t t-call="mail.ChatThread.MessageTracking"/>
</t>
<p t-if="options.display_subject and message.display_subject" class="o_mail_subject">Subject: <t t-esc="message.subject"/></p>
<t t-if="!(message.tracking_value_ids and message.tracking_value_ids.length &gt; 0)">
<t t-raw="message.body"/>
</t>
<t t-foreach="message.attachment_ids" t-as="attachment">
<t t-call="mail.Attachment"/>
</t>
</div>
</div>
</div>
<t t-if="options.messages_separator_position == message.id">
<t t-call="mail.MessagesSeparator"/>
</t>
</t>
<t t-name="mail.MessagesSeparator">
<div class="o_thread_new_messages_separator">
<span class="o_thread_separator_label">New messages</span>
</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 || ((value.field_type !== 'boolean') and '')"/> </span>
<span t-if="value.old_value != value.new_value" class="fa fa-long-arrow-right"/>
</t>
<span t-if="value.old_value != value.new_value">
<t t-esc="value.new_value || ((value.field_type !== 'boolean') and '')"/>
</span>
</li>
</t>
</ul>
</t>
<t t-name="mail.ChatComposer.Attachments">
<div t-if="attachments.length > 0" 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">
<t t-set="type" t-value="attachment.mimetype and attachment.mimetype.split('/').shift()"/>
<div t-attf-class="o_attachment #{attachment.upload ? 'o_attachment_uploading' : ''}" t-att-title="attachment.name">
<t t-if="type == 'image'">
<div class="o_image_box">
<img t-attf-src="/web/image/#{attachment.id}/200x200/?crop=True"/>
<div t-attf-class="o_image_overlay o_attachment_view" t-att-data-id="attachment.id">
<a class="o_attachment_download" t-att-href='attachment.url' target="_blank">
<i t-attf-class="fa fa-2x fa-arrow-circle-o-down" title="Download this attachment" aria-hidden="true"></i>
</a>
</div>
</div>
</t>
<t t-elif="type == 'video'">
<div class="o_image_box o_image_preview">
<img class="o_image" t-att-data-mimetype="attachment.mimetype"/>
<div t-attf-class="o_image_overlay o_attachment_view" t-att-data-id="attachment.id">
<a class="o_attachment_play">
<i t-attf-class="fa fa-2x fa-play-circle" title="Play this video" aria-hidden="true"></i>
</a>
<a class="o_attachment_download" t-att-href='attachment.url' target="_blank">
<i t-attf-class="fa fa-2x fa-arrow-circle-o-down" title="Download this attachment" aria-hidden="true"></i>
</a>
</div>
</div>
</t>
<t t-elif="attachment.mimetype == 'application/pdf'">
<div class="o_image_box">
<div class="o_image_box">
<img src="/web/static/src/img/mimetypes/pdf.png"/>
<div class="o_image_overlay o_attachment_view" t-att-data-id="attachment.id">
<a class="o_attachment_download" t-att-href='attachment.url' target="_blank">
<i t-attf-class="fa fa-2x fa-arrow-circle-o-down" title="Download this PDF" aria-hidden="true"></i>
</a>
</div>
</div>
</div>
</t>
<t t-else="">
<div class="o_image_box">
<img class="o_image" t-att-data-mimetype="attachment.mimetype"/>
<div t-attf-class="o_image_overlay">
<a class="o_overlay_download" t-att-href='attachment.url' target="_blank"/>
<a class="o_attachment_download" t-att-href='attachment.url' target="_blank">
<i t-attf-class="fa fa-2x fa-arrow-circle-o-down" title="Download this attachment" aria-hidden="true"></i>
</a>
</div>
</div>
</t>
<div class="caption">
<a t-att-href='attachment.url' target="_blank">
<t t-esc='attachment.name'/>
</a>
</div>
<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 older messages --------</button>
</div>
</t>
</templates>