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