[IMP]Improvement in different modules
[odoo/odoo.git] / addons / mail / static / src / xml / mail.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <template>
3
4     <!-- this template contains the mail widget and is used to namespace the css -->
5     <t t-name="mail.Widget">
6         <div class="oe_mail">
7         </div>
8     </t>
9
10     <!--
11         mail.compose_message template
12         This template holds the composition form to write a note or send
13         an e-mail. It contains by default a textarea, that will be replaced
14         by another composition form in the main wall composition form, or
15         for main thread composition form in document form view.
16
17         mail.compose_message.compact template
18         This template holds the composition form to write a message, this box is converted into
19         mail.compose_message when focus on textarea
20         -->
21     <t t-name="mail.compose_message">
22         <div t-if="widget.show_composer" t-attf-class="oe_msg oe_msg_composer #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''}">
23             <div class="oe_msg_left">
24                 <img class="oe_msg_icon" alt="User img" t-attf-src="#{widget.avatar}"/>
25             </div>
26             <div class="oe_msg_center">
27                 <div class="oe_msg_content">
28                     <t t-call="mail.thread.list_recipients"/>
29                     <textarea class="field_text"></textarea>
30                 </div>
31                 <div class="oe_msg_footer">
32                     <div class="oe_msg_attachment_list"></div>
33                     <button class="oe_post">Post</button>
34                     <t t-call="mail.compose_message.add_attachment"/>
35                     <!--<a class="oe_cancel oe_e">X</a>-->
36                     <button class="oe_full"><span class='oe_e'>&amp;ograve</span></button>
37                 </div>
38             </div>
39         </div>
40         <div t-if="widget.show_compact_message and !widget.show_composer" t-attf-class="oe_msg oe_msg_composer_compact #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''}">
41             <textarea class="field_text oe_compact" placeholder="Write a reply..."/>
42         </div>
43         <span t-if="!(widget.show_compact_message and !widget.show_composer) and !widget.show_composer" class="oe_placeholder_compose"></span>
44     </t>
45
46     <!--
47         mail.compose_message.add_attachment template
48         Small template to be inserted in the composition for add attachments
49         -->
50     <t t-name="mail.compose_message.add_attachment">
51         <span class="oe_attachment_file">
52             <span class="oe_add">
53                 <!-- uploader of file -->
54                 <button class="oe_attach"><span class="oe_e">'</span></button> 
55                 <span class='oe_attach_label'>File</span>
56                 <t t-call="HiddenInputFile">
57                     <t t-set="fileupload_id" t-value="widget.fileupload_id"/>
58                     <t t-set="fileupload_action">/web/binary/upload_attachment</t>
59                     <input type="hidden" name="model" value="mail.compose.message"/>
60                     <input type="hidden" name="id" value="0"/>
61                     <input type="hidden" name="session_id" t-att-value="widget.session.session_id"/>
62                 </t>
63             </span>
64         </span>
65     </t>
66
67     <!--
68         mail.thread.message.attachments template
69         Template used to display attachments in a mail.message
70         -->
71     <t t-name="mail.thread.message.attachments">
72         <span class="oe_msg_attachments">
73             <t t-foreach="widget.attachment_ids" t-as="attachment" t-if="!attachment.is_image">
74                 <div class="oe_attachment">
75                     <span t-if="(attachment.upload and attachment.percent_loaded&lt;100)" t-attf-title="{(attachment.name || attachment.filename) + (attachment.date?' \n('+attachment.date+')':'' )}" t-attf-name="{attachment.name || attachment.filename}">
76                         <div class="oe_upload_in_process">
77                             <span>...Upload in progress...</span>
78                         </div>
79                         <t t-raw="attachment.name || attachment.filename"/>
80                     </span>
81                     <t t-if="(!attachment.upload or attachment.percent_loaded&gt;=100)">
82                         <a t-att-href="attachment.url" t-attf-title="{(attachment.name || attachment.filename) + (attachment.date?' \n('+attachment.date+')':'' )}">
83                             <t t-raw="attachment.name || attachment.filename"/>
84                         </a>
85                     </t>
86                     <t t-if="(widget.show_delete_attachment and (!attachment.upload or attachment.percent_loaded&gt;=100))">
87                         <a class="oe_right oe_mail_attachment_delete oe_e" title="Delete this attachment" t-attf-data-id="{attachment.id}">[</a>
88                     </t>
89                 </div>
90             </t>
91         </span>
92         <span class="oe_msg_images">
93             <t t-foreach="widget.attachment_ids" t-as="attachment" t-if="attachment.is_image">
94                 <a t-att-href="attachment.url" t-attf-title="{(attachment.name || attachment.filename) + (attachment.date?' \n('+attachment.date+')':'' )}">
95                     <img t-if="attachment.is_image" t-attf-title="{(attachment.name || attachment.filename) + (attachment.date?' \n('+attachment.date+')':'' )}" t-att-src="attachment.url"/>
96                 </a>
97             </t>
98         </span>
99     </t>
100
101     <t t-name="mail.thread.message.private">
102         <div>
103             <span class="oe_placeholder_checkbox_private"/>
104             <span class="oe_send_private">This email is private.</span>
105             <span class="oe_send_public">I wrote for contacts and all my followers.</span>
106         </div>
107     </t>
108
109     <!--
110         template to the recipients list
111         -->
112     <t t-name="mail.thread.list_recipients">
113         <div class="oe_mail_list_recipients">
114             To:
115             <span t-if="!widget.is_private" class="oe_all_follower">Everyone</span> 
116             <t t-if="!widget.is_private and widget.partner_ids.length"> and </t>
117             <t t-set="inc" t-value="0"/>
118             <t t-if="widget.partner_ids.length" t-foreach="widget.partner_ids" t-as="partner"><span t-attf-class="oe_partner_follower #{inc>=3?'oe_hidden':''}"><t t-if="inc" t-raw="', '"/><a t-attf-href="#model=res.partner&amp;id=#{partner[0]}"><t t-raw="partner[1]"/></a></span><t t-set="inc" t-value="inc+1"/>
119             </t>
120             <t t-if="widget.partner_ids.length>=3">
121                 <span class="oe_more">, <a><t t-raw="widget.partner_ids.length-3"/> others...</a></span>
122                 <a class="oe_more_hidden">&lt;&lt;&lt;</a>
123             </t>
124         </div>
125     </t>
126
127     <!-- 
128         wall main template
129         Template used to display the communication history in the wall.
130         -->
131     <div t-name="mail.wall" class="oe_view_manager oe_mail_wall oe_view_manager_current">
132         <table class="oe_view_manager_header">
133           <colgroup>
134             <col width="33%"/>
135             <col width="33%"/>
136             <col width="34%"/>
137           </colgroup>
138           <tbody>
139             <tr class="oe_header_row oe_header_row_top">
140                 <td colspan="2">
141                     <h2 class="oe_view_title">
142                         <span class="oe_view_title_text">
143                             News Feed
144                             <t t-if="widget.options.res_model"> / </t>
145                             <t t-if="widget.options.res_model" t-esc="widget.options.res_model"/>
146                         </span>
147                     </h2>
148                 </td>
149                 <td><div class="oe_view_manager_view_search" t-opentag="true"/></td>
150             </tr>
151             <tr class="oe_header_row">
152                 <td colspan="2">
153                     <button type="button" class="oe_write_full oe_highlight">
154                         Compose a new message
155                     </button>
156                     <span class='oe_alternative'>
157                         or
158                         <a href='#'  class='oe_write_onwall oe_bold' help='Your followers can read this message'>Write to your followers</a>
159                     </span>
160                 </td>
161             </tr>
162           </tbody>
163         </table>
164         <div class="oe_mail-placeholder"></div>
165     </div>
166
167     <!--
168         display message on the wall when there are no message
169         -->
170     <t t-name="mail.wall_no_message">
171         <div class="oe_wall_no_message">You have no messages</div>
172     </t>
173
174     <!--
175         record_thread main template
176         Template used to display the communication history in documents
177         form view.
178         -->
179     <div t-name="mail.record_thread" class="oe_record_thread">
180         <div class="oe_mail-placeholder">
181         </div>
182     </div>
183
184     <t t-name="mail.thread">
185         <div t-attf-class="oe_thread #{widget.root?'oe_root_thread':''}"/>
186     </t>
187
188     <!-- default layout -->
189     <t t-name="mail.thread.message">
190         <div t-attf-class="oe_msg #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''} oe_msg_#{widget.type} oe_msg_#{widget.to_read?'unread':'read'}">
191
192             <div class='oe_msg_left'>
193                 <a t-attf-href="#model=res.partner&amp;id=#{widget.author_id[0]}" t-att-title="widget.author_id[1]">
194                     <img class="oe_msg_icon" t-att-src="widget.avatar"/>
195                 </a>
196             </div>
197
198             <div class="oe_msg_center">
199                 <div class='oe_msg_icons'>
200                     <span class='oe_read' t-if="widget.show_read_unread_button"><a title="Mark as Read" class="oe_e">X</a></span>
201                     <span class='oe_unread' t-if="widget.show_read_unread_button"><a title="Mark as Unread" class="oe_e">v</a></span>
202                     <span class='oe_reply' t-if="widget.show_reply_button"><a title="Reply" class="oe_e">(</a></span>
203                     <span t-attf-class="oe_star #{widget.is_favorite?'oe_starred':''}"><a title="Add To Favorites" class="oe_e">7</a></span>
204                 </div>
205                 <!-- message itself -->
206                 <div class="oe_msg_content">
207                     <h1 t-if="widget.subject and !widget.thread_level" class="oe_msg_title">
208                         <t t-raw="widget.subject"/>
209                     </h1>
210                     <div class="oe_msg_body">
211                         <t t-if="widget.options.show_record_name and widget.record_name and (!widget.subject) and !widget.options.thread_level and !widget.options.display_on_thread[0] and widget.model!='res.partner'">
212                             <a class="oe_mail_action_model" t-attf-href="#model=#{widget.model}&amp;id=#{widget.res_id}"><t t-raw="widget.record_name"/></a>
213                         </t>
214                         <t t-raw="widget.body"/>
215                     </div>
216                     <t t-if="widget.attachment_ids.length > 0">
217                         <t t-call="mail.thread.message.attachments"/>
218                     </t>
219                 </div>
220                 <div class="oe_msg_footer">
221                     <a t-if="widget.author_id" t-attf-href="#model=res.partner&amp;id=#{widget.author_id[0]}"><t t-raw="widget.author_id[1]"/></a> 
222                     <span class='oe_subtle'>•</span>
223                     <span t-att-title="widget.date"><t t-raw="widget.timerelative"/></span>
224                         <a t-if="widget.attachment_ids.length > 0" class="oe_mail_msg_view_attachments">
225                             <t t-if="widget.attachment_ids.length == 1">1 Attachment</t>
226                             <t t-if="widget.attachment_ids.length > 1"><t t-raw="widget.attachment_ids.length"/> Attachments</t>
227                         </a>
228                     <span class='oe_subtle'>•</span>
229                     <t t-call="mail.thread.message.vote"/>
230                 </div>
231             </div>
232         </div>
233     </t>
234
235     <!-- expandable message layout -->
236     <t t-name="mail.thread.expandable">
237         <div t-attf-class="oe_msg oe_msg_#{widget.type} #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''} oe_msg_unread">
238             <div class="oe_msg_content oe_msg_more_message">
239                 <div class='oe_separator'></div>
240                 <a t-if="widget.nb_messages === 1" class="oe_msg_fetch_more">show one more message</a>
241                 <a t-if="widget.nb_messages !== 1" class="oe_msg_fetch_more">show <t t-raw="widget.nb_messages" /> more messages</a>
242             </div>
243         </div>
244     </t>
245
246     <!--
247         mail.compose_message.button_top_bar
248         render of the button on the user bar for open wizard compose message
249         -->
250     <t t-name="mail.compose_message.button_top_bar">
251         <div class="oe_topbar_compose_full_email">
252             <!-- <button class="oe_button oe_highlight">Write an email</button> -->
253         </div>
254     </t>
255
256     <!-- mail.thread.message.vote
257         Template used to display Like/Unlike in a mail.message
258     -->
259     <span t-name="mail.thread.message.vote">
260         
261         <span class="oe_mail_vote_count" t-if='widget.vote_nb > 0'>
262             <t t-raw='widget.vote_nb' />
263             <span class='oe_e'>8</span>
264         </span>
265         <a href='#' t-attf-class="oe_msg_vote">
266             <t t-if="!widget.has_voted">like</t>
267             <t t-if="widget.has_voted">unlike</t>
268         </a>
269     </span>
270
271     <!-- mail.thread.message.star
272         Template used to display stared/unstared message in a mail.message
273     -->
274 </template>