1e52105c73997685c72c1dd76adaeb9d2d883cf9
[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 a 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"
54                         title="Send a message to all followers of the document">Send a message</a>
55                     <span class="oe_grey oe_sep_word">or</span>
56                     <a class="oe_compose_log" title="Log a note for this document. No notification will be sent">Log a note</a>
57                 </div>
58             </t>
59         </div>
60         <span t-if="!(widget.show_compact_message and !widget.show_composer) and !widget.show_composer" class="oe_placeholder_compose"></span>
61     </t>
62
63     <!--
64         mail.compose_message.add_attachment template
65         Small template to be inserted in the composition for add attachments
66         -->
67     <t t-name="mail.compose_message.add_attachment">
68         <span class="oe_attachment_file">
69             <span class="oe_add">
70                 <!-- uploader of file -->
71                 <button class="oe_attach"><span class="oe_e">'</span></button> 
72                 <span class='oe_attach_label'>Attach a File</span>
73                 <t t-call="HiddenInputFile">
74                     <t t-set="fileupload_id" t-value="widget.fileupload_id"/>
75                     <t t-set="fileupload_action" t-translation="off">/web/binary/upload_attachment</t>
76                     <input type="hidden" name="model" value="mail.compose.message"/>
77                     <input type="hidden" name="id" value="0"/>
78                     <input type="hidden" name="session_id" t-att-value="widget.session.session_id"/>
79                 </t>
80             </span>
81         </span>
82     </t>
83
84     <!--
85         mail.thread.message.attachments template
86         Template used to display attachments in a mail.message
87         -->
88     <t t-name="mail.thread.message.attachments">
89         <t t-foreach='widget.attachment_ids' t-as='attachment'>
90             <t t-if="attachment.filetype !== 'webimage'">
91                 <div t-attf-class="oe_attachment #{attachment.upload ? 'oe_uploading' : ''}">
92                     <a t-att-href='attachment.url' target="_blank">
93                         <img t-att-src="'/mail/static/src/img/mimetypes/' + attachment.filetype + '.png'"></img>
94                         <div class='oe_name'><t t-raw='attachment.name' /></div>
95                     </a>
96                     <div class='oe_delete oe_e' title="Delete this attachment" t-att-data-id="attachment.id">[</div>
97                     <div class='oe_progress_bar'>
98                         uploading
99                     </div>
100                 </div>
101             </t>
102             <t t-if="attachment.filetype === 'webimage'">
103                 <div t-attf-class="oe_attachment oe_preview #{attachment.upload ? 'oe_uploading' : ''}">
104                     <a t-att-href='attachment.url' target="_blank">
105                         <img t-att-src="widget.attachments_resize_image(attachment.id, [100,80])"></img>
106                         <div class='oe_name'><t t-raw='attachment.name' /></div>
107                     </a>
108                     <div class='oe_delete oe_e' title="Delete this attachment" t-att-data-id="attachment.id">[</div>
109                     <div class='oe_progress_bar'>
110                         uploading
111                     </div>
112                 </div>
113             </t>
114         </t>
115     </t>
116
117     <!--
118         template to the recipients list
119         -->
120     <t t-name="mail.thread.list_recipients">
121         <div class="oe_mail_list_recipients" t-if="!widget.is_log">
122             To:
123             <t t-if="!widget.is_private">
124                 <span class="oe_all_follower">
125                     Followers of
126                     <t t-if="widget.parent_thread.parent_message.record_name" t-raw="'&quot;' + widget.parent_thread.parent_message.record_name + '&quot;'"/>
127                     <t t-if="!widget.parent_thread.parent_message.record_name">this document</t>
128                 </span>
129             </t>
130             <t t-if="!widget.is_private and (widget.partner_ids.length or (widget.author_id and widget.author_id[0]))"> and </t>
131             <t t-set="inc" t-value="0"/>
132             <t t-foreach="widget.partner_ids" t-as="partner">
133                 <span t-attf-class="oe_partner_follower #{inc>=3?'oe_hidden':''}"><t t-if="inc" t-raw="', '"/>
134                     <a t-if="widget.options.show_link" t-attf-href="#model=res.partner&amp;id=#{partner[0]}"><t t-esc="partner[1]"/></a>
135                     <t t-if="!widget.options.show_link" t-esc="partner[1]"/>
136                 </span>
137                 <t t-set="inc" t-value="inc+1"/>
138             </t>
139             <t t-if="widget.partner_ids.length > 3">
140                 <span class="oe_more">, <a><t t-esc="widget.partner_ids.length - 3"/> others...</a></span>
141                 <a class="oe_more_hidden">&lt;&lt;&lt;</a>
142             </t>
143         </div>
144         <div class="oe_recipients" t-if="!widget.is_log">
145             <t t-foreach='widget.recipients' t-as='recipient'>
146                 <label t-attf-title="Add as recipient and follower (reason: #{recipient.reason})">
147                     <input type="checkbox" t-att-checked="recipient.checked ? 'checked' : undefined" t-att-data="recipient.full_name"/>
148                     <t t-esc="recipient.name"/> 
149                     <t t-if="recipient.email_address">(<t t-esc="recipient.email_address"/>)</t>
150                     <t t-if="!recipient.email_address">(no email address)</t>
151                 </label>
152             </t>
153         </div>
154         <div t-if="widget.is_log">
155             <span>Attach a note that will not be sent to the followers</span>
156         </div>
157     </t>
158
159     <!-- 
160         wall main template
161         Template used to display the communication history in the wall.
162         -->
163     <div t-name="mail.wall" class="oe_view_manager oe_mail_wall oe_view_manager_current">
164         <table class="oe_view_manager_header">
165           <colgroup>
166             <col width="33%"/>
167             <col width="33%"/>
168             <col width="34%"/>
169           </colgroup>
170           <tbody>
171             <tr class="oe_header_row oe_header_row_top">
172                 <td colspan="2">
173                     <h2 class="oe_view_title">
174                         <span class="oe_view_title_text">
175                             <t t-esc="widget.action.name"/>
176                         </span>
177                     </h2>
178                     <t t-if="widget.action.params.header_description">
179                         <br/>
180                         <span class="oe_view_subtitle_text">
181                             <t t-raw="widget.action.params.header_description"/>
182                         </span>
183                     </t>
184                 </td>
185                 <td><div class="oe_view_manager_view_search" t-opentag="true"/></td>
186             </tr>
187             <tr class="oe_header_row" t-if="widget.action.params.view_inbox and widget.action.params.show_compose_message" >
188                 <td colspan="2">
189                     <button type="button" class="oe_write_full oe_highlight">
190                         Compose a new message
191                     </button>
192                     <span class='oe_alternative'>
193                         or
194                         <a href='#'  class='oe_write_onwall oe_bold' help='Your followers can read this message'>Write to my followers</a>
195                     </span>
196                 </td>
197             </tr>
198           </tbody>
199         </table>
200         <div class="oe_mail-placeholder"></div>
201     </div>
202
203     <!--
204         display message on the wall when there are no message
205         -->
206     <t t-name="mail.wall_no_message">
207         <div class="oe_view_nocontent">No messages.</div>
208     </t>
209
210     <!--
211         error message for uploading
212         -->
213     <t t-name="mail.error_upload">Uploading error</t>
214     <t t-name="mail.error_upload_please_wait">Please, wait while the file is uploading.</t>
215
216     <!--
217         record_thread main template
218         Template used to display the communication history in documents
219         form view.
220         -->
221     <div t-name="mail.record_thread" class="oe_record_thread">
222         <div class="oe_mail-placeholder">
223         </div>
224     </div>
225
226     <t t-name="mail.thread">
227         <div t-attf-class="oe_thread #{widget.root?'oe_root_thread':''}"/>
228     </t>
229
230     <!-- default layout -->
231     <t t-name="mail.thread.message">
232         <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}">
233
234             <div class='oe_msg_left'>
235                 <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]">
236                     <img class="oe_msg_icon" t-att-src="widget.avatar"/>
237                 </a>
238                 <img t-if="!widget.options.show_link" class="oe_msg_icon" t-att-src="widget.avatar"/>
239             </div>
240
241             <div class="oe_msg_center">
242                 <div class='oe_msg_icons' t-if="!widget.options.readonly">
243                     <span class='oe_read' t-if="widget.options.show_read"><a title="Done" class="oe_e">W</a></span>
244                     <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>
245                     <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>
246                     <span class='oe_reply' t-if="widget.options.show_reply_button"><a title="Reply" class="oe_e">(</a></span>
247                     <span t-attf-class="oe_star #{widget.is_favorite?'oe_starred':''}"><a title="Mark as Todo" class="oe_e">7</a></span>
248                 </div>
249                 <!-- message itself -->
250                 <div class="oe_msg_content">
251                     <h1 t-if="(widget.show_record_name or widget.subject) and !widget.thread_level" class="oe_msg_title">
252                         <a t-if="widget.options.show_link and widget.show_record_name" class="oe_mail_action_model" t-attf-href="#model=#{widget.model}&amp;id=#{widget.res_id}">
253                             <t t-esc="widget.record_name"/>
254                         </a>
255                         <span t-if="!widget.options.show_link and widget.show_record_name"><t t-esc="widget.record_name"/></span>
256                         <t t-if="widget.show_record_name and widget.subject">: </t>
257                         <t t-if="widget.subject" t-esc="widget.subject"/>
258                     </h1>
259                     <div class="oe_msg_body">
260                         <t t-raw="widget.body"/>
261                     </div>
262                 </div>
263                 <div class="oe_msg_footer">
264                     <t t-if="widget.attachment_ids.length > 0">
265                         <div class="oe_msg_attachment_list"></div>
266                     </t>
267                     <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 t-esc="widget.author_id[2]"/></a>
268                     <span t-if="widget.author_id and (!widget.options.show_link or !widget.author_id[0])"><t t-esc="widget.author_id[2]"/></span>
269                     <t t-if="widget.type == 'notification'">
270                         updated document
271                         <t t-if="widget.partner_ids.length > 0">
272                             <span class='oe_subtle'>•</span>
273                         </t>
274                     </t>
275                     <t t-if="widget.type == 'comment' and ! widget.subtype">
276                         logged a note
277                     </t>
278                     <t t-if="(widget.type == 'comment' or widget.type == 'email') and widget.subtype">
279                         to
280                         <t t-if="widget.partner_ids.length == 0">
281                             nobody
282                         </t>
283                     </t>
284                     <t t-if="widget.type == 'notification' or ( (widget.type == 'email' or widget.type == 'comment') and widget.subtype)"
285                             t-foreach="widget.partner_ids.slice(0, 3)" t-as="partner">
286                         <span t-attf-class="oe_partner_follower">
287                         <a t-if="widget.options.show_link" t-attf-href="#model=res.partner&amp;id=#{partner[0]}"><t t-esc="partner[1]"/></a>
288                         <t t-if="!widget.options.show_link" t-esc="partner[1]"/>
289                         </span>
290                         <t t-if="!partner_last">,</t>
291                     </t>
292                     <t t-if="widget.partner_ids.length > 3">
293                         <span t-att-title="widget.extra_partners_str">and <t t-esc="widget.extra_partners_nbr"/> more</span>
294                     </t>
295                     <t t-if="widget.type == 'notification' and widget.partner_ids.length > 0">
296                         notified
297                     </t>
298                     <span class='oe_subtle'>•</span>
299                     <span t-att-title="widget.date"><t t-if="widget.timerelative" t-esc="widget.timerelative"/><t t-if="!widget.timerelative" t-raw="widget.date"/></span>
300                     <span t-if="!widget.options.readonly" class='oe_subtle'>•</span>
301                     <t t-if="!widget.options.readonly" t-call="mail.thread.message.vote"/>
302                 </div>
303             </div>
304         </div>
305     </t>
306
307     <!-- expandable message layout -->
308     <t t-name="mail.thread.expandable">
309         <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' : ''}">
310             <div class="oe_msg_content oe_msg_more_message">
311                 <div class='oe_separator'></div>
312                 <a t-if="widget.nb_messages &lt;= 0" class="oe_msg_fetch_more">show more message</a>
313                 <a t-if="widget.nb_messages === 1" class="oe_msg_fetch_more">show one more message</a>
314                 <a t-if="widget.nb_messages &gt; 1" class="oe_msg_fetch_more">show <t t-esc="widget.nb_messages" /> more messages</a>
315             </div>
316         </div>
317     </t>
318
319     <!--
320         mail.compose_message.button_top_bar
321         render of the button on the user bar for open wizard compose message
322         -->
323     <t t-name="mail.ComposeMessageTopButton">
324         <div title='Compose new Message' class="oe_topbar_item oe_topbar_compose_full_email">
325             <button class="oe_e">%</button>
326         </div>
327     </t>
328
329     <!-- mail.thread.message.vote
330         Template used to display Like/Unlike in a mail.message
331     -->
332     <span t-name="mail.thread.message.vote">
333         <span class="oe_mail_vote_count" t-if='widget.vote_nb > 0'>
334             <t t-esc='widget.vote_nb' />
335             <span class='oe_e'>8</span>
336         </span>
337         <a href='#' class="oe_msg_vote">
338             <t t-if="!widget.has_voted">like</t>
339             <t t-if="widget.has_voted">unlike</t>
340         </a>
341     </span>
342
343     <!-- mail.thread.message.star
344         Template used to display stared/unstared message in a mail.message
345     -->
346 </template>