14818313d36b54c503b5980a273b1a9e3273cdd5
[odoo/odoo.git] / addons / mail / static / src / xml / mail.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <template>
3
4     <!--
5         mail.Widget template used to namespace the css -->
6     <t t-name="mail.Root">
7         <div class="oe_mail">
8         </div>
9     </t>
10
11     <!--
12         mail.compose_message template
13         This template holds the composition form to write a note or send
14         an e-mail. It contains by default a textarea, that will be replaced
15         by another composition form in the main wall composition form, or
16         for main thread composition form in document form view.
17
18         mail.compose_message.compact template
19         This template holds the composition form to write a message, this box is converted into
20         mail.compose_message when focus on textarea
21         -->
22     <t t-name="mail.compose_message">
23         <div t-if="widget.show_composer and !widget.options.readonly" t-attf-class="oe_msg oe_msg_composer #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''}">
24             <div class="oe_msg_left">
25                 <img class="oe_msg_icon" alt="User img" t-attf-src="#{widget.avatar}"/>
26             </div>
27             <div class="oe_msg_center">
28                 <div class="oe_msg_content">
29                     <button class="oe_full" title="Open the full mail composer"><span class='oe_e'>&amp;ograve</span></button>
30                     <t t-call="mail.thread.list_recipients"/>
31                     <textarea class="field_text"></textarea>
32                 </div>
33                 <div class="oe_msg_footer">
34                     <div class="oe_msg_attachment_list"></div>
35                     <button class="oe_post">
36                         <t t-if="!widget.is_log">Send</t>
37                         <t t-if="widget.is_log">Log an internal note</t>
38                     </button>
39                     <t t-call="mail.compose_message.add_attachment"/>
40                 </div>
41             </div>
42         </div>
43         <div t-if="widget.show_compact_message and !widget.show_composer and !widget.options.readonly" t-attf-class="oe_msg oe_msg_composer_compact #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''}">
44             <t t-if="widget.options.view_mailbox">
45                 <div class="field_text oe_compact oe_compact_inbox">
46                     <t t-if="widget.options.compose_placeholder" t-raw="widget.options.compose_placeholder"/>
47                     <t t-if="!widget.options.compose_placeholder and widget.options.view_mailbox">Share with my followers...</t>
48                 </div>
49             </t>
50             <t t-if="!widget.options.view_mailbox">
51                 <div class="field_text oe_compact oe_compact_record">
52                     <a class="oe_compose_post" t-if="widget.options.compose_placeholder"><t t-raw="widget.options.compose_placeholder"/></a>
53                     <a class="oe_compose_post" t-if="!widget.options.compose_placeholder and !widget.options.view_mailbox">Send a message</a>
54                     <t t-if="widget.options.display_log_button">
55                        <span class="oe_grey oe_sep_word">or</span>
56                        <a class="oe_compose_log">Log an internal note</a>
57                     </t>
58                 </div>
59             </t>
60         </div>
61         <span t-if="!(widget.show_compact_message and !widget.show_composer) and !widget.show_composer" class="oe_placeholder_compose"></span>
62     </t>
63
64     <!--
65         mail.compose_message.add_attachment template
66         Small template to be inserted in the composition for add attachments
67         -->
68     <t t-name="mail.compose_message.add_attachment">
69         <span class="oe_attachment_file">
70             <span class="oe_add">
71                 <!-- uploader of file -->
72                 <button class="oe_attach"><span class="oe_e">'</span></button> 
73                 <span class='oe_attach_label'>Attach a File</span>
74                 <t t-call="HiddenInputFile">
75                     <t t-set="fileupload_id" t-value="widget.fileupload_id"/>
76                     <t t-set="fileupload_action" t-translation="off">/web/binary/upload_attachment</t>
77                     <input type="hidden" name="model" value="mail.compose.message"/>
78                     <input type="hidden" name="id" value="0"/>
79                     <input type="hidden" name="session_id" t-att-value="widget.session.session_id"/>
80                 </t>
81             </span>
82         </span>
83     </t>
84
85     <!--
86         mail.thread.message.attachments template
87         Template used to display attachments in a mail.message
88         -->
89     <t t-name="mail.thread.message.attachments">
90         <t t-foreach='widget.attachment_ids' t-as='attachment'>
91             <t t-if="attachment.file_type_icon !== 'webimage'">
92                 <div t-attf-class="oe_attachment #{attachment.upload ? 'oe_uploading' : ''}">
93                     <a t-att-href='attachment.url' target="_blank">
94                         <img t-att-src="'/mail/static/src/img/mimetypes/' + attachment.file_type_icon + '.png'"></img>
95                         <div class='oe_name'><t t-raw='attachment.name' /></div>
96                     </a>
97                     <div class='oe_delete oe_e' title="Delete this attachment" t-att-data-id="attachment.id">[</div>
98                     <div class='oe_progress_bar'>
99                         uploading
100                     </div>
101                 </div>
102             </t>
103             <t t-if="attachment.file_type_icon === 'webimage'">
104                 <div t-attf-class="oe_attachment oe_preview #{attachment.upload ? 'oe_uploading' : ''}">
105                     <a t-att-href='attachment.url' target="_blank">
106                         <img t-att-src="widget.attachments_resize_image(attachment.id, [100,80])"></img>
107                         <div class='oe_name'><t t-raw='attachment.name' /></div>
108                     </a>
109                     <div class='oe_delete oe_e' title="Delete this attachment" t-att-data-id="attachment.id">[</div>
110                     <div class='oe_progress_bar'>
111                         uploading
112                     </div>
113                 </div>
114             </t>
115         </t>
116     </t>
117
118     <!--
119         template to the recipients list
120         -->
121     <t t-name="mail.thread.list_recipients">
122         <div class="oe_mail_list_recipients" t-if="!widget.is_log">
123             To:
124             <t t-if="!widget.is_private">
125                 <span class="oe_all_follower">
126                     <t t-if="widget.parent_thread.parent_message.record_name">
127                         Followers of <t t-raw="'&quot;' + widget.parent_thread.parent_message.record_name + '&quot;'"/>
128                     </t>
129                     <t t-if="!widget.parent_thread.parent_message.record_name and widget.options.view_inbox">My Followers</t>
130                     <t t-if="!widget.parent_thread.parent_message.record_name and !widget.options.view_inbox">Followers of this document</t>
131                 </span>
132             </t>
133             <t t-set="inc" t-value="0"/>
134             <t t-foreach="widget.partner_ids" t-as="partner">
135                 <t t-if="widget.is_private or (widget.user_pid != partner[0])">
136                     <t t-if="!widget.is_private and inc==0"> and </t>
137                         <span t-attf-class="oe_partner_follower #{inc>=3?'oe_hidden':''}"><t t-if="inc" t-raw="', '"/>
138                         <a t-if="widget.options.show_link" t-attf-href="#model=res.partner&amp;id=#{partner[0]}"><t t-esc="partner[1]"/></a>
139                         <t t-if="!widget.options.show_link" t-esc="partner[1]"/>
140                         </span>
141                         <t t-set="inc" t-value="inc+1"/>
142                     </t>
143             </t>
144             <t t-if="widget.partner_ids.length > 3">
145                 <span class="oe_more">, <a><t t-esc="widget.partner_ids.length - 3"/> others...</a></span>
146                 <a class="oe_more_hidden">&lt;&lt;&lt;</a>
147             </t>
148         </div>
149         <div class="oe_recipients" t-if="!widget.is_log">
150             <t t-foreach='widget.recipients' t-as='recipient'>
151                 <label t-attf-title="Add as recipient and follower (reason: #{recipient.reason})">
152                     <input type="checkbox" t-att-checked="recipient.checked ? 'checked' : undefined" t-att-data="recipient.full_name"/>
153                     <t t-esc="recipient.name"/> 
154                     <t t-if="recipient.email_address">(<t t-esc="recipient.email_address"/>)</t>
155                     <t t-if="!recipient.email_address">(no email address)</t>
156                 </label>
157             </t>
158         </div>
159         <div t-if="widget.is_log">
160             <span>Add an internal note that will not be sent to the followers</span>
161         </div>
162     </t>
163
164     <!-- 
165         wall main template
166         Template used to display the communication history in the wall.
167         -->
168     <div t-name="mail.wall" class="oe_view_manager oe_mail_wall oe_view_manager_current">
169         <table class="oe_view_manager_header">
170           <colgroup>
171             <col width="33%"/>
172             <col width="33%"/>
173             <col width="34%"/>
174           </colgroup>
175           <tbody>
176             <tr class="oe_header_row oe_header_row_top">
177                 <td colspan="2">
178                     <h2 class="oe_view_title">
179                         <span class="oe_view_title_text">
180                             <t t-esc="widget.action.name"/>
181                         </span>
182                     </h2>
183                     <t t-if="widget.action.params.header_description">
184                         <br/>
185                         <span class="oe_view_subtitle_text">
186                             <t t-raw="widget.action.params.header_description"/>
187                         </span>
188                     </t>
189                 </td>
190                 <td><div class="oe_view_manager_view_search"/></td>
191             </tr>
192           </tbody>
193         </table>
194         <div class="oe_view_manager_wrapper">
195             <div>
196                 <div class="oe_view_manager_body">
197                     <div class="oe_searchview_drawer_container"/>
198                     <div class="oe_mail-placeholder"></div>
199                     <aside class="oe_mail_wall_aside"></aside>
200                 </div>
201             </div>
202         </div>
203     </div>
204
205     <!--
206         Empty template that holds the sidebar of the Wall
207         -->
208     <t t-name="mail.wall.sidebar">
209         <div class="oe_mail_wall_sidebar"></div>
210     </t>
211
212     <!--
213         display message on the wall when there are no message
214         -->
215     <t t-name="mail.wall_no_message">
216         <div class="oe_view_nocontent">No messages.</div>
217     </t>
218
219     <!--
220         error message for uploading
221         -->
222     <t t-name="mail.error_upload">Uploading error</t>
223     <t t-name="mail.error_upload_please_wait">Please, wait while the file is uploading.</t>
224
225     <!--
226         record_thread main template
227         Template used to display the communication history in documents
228         form view.
229         -->
230     <div t-name="mail.record_thread" class="oe_record_thread">
231         <div class="oe_mail-placeholder">
232         </div>
233     </div>
234
235     <t t-name="mail.thread">
236         <div t-attf-class="oe_thread #{widget.root?'oe_root_thread':''}"/>
237     </t>
238
239     <!-- default layout -->
240     <t t-name="mail.thread.message">
241         <div t-attf-class="oe_msg #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''} #{widget.subtype ? '' : 'oe_msg_nobody'} oe_msg_#{widget.type}">
242
243             <div class='oe_msg_left'>
244                 <a t-if="widget.options.show_link" t-attf-href="#model=res.partner&amp;id=#{widget.author_id[0]}" t-att-title="widget.author_id[1]">
245                     <img class="oe_msg_icon" t-att-src="widget.avatar"/>
246                 </a>
247                 <img t-if="!widget.options.show_link" class="oe_msg_icon" t-att-src="widget.avatar"/>
248             </div>
249
250             <div class="oe_msg_center">
251                 <div class='oe_msg_icons' t-if="!widget.options.readonly">
252                     <span class='oe_read' t-if="widget.options.show_read"><a title="Done" class="oe_e">W</a></span>
253                     <span class='oe_unread' t-if="widget.is_favorite and widget.options.show_unread"><a title="Set back to Todo" class="oe_e">v</a></span>
254                     <span class='oe_unread' t-if="!widget.is_favorite and widget.options.show_unread"><a title="Move to Inbox" class="oe_e">v</a></span>
255                     <span class='oe_reply' t-if="widget.options.show_reply_button"><a title="Reply" class="oe_e">(</a></span>
256                     <span t-attf-class="oe_star #{widget.is_favorite?'oe_starred':''}"><a title="Mark as Todo" class="oe_e">7</a></span>
257                 </div>
258                 <!-- message itself -->
259                 <div class="oe_msg_content">
260                     <h1 t-if="(widget.show_record_name or widget.subject) and !widget.thread_level" class="oe_msg_title">
261                         <a t-if="widget.options.show_link and widget.show_record_name" class="oe_mail_action_model"
262                             t-attf-href="#action=mail.action_mail_redirect&amp;model=#{widget.model}&amp;res_id=#{widget.res_id}">
263                             <t t-esc="widget.record_name"/>
264                         </a>
265                         <span t-if="!widget.options.show_link and widget.show_record_name"><t t-esc="widget.record_name"/></span>
266                         <t t-if="widget.show_record_name and widget.subject">: </t>
267                         <t t-if="widget.subject" t-esc="widget.subject"/>
268                     </h1>
269                     <div class="oe_msg_body">
270                         <t t-if="widget.body_short">
271                             <div class="oe_msg_body_short"><t t-raw="widget.body_short"/></div>
272                             <div class="oe_msg_body_long" style="display: none;"><t t-raw="widget.body"/><span class="oe_mail_reduce"><a href="#">read less</a></span></div>
273                         </t>
274                         <t t-if="! widget.body_short">
275                             <t t-raw="widget.body"/>
276                         </t>
277                     </div>
278                 </div>
279                 <div class="oe_msg_footer">
280                     <t t-if="widget.attachment_ids.length > 0">
281                         <div class="oe_msg_attachment_list"></div>
282                     </t>
283                     <a t-if="widget.author_id and widget.options.show_link and widget.author_id[0]" t-attf-href="#model=res.partner&amp;id=#{widget.author_id[0]}" t-att-data-partner="widget.author_id[0]" class="oe_mail_action_author"><t t-esc="widget.author_id[2]"/></a>
284                     <span t-if="widget.author_id and (!widget.options.show_link or !widget.author_id[0])"><t t-esc="widget.author_id[2]"/></span>
285                     <t t-if="widget.type == 'notification'">
286                         updated document
287                         <t t-if="widget.partner_ids.length > 0">
288                             <span class='oe_subtle'>•</span>
289                         </t>
290                     </t>
291                     <t t-if="widget.type == 'comment' and ! widget.subtype and widget.partner_ids.length == 0">
292                         logged a note
293                     </t>
294                     <t t-if="(widget.type == 'comment' or widget.type == 'email') and (widget.subtype or widget.partner_ids.length > 0)">
295                         <!-- Remove nobody if user have no rights on partner that will display 'portal to nobody 5 minutes ago' that will confuse to end user, now it display 'portal 5 minutes ago' if no rights.-->
296                         <t t-if="widget.partner_ids.length > 0">
297                             to
298                         </t>
299                     </t>
300                     <t t-if="widget.type == 'notification' or ( (widget.type == 'email' or widget.type == 'comment') and (widget.subtype or widget.partner_ids.length > 0))"
301                             t-foreach="widget.partner_ids.slice(0, 3)" t-as="partner">
302                         <span t-attf-class="oe_partner_follower">
303                         <a t-if="widget.options.show_link" t-attf-href="#model=res.partner&amp;id=#{partner[0]}" t-att-data-partner="partner[0]" class="oe_mail_action_author"><t t-esc="partner[1]"/></a>
304                         <t t-if="!widget.options.show_link" t-esc="partner[1]"/>
305                         </span>
306                         <t t-if="!partner_last">,</t>
307                     </t>
308                     <t t-if="widget.partner_ids.length > 3">
309                         <span t-att-title="widget.extra_partners_str">and <t t-esc="widget.extra_partners_nbr"/> more</span>
310                     </t>
311                     <t t-if="widget.type == 'notification' and widget.partner_ids.length > 0">
312                         notified
313                     </t>
314                     <span class='oe_subtle'>•</span>
315                     <span t-att-title="widget.date">
316                         <t t-if="widget.timerelative" t-esc="widget.timerelative"/>
317                         <t t-if="!widget.timerelative" t-raw="widget.display_date"/>
318                     </span>
319                     <span t-if="!widget.options.readonly" class='oe_subtle'>•</span>
320                     <t t-if="!widget.options.readonly" t-call="mail.thread.message.vote"/>
321                 </div>
322             </div>
323         </div>
324     </t>
325
326     <!-- expandable message layout -->
327     <t t-name="mail.thread.expandable">
328         <div t-attf-class="oe_msg oe_msg_#{widget.type} #{widget.max_limit ? 'oe_max_limit' : ''} #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''}">
329             <div class="oe_msg_content oe_msg_more_message">
330                 <div class='oe_separator'></div>
331                 <a t-if="widget.nb_messages &lt;= 0" class="oe_msg_fetch_more">show more message</a>
332                 <a t-if="widget.nb_messages === 1" class="oe_msg_fetch_more">show one more message</a>
333                 <a t-if="widget.nb_messages &gt; 1" class="oe_msg_fetch_more">show <t t-esc="widget.nb_messages" /> more messages</a>
334             </div>
335         </div>
336     </t>
337
338     <!-- mail.thread.message.vote
339         Template used to display Like/Unlike in a mail.message
340     -->
341     <span t-name="mail.thread.message.vote">
342         <span class="oe_mail_vote_count" t-if='widget.vote_nb > 0'>
343             <t t-esc='widget.vote_nb' />
344             <i class="fa fa-thumbs-o-up"></i>
345         </span>
346         <a href='#' class="oe_msg_vote">
347             <t t-if="!widget.has_voted">like</t>
348             <t t-if="widget.has_voted">unlike</t>
349         </a>
350     </span>
351
352 </template>