[FIX] Some fixes for base_import_module
[odoo/odoo.git] / addons / website_forum / views / website_forum.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5 <!-- Editor custom -->
6 <template id="assets_frontend" inherit_id="website.assets_frontend" name="website_forum assets">
7     <xpath expr="/t" position="inside">
8         <link rel='stylesheet' href="/website_forum/static/src/css/website_forum.css"/>
9         <script type="text/javascript" src="/website_forum/static/src/js/website.tour.forum.js"/>
10         <script type="text/javascript" src="/website_forum/static/src/js/website_forum.editor.js"/>
11     </xpath>
12 </template>
13
14 <!-- Layout add nav and footer -->
15 <template id="header_footer_custom" inherit_id="website.footer_default"
16     name="Footer Questions Link">
17     <xpath expr="//ul[@id='products']" position="inside">
18         <li><a t-attf-href="/forum/%(website_forum.forum_help)d">Q&amp;A</a></li>
19         <li><a href="/forum">Forums</a></li>
20     </xpath>
21 </template>
22
23 <!-- helper -->
24 <template id="link_button">
25     <form method="POST" t-att-action="url">
26         <button t-attf-class="fa btn-link #{classes} #{karma and 'karma_required text-muted' or ''}" t-attf-data-karma="#{karma}">
27             <t t-esc="label"/></button>
28     </form>
29 </template>
30
31 <template id="assets_frontend" inherit_id="website.assets_frontend" name="website_forum assets">
32     <xpath expr="." position="inside">
33         <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
34         <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
35         <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
36         <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
37     </xpath>
38 </template>
39
40 <!-- Page Index -->
41 <template id="header" name="Forum Index">
42     <t t-call="website.layout">
43         <t t-set="head">
44             <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
45             <script type="text/javascript">
46                 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
47                 ,['Outdent','Indent','Link','Unlink','Image'],] ;
48             </script>
49             <t t-raw="0"/>
50         </t>
51         <div class="container mt16 website_forum">
52             <div class="navbar navbar-default">
53                 <div class="navbar-header">
54                     <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
55                         <span class="sr-only">Toggle navigation</span>
56                         <span class="icon-bar"></span>
57                         <!-- <span class="icon-bar"></span> -->
58                         <span class="icon-bar"></span>
59                     </button>
60                     <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
61                         <span t-field="forum.name"/>
62                     </a>
63                 </div>
64                 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
65                     <ul class="nav navbar-nav">
66                         <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
67                             <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
68                         </li>
69                         <li t-att-class="searches.get('users') and 'active' or '' ">
70                             <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
71                         </li>
72                         <li t-att-class="searches.get('tags') and 'active' or '' ">
73                             <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
74                         </li>
75                         <li t-att-class="searches.get('badges') and 'active' or '' ">
76                             <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
77                         </li>
78                         <li t-if="not is_public_user" t-att-class="searches.get('my_profile') and 'active' or '' ">
79                             <a t-attf-href="/forum/#{ slug(forum) }/user/#{uid}">My Profile</a>
80                         </li>
81                     </ul>
82                     <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
83                         <div class="form-group">
84                             <input type="search" class="form-control"
85                                 name="search" placeholder="Search a question..."
86                                 t-att-value="search or ''"/>
87                             <button type="submit" class="btn btn-default">Search</button>
88                         </div>
89                     </form>
90                 </div>
91             </div>
92         </div>
93
94         <div id="wrap" class="container">
95             <div class="row">
96                 <div class="col-sm-9">
97                     <div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable">
98                         <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
99                         <div t-field="notification.body"/>
100                         <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }#badges" class="fa fa-arrow-right">View Your Badges</a>
101                     </div>
102                     <t t-raw="0"/>
103                 </div>
104                 <div class="col-sm-3" id="right-column">
105                     <a t-if="not header.get('ask_hide')" class="btn btn-primary btn-lg btn-block mb16" t-attf-href="/forum/#{slug(forum)}/ask">Ask a Question</a>
106                     <div class="panel panel-default">
107                         <div class="panel-heading">
108                             <h3 class="panel-title">Keep Informed</h3>
109                         </div>
110                         <div class="panel-body">
111                             <t t-call="website_mail.follow">
112                                 <t t-set="email" t-value="user.email"/>
113                                 <t t-set="object" t-value="forum"/>
114                             </t>
115                         </div>
116                     </div>
117                     <div class="panel panel-default" id="about_forum">
118                         <div class="panel-heading">
119                             <h3 class="panel-title">About This Forum</h3>
120                         </div>
121                         <div class="panel-body">
122                             <t t-raw="forum.description"/>
123                             <a t-if="not header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
124                             <a t-if="header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}" class="fa fa-arrow-right"> Back to <span t-field="forum.name"/></a>
125                         </div>
126                     </div>
127                     <div t-if="header.get('question_data')">
128                         <div class="panel panel-default">
129                             <div class="panel-heading text-center">
130                                 <h3 class="panel-title">Question tools</h3>
131                             </div>
132                             <div class="panel-body text-center">
133                                 <t t-call="website_mail.follow"><t t-set="object" t-value="question"/></t>
134                                 <div class="mt8">
135                                     <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower(s)
136                                 </div>
137                             </div>
138                             <div class="panel-heading text-center">
139                                 <h3 class="panel-title ">Stats</h3>
140                             </div>
141                             <div class="panel-body">
142                                 <table class="table">
143                                     <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
144                                     <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
145                                         <span t-if="question.views&gt;1">times</span>
146                                         <span t-if="question.views&lt;=1">time</span>
147                                     </td></tr>
148                                     <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
149                                 </table>
150                             </div>
151                         </div>
152                     </div>
153                 </div>
154             </div>
155         </div>
156         <div class="oe_structure"/>
157     </t>
158 </template>
159
160 <!-- Display a post -->
161 <template id="display_post">
162     <div class="question row">
163         <div class="col-md-2 hidden-xs text-center">
164             <div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
165                 <span t-esc="question.child_count"/>
166                 <div t-if="question.child_count&gt;1" class="subtitle">Answers</div>
167                 <div t-if="question.child_count&lt;=1" class="subtitle">Answer</div>
168             </div>
169         </div>
170         <div class="col-md-10 clearfix">
171             <div class="question-name">
172                 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
173                     <span t-if="not question.active"><b> [Deleted]</b></span>
174                     <span t-if="question.state == 'close'"><b> [Closed]</b></span>
175             </div>
176             <t t-foreach="question.tag_ids" t-as="question_tag">
177                 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{slug(question_tag)}/questions">
178                     <span t-attf-class="pull-right badge #{tag and tag.name == question_tag.name and 'badge-active' ''}" t-field="question_tag.name"
179                         style="margin-right: 4px;"/>
180                 </a>
181             </t>
182             <div class="text-muted">
183                 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
184                     t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
185                     style="display: inline-block;"/>
186                 on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
187                 <span class="visible-xs">
188                     <b t-esc="question.child_count or 0"/>
189                     <t t-if="question.child_count&gt;1">answers</t>
190                     <t t-if="question.child_count==1">answers</t>
191                 </span>
192                 with <b t-field="question.views"/> views
193                 <span t-if="question.vote_count&gt;0"> and
194                     <b t-esc="question.vote_count or 0"/>
195                     <t t-if="question.vote_count&gt;1">votes</t>
196                     <t t-if="question.vote_count==1">vote</t>
197                 </span>
198             </div>
199         </div>
200     </div>
201 </template>
202
203 <!-- Display a post as an answer -->
204 <template id="display_post_answer">
205     <div class="clearfix">
206         <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
207             <div t-esc="len(answer.vote_ids)"/>
208         </div>
209         <div class="question-name" style="margin-left: 32px;">
210             <a style="font-size: 15px;" t-attf-href="/forum/#{ slug(forum) }/question/#{ answer.parent_id.id }/#answer-#{ answer.id }" t-esc="answer.parent_id.name"/>
211             <t t-if="len(answer.website_message_ids)&gt;0">
212                 (<t t-esc="len(answer.website_message_ids)"/>
213                 <t t-if="len(answer.website_message_ids)&gt;1">Comments</t>
214                 <t t-if="len(answer.website_message_ids)&lt;=1">Comment</t>)
215             </t>
216         </div>
217     </div>
218 </template>
219
220 <!-- FAQ Layout -->
221 <template id="faq">
222     <t t-call="website_forum.header">
223         <div t-field="forum.faq"/>
224     </t>
225 </template>
226
227 <!-- All Forums Layout -->
228 <template id="forum_all">
229     <t t-call="website.layout">
230         <div class="container">
231             <h1 class="mb32">Our forums</h1>
232             <div class="row">
233                 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
234                     <a t-attf-href="/forum/#{ slug(forum) }">
235                         <div class="fa fa-5x fa-comment mb16"/>
236                         <div t-field="forum.name"/>
237                     </a>
238                 </div>
239             </div>
240         </div>
241     </t>
242 </template>
243
244 <!-- Specific Forum Layout -->
245 <template id="forum_index" name="Forum">
246     <t t-call="website_forum.header">
247         <h1 class="page-header mt0">
248             <t t-esc="question_count"/> <span>Questions</span>
249             <t t-esc="search"/>
250             <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
251               <a href="#" class="dropdown-toggle" data-toggle="dropdown">
252                   <t t-if="filters == 'all'">All</t>
253                   <t t-if="filters == 'unanswered'">Unanswered</t>
254                   <t t-if="filters == 'followed'">Followed</t>
255                   <t t-if="tag"><span t-field="tag.name"/></t>
256                   <t t-if="sorting == 'date'"> by activity date</t>
257                   <t t-if="sorting == 'creation'"> by creation date</t>
258                   <t t-if="sorting == 'answered'"> by most answered</t>
259                   <t t-if="sorting == 'vote'"> by most voted</t>
260                   <b class="caret"/>
261               </a>
262               <ul class="dropdown-menu">
263                   <li class="dropdown-header">Filter on</li>
264                   <li t-att-class="filters == 'all' and 'active' or '' ">
265                       <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
266                   </li>
267                   <li t-att-class="filters == 'unanswered' and 'active' or '' ">
268                       <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
269                   </li>
270                   <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
271                       <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
272                   </li>
273                   <li class="dropdown-header">Tags</li>
274                   <li t-if="tag" t-att-class="tag and 'active' or '' ">
275                       <a href=""><t t-esc="tag.name"/></a>
276                   </li>
277                   <li class="dropdown-header">Sort by</li>
278                   <li t-att-class="sorting == 'date' and 'active' or '' ">
279                       <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
280                   </li>
281                   <li t-att-class="sorting == 'creation' and 'active' or '' ">
282                       <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='creation')">Newest</a>
283                   </li>
284                   <li t-att-class="sorting == 'answered' and 'active' or '' ">
285                       <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
286                   </li>
287                   <li t-att-class="sorting == 'vote' and 'active' or '' ">
288                       <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
289                   </li>
290               </ul>
291             </small>
292         </h1>
293         <div t-foreach="question_ids" t-as="question" class="mb16">
294             <t t-call="website_forum.display_post"/>
295         </div>
296         <t t-call="website.pager"/>
297     </t>
298 </template>
299
300 <template id="404">
301     <t t-call="website_forum.header">
302         <div class="oe_structure oe_empty"/>
303         <h1 class="mt32">Question not found!</h1>
304         <p>Sorry, this question is not available anymore.</p>
305         <p>
306             <a t-attf-href="/forum">Return to the question list.</a>
307         </p>
308     </t>
309 </template>
310
311 <!-- Edition: ask your question -->
312 <template id="ask_question">
313     <t t-call="website_forum.header">
314         <h1 class="mt0">Ask your Question</h1>
315         <ul>
316             <li> please, try to make your question interesting to others </li>
317             <li> provide enough details and, if possible, give an example </li>
318             <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
319         </ul>
320         <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
321             <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
322                 class="form-control" placeholder="Enter your Question"/>
323             <h5 class="mt20">Please enter a descriptive question (should finish with a '?')</h5>
324             <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
325             <textarea name="content" required="True" class="form-control load_editor">
326                 <t t-esc="question_content"/>
327             </textarea>
328             <br/>
329             <input type="text" name="question_tags" placeholder="Tags" class="form-control load_tags"/>
330             <br/>
331             <button class="btn btn-primary" id="btn_ask_your_question">Post Your Question</button>
332         </form>
333         <script type="text/javascript">
334             CKEDITOR.replace("content");
335         </script>
336     </t>
337 </template>
338
339 <!-- Edition: edit a post -->
340 <template id="edit_post">
341     <t t-call="website_forum.header">
342         <h3 t-if="not is_answer">Edit question</h3>
343         <h3 t-if="is_answer">Edit answer</h3>
344         <form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
345             <div t-if="not is_answer">
346                 <input type="text" name="question_name" id="question_name" required="True"
347                     t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
348                 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
349             </div>
350             <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
351             <textarea name="content" required="True" class="form-control load_editor">
352                 <t t-esc="post.content"/>
353             </textarea>
354             <div t-if="not is_answer">
355                 <br/>
356                 <input type="text" name="question_tag" class="form-control col-md-9 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
357                 <br/>
358             </div>
359             <button class="btn btn-primary btn-lg">Save</button>
360         </form>
361         <script type="text/javascript">
362             CKEDITOR.replace("content");
363         </script>
364     </t>
365 </template>
366
367 <!-- Moderation: close a question -->
368 <template id="close_question">
369     <t t-call="website_forum.header">
370         <h1 class="mt0">Close question</h1>
371         <p class="text-muted">
372             If you close this question, it will be hidden for most users. Only
373             users having a high karma can see closed questions to moderate
374             them.
375         </p>
376         <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
377             <input name="post_id" t-att-value="question.id" type="hidden"/>
378             <div class="form-group">
379                 <label class="col-md-3 control-label" for="reason">Question:</label>
380                 <div class="col-md-8 mt8">
381                     <span t-field="question.name"/>
382                 </div>
383             </div>
384             <div class="form-group">
385                 <label class="col-md-3 control-label" for="reason">Reason:</label>
386                 <div class="col-md-8">
387                     <select class="form-control" name="reason_id">
388                         <t t-foreach="reasons or []" t-as="reason">
389                             <option t-att-value="reason.id" t-att-selected="reason.id == question.closed_reason_id.id"><t t-esc="reason.name"/></option>
390                         </t>
391                     </select>
392                 </div>
393             </div>
394             <div class="form-group">
395                 <div class="col-md-offset-3 col-md-8">
396                     <button class="btn btn-primary">Close question</button>
397                     <span class="text-muted">or</span>
398                     <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">back to question</a>
399                 </div>
400             </div>
401         </form>
402     </t>
403 </template>
404
405 <!-- Edition: post an answer -->
406 <template id="post_answer">
407     <h3 class="mt10">Your answer</h3>
408     <p>
409         <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
410         <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
411         - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
412         - it really helps to select the best questions and answers!
413     </p>
414     <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
415         <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
416         <textarea name="content" class="form-control load_editor" required="True"/>
417         <button class="btn btn-primary mt16" id="btn_ask_your_question">Post Your Answer</button>
418     </form>
419     <script type="text/javascript">
420         CKEDITOR.replace("content");
421     </script>
422 </template>
423
424 <template id="vote">
425     <div t-attf-class="box oe_grey">
426         <a t-attf-class="vote_up fa fa-thumbs-up no-decoration #{post.user_vote == 1 and 'text-success' or ''} #{((post.user_vote == 1 and not post.can_downvote) or not post.can_upvote) and 'karma_required' or ''}"
427             t-attf-data-karma="#{post.user_vote == 1 and post.karma_downvote or post.karma_upvote}"
428             t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
429         <span id="vote_count" t-esc="post.vote_count"/>
430         <a t-attf-class="vote_down fa fa-thumbs-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''} #{((post.user_vote == -1 and not post.can_upvote) or not post.can_downvote) and 'karma_required' or ''}"
431             t-attf-data-karma="#{post.user_vote == -1 and post.karma_upvote or post.karma_downvote}"
432             t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
433         <div t-if="vote_count &gt; 1" class="subtitle">
434             votes
435         </div>
436         <div t-if="vote_count &lt; 2" class="subtitle">
437             vote
438         </div>
439     </div>
440 </template>
441
442 <!-- Specific Post Layout -->
443 <template id="post_description_full" name="Question Navigation">
444     <t t-call="website_forum.header">
445         <div t-attf-class="row question #{not question.active and 'alert alert-danger' or ''}">
446             <div class="col-md-2 hidden-xs text-center">
447                 <t t-call="website_forum.vote">
448                     <t t-set="post" t-value="question"/>
449                 </t>
450                 <div class="text-muted text-center">
451                     <span t-field="question.views"/> Views
452                 </div>
453                 <div class="mt4">
454                     <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
455                         t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
456                 </div>
457             </div>
458             <div class="col-md-10">
459                 <h1 class="mt0">
460                     <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
461                     <span t-if="not question.active"><b> [Deleted]</b></span>
462                     <span t-if="question.state == 'close'"><b> [Closed]</b></span>
463                 </h1>
464                 <div class="alert alert-info text-center" t-if="question.state == 'close'">
465                     <p class="mt16">
466                         <b>The question has been closed<t t-if="question.closed_reason_id"> for reason: <i t-esc="question.closed_reason_id.name"/></t></b>
467                     </p>
468                     <t t-if="question.closed_uid">
469                         <b>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.closed_uid.id }"
470                             t-field="question.closed_uid"
471                             t-field-options='{"widget": "contact", "fields": ["name"]}'
472                             style="display: inline-block;"/></b>
473                     </t>
474                     <b>on <span t-field="question.closed_date"/></b>
475                     <div class="mt16 mb24 text-center">
476                         <t t-call="website_forum.link_button">
477                             <t t-set="url" t-value="'/forum/' + slug(forum) + '/question/' + slug(question) + '/reopen'"/>
478                             <t t-set="label" t-value="'Reopen'"/>
479                             <t t-set="classes" t-value="'fa-arrow-right'"/>
480                             <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
481                         </t>
482                     </div>
483                 </div>
484                 <t t-raw="question.content"/>
485                 <div class="mt16 clearfix">
486                     <div class="pull-right">
487                         <div class="text-right">
488                             <t t-foreach="question.tag_ids" t-as="tag">
489                                 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
490                             </t>
491                         </div>
492                         <ul class="list-inline" id="options">
493                             <li>
494                                 <a style="cursor: pointer" data-toggle="collapse"
495                                     t-attf-class="fa fa-comment-o #{not question.can_comment and 'karma_required text-muted' or ''}"
496                                     t-attf-data-karma="#{not question.can_comment and question.karma_comment or 0}"
497                                     t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
498                                     Comment
499                                 </a>
500                             </li>
501                             <li t-if="question.state != 'close'">
502                                 <t t-call="website_forum.link_button">
503                                     <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/ask_for_close'"/>
504                                     <t t-set="label" t-value="'Close'"/>
505                                     <t t-set="classes" t-value="'fa-times'"/>
506                                     <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
507                                 </t>
508                             </li>
509                             <li t-if="question.state == 'close'">
510                                 <t t-call="website_forum.link_button">
511                                     <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/reopen'"/>
512                                     <t t-set="label" t-value="'Reopen'"/>
513                                     <t t-set="classes" t-value="'fa-undo'"/>
514                                     <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
515                                 </t>
516                             </li>
517                             <li>
518                                 <t t-call="website_forum.link_button">
519                                     <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/edit'"/>
520                                     <t t-set="label" t-value="'Edit'"/>
521                                     <t t-set="classes" t-value="'fa-edit'"/>
522                                     <t t-set="karma" t-value="not question.can_edit and question.karma_edit or 0"/>
523                                 </t>
524                             </li>
525                             <li t-if="question.active">
526                                 <t t-call="website_forum.link_button">
527                                     <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/delete'"/>
528                                     <t t-set="label" t-value="'Delete'"/>
529                                     <t t-set="classes" t-value="'fa-trash-o'"/>
530                                     <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
531                                 </t>
532                             </li>
533                             <li t-if="not question.active">
534                                 <t t-call="website_forum.link_button">
535                                     <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/undelete'"/>
536                                     <t t-set="label" t-value="'Undelete'"/>
537                                     <t t-set="classes" t-value="'fa-trash-o'"/>
538                                     <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
539                                 </t>
540                             </li>
541                         </ul>
542                     </div>
543                     <div>
544                         <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{question.create_uid.id}/avatar"/>
545                         <div>
546                             <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
547                                 t-field="question.create_uid"
548                                 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
549                                 style="display: inline-block;"/>
550                             <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
551                             <span class="text-muted">Asked on <span t-field="question.create_date" t-field-options='{"format":"short"}'/></span>
552                         </div>
553                     </div>
554                     <div class="visible-xs text-center">
555                         <t t-call="website_forum.vote">
556                             <t t-set="post" t-value="question"/>
557                         </t>
558                         <div class="text-muted text-center">
559                             <span t-field="question.views"/> Views
560                         </div>
561                         <div class="mt4">
562                             <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
563                                 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
564                         </div>
565                     </div>
566                 </div>
567                 <t t-call="website_forum.post_comment">
568                     <t t-set="object" t-value="question"/>
569                 </t>
570             </div>
571         </div>
572         <hr/>
573
574         <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
575             <a t-attf-id="answer-#{str(answer.id)}"/>
576             <div t-attf-class="forum_answer row" t-attf-id="answer_#{answer.id}" >
577                 <div class="col-md-2 hidden-xs text-center">
578                     <t t-call="website_forum.vote">
579                         <t t-set="post" t-value="answer"/>
580                     </t>
581                     <div class="text-muted mt8">
582                         <a t-attf-class="accept_answer fa fa-2x fa-check-circle no-decoration #{answer.is_correct and 'oe_answer_true' or 'oe_answer_false'} #{not answer.can_accept and 'karma_required' or ''}"
583                             t-attf-data-karma="#{answer.karma_accept}"
584                             t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
585                     </div>
586                 </div>
587                 <div class="col-md-10 clearfix">
588                     <t t-raw="answer.content"/>
589                     <div class="mt16">
590                         <ul class="list-inline pull-right">
591                             <li>
592                                 <a t-attf-class="fa fa-comment-o #{not answer.can_comment and 'karma_required text-muted' or ''}"
593                                     t-attf-data-karma="#{not answer.can_comment and answer.karma_comment or 0}"
594                                     style="cursor: pointer" data-toggle="collapse"
595                                     t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
596                                 </a>
597                             </li>
598                             <li>
599                                 <t t-call="website_forum.link_button">
600                                     <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/edit'"/>
601                                     <t t-set="label" t-value="'Edit'"/>
602                                     <t t-set="classes" t-value="'fa fa-edit'"/>
603                                     <t t-set="karma" t-value="not answer.can_edit and answer.karma_edit or 0"/>
604                                 </t>
605                             </li>
606                             <li>
607                                 <t t-call="website_forum.link_button">
608                                     <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/delete'"/>
609                                     <t t-set="label" t-value="'Delete'"/>
610                                     <t t-set="classes" t-value="'fa-trash-o'"/>
611                                     <t t-set="karma" t-value="not answer.can_unlink and answer.karma_unlink or 0"/>
612                                 </t>
613                             </li>
614                             <li>
615                                 <t t-call="website_forum.link_button">
616                                     <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/convert_to_comment'"/>
617                                     <t t-set="label" t-value="'Convert as a comment'"/>
618                                     <t t-set="classes" t-value="'fa-magic'"/>
619                                     <t t-set="karma" t-value="not answer.can_comment_convert and answer.karma_comment_convert or 0"/>
620                                 </t>
621                             </li>
622                         </ul>
623                         <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{answer.create_uid.id}/avatar"/>
624                         <div>
625                             <a t-attf-href="/forum/#{ slug(forum) }/user/#{ answer.create_uid.id }"
626                                 t-field="answer.create_uid"
627                                 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
628                                 style="display: inline-block;"/>
629                             <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
630                             <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
631                         </div>
632                         <div class="visible-xs text-center">
633                             <t t-call="website_forum.vote">
634                                 <t t-set="post" t-value="answer"/>
635                             </t>
636                             <div class="text-muted mt8">
637                                 <a t-attf-class="accept_answer fa fa-2x fa-check-circle no-decoration #{answer.is_correct and 'oe_answer_true' or 'oe_answer_false'} #{not answer.can_accept and 'karma_required' or ''}"
638                                     t-attf-data-karma="#{answer.karma_accept}"
639                                     t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
640                             </div>
641                         </div>
642                     </div>
643                     <t t-call="website_forum.post_comment">
644                         <t t-set="object" t-value="answer"/>
645                     </t>
646                 </div>
647             </div>
648         </div>
649         <div t-if="not question.uid_has_answered">
650             <t t-call="website_forum.post_answer"/>
651         </div>
652         <div t-if="question.uid_has_answered" class="mb16">
653             <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
654             <span class="text-muted">(only one answer per question is allowed)</span>
655         </div>
656     </t>
657 </template>
658
659 <!-- Utility template: Post a Comment -->
660 <template id="post_comment">
661     <div class="row clearfix">
662         <div class="col-sm-10 col-sm-offset-2">
663             <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
664                 <small class="text-muted">
665                     <t t-set="required_karma" t-value="message.author_id.id == user.partner_id.id and object.forum_id.karma_comment_unlink_own or object.forum_id.karma_comment_unlink_all"/>
666                     <t t-call="website_forum.link_button">
667                         <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/delete'"/>
668                         <t t-set="label" t-value="' '"/>
669                         <t t-set="karma" t-value="user.karma&lt;required_karma and required_karma or 0"/>
670                         <t t-set="classes" t-value="'close comment_delete fa-times'"/>
671                     </t>
672
673                     <span t-field="message.body"/>
674                     <t t-set="required_karma" t-value="message.author_id.id == user.partner_id.id and object.forum_id.karma_comment_convert_own or object.forum_id.karma_comment_convert_all"/>
675                     <t t-call="website_forum.link_button">
676                         <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/convert_to_answer'"/>
677                         <t t-set="label" t-value="'Convert as an answer'"/>
678                         <t t-set="karma" t-value="user.karma&lt;required_karma and required_karma or 0"/>
679                         <t t-set="classes" t-value="'fa-magic pull-right'"/>
680                     </t>
681                     <a t-attf-href="/forum/#{slug(forum)}/partner/#{message.author_id.id}"
682                         t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
683                         style="display: inline-block;"/>
684                     on <span t-field="message.date" t-field-options='{"format":"short"}'/>
685                 </small>
686             </div>
687             <div class="css_editable_mode_hidden">
688                 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
689                         t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
690                     <input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
691                     <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
692                     <button type="submit" class="btn btn-primary mt8">Post</button>
693                 </form>
694             </div>
695         </div>
696     </div>
697 </template>
698
699 <template id="tag">
700     <t t-call="website_forum.header">
701         <h1 class="mt0">
702             Tags
703         </h1>
704         <p class="text-muted">
705             A tag is a label that categorizes your question with other,
706             similar questions. Using the right tags makes it easier for
707             others to find and answer your question.
708         </p>
709         <div class="row">
710             <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
711                 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
712                     <span t-field="tag.name"/>
713                 </a>
714                 <span>
715                     X <t t-esc="tag.posts_count"/>
716                 </span>
717             </div>
718         </div>
719     </t>
720 </template>
721
722 <template id="badge">
723     <t t-call="website_forum.header">
724         <h1 class="mt0">
725             Badges
726         </h1>
727         <p>
728             Besides gaining reputation with your questions and answers,
729             you receive badges for being especially helpful. Badges
730             appear on your profile page, and your posts.
731         </p>
732         <table class="table mt32 mb64">
733             <tr t-foreach="badges" t-as="badge">
734                 <td>
735                     <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
736                         <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
737                         <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
738                         <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
739                         <span t-field="badge.name"/>
740                     </a>
741                 </td><td>
742                     <b t-esc="badge.stat_count_distinct"/>
743                     <i class="text-muted">awarded users</i>
744                 </td><td>
745                     <span t-field="badge.description"/>
746                 </td>
747             </tr>
748         </table>
749     </t>
750 </template>
751
752 <template id="badge_user">
753     <t t-call="website_forum.header">
754         <h3 class="mt32 mb32">
755             <b>Badge "<span t-field="badge.name"/>"</b>
756         </h3>
757         <div>
758             <div class="pull-left badge">
759                 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
760                 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
761                 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
762                 <span t-field="badge.name"/>
763             </div>
764             <span t-field="badge.description" style="margin-left:20px"/>
765         </div>
766         <h4 class="mt32">
767             <t class="pull-left" t-esc="badge.stat_count_distinct"/>
768             <span t-if="badge.stat_count_distinct&gt;1">users</span>
769             <span t-if="badge.stat_count_distinct&lt;=1">user</span>
770             received this badge:
771         </h4>
772         <div class="row">
773             <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
774                 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
775                 <div>
776                     <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
777                 </div>
778             </div>
779         </div>
780     </t>
781 </template>
782
783 <template id="users">
784     <t t-call="website_forum.header">
785         <div t-foreach="users" t-as="row_users" class="row mt16">
786             <div t-foreach="row_users" t-as="user" class="col-sm-4">
787                 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
788                 <div>
789                     <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
790                     <t t-if="user.country_id">
791                         <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
792                     </t>
793                     <b><t t-esc="user.karma"/></b>
794                     <t t-raw="separator"/>
795                     <div>
796                         <b> badges:</b>
797                         <span class="fa fa-circle badge-gold"/>
798                         <t t-esc="user.gold_badge"/>
799                         <span class="fa fa-circle badge-silver"/>
800                         <t t-esc="user.silver_badge"/>
801                         <span class="fa fa-circle badge-bronze"/>
802                         <t t-esc="user.bronze_badge"/>
803                     </div>
804                     <t t-raw="0"/>
805                 </div>
806             </div>
807         </div>
808         <div class="pull-left">
809             <t t-call="website.pager"/>
810         </div>
811     </t>
812 </template>
813
814 <!--Private profile-->
815 <template id="private_profile">
816     <t t-call="website_forum.header">
817         <h1 class="mt32">This profile is private!</h1>
818         <p>
819             <a t-attf-href="/forum/#{slug(forum)}">Return to the question list.</a>
820         </p>
821     </t>
822 </template>
823
824 <template id="edit_profile">
825     <t t-call="website_forum.header">
826         <h3>Edit Profile</h3>
827         <div class="row">
828             <div class="col-md-2">
829                 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
830             </div>
831             <div class="col-md-10">
832             <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
833                 <input name="user_id" t-att-value="user.id" type="hidden"/>
834                 <div class="form-group">
835                     <label class="col-md-2 control-label mb16" for="user_name">Real name</label>
836                     <div class="col-md-8 mb16">
837                         <input type="text" class="form-control" name="name" id="user_name" required="True" t-attf-value="#{user.name}"/>
838                     </div>
839                 </div>
840                 <div class="form-group">
841                     <label class="col-md-2 control-label mb16" for="user_website_published" t-if="user.id == uid">Public profile</label>
842                     <div class="col-md-8 mb16" t-if="user.id == uid">
843                         <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" t-if="not user.website_published"/>
844                         <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" checked="checked" t-if="user.website_published"/>
845                     </div>
846                 </div>
847                 <div class="form-group">
848                     <label class="col-md-2 control-label mb16" for="user_website">Website</label>
849                     <div class="col-md-8 mb16">
850                         <input type="text" class="form-control" name="website" id="user_website" t-attf-value="#{user.partner_id.website or ''}"/>
851                     </div>
852                 </div>
853                 <div class="form-group">
854                     <div t-if="email_required" class="alert alert-danger alert-dismissable oe_forum_email_required">
855                         <button type="button" class="close" data-dismiss="alert">x</button>
856                         <p>Please enter a valid email address in order to receive notifications from answers or comments.</p>
857                     </div>
858                     <label class="col-md-2 control-label mb16" for="user_email">Email</label>
859                     <div class="col-md-8 mb16">
860                         <input type="text" class="form-control" name="email" id="user_email" required="True" t-attf-value="#{user.partner_id.email}"/>
861                     </div>
862                 </div>
863                 <div class="form-group">
864                     <label class="col-md-2 control-label mb16" for="user_city">City</label>
865                     <div class="col-md-8 mb16">
866                         <input type="text" class="form-control" name="city" id="user_city" t-attf-value="#{user.partner_id.city or ''}"/>
867                     </div>
868                 </div>
869                 <div class="form-group">
870                     <label class="col-md-2 control-label mb16">Country</label>
871                     <div class="col-md-8 mb16">
872                         <select class="form-control" name="country">
873                             <option value="">Country...</option>
874                             <t t-foreach="countries or []" t-as="country">
875                                 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country_id.id"><t t-esc="country.name"/></option>
876                             </t>
877                          </select>
878                     </div>
879                 </div>
880                 <!--Note: using website_description fiels instead of using commnt firld of partner-->
881                 <div class="form-group">
882                     <label class="col-md-2 control-label mb16" for="description">Biography</label>
883                     <div class="col-md-8 mb16">
884                         <textarea name="description" id="description" style="min-height: 120px" required="True" 
885                             class="form-control load_editor"><t t-esc="user.partner_id.website_description"/></textarea>
886                     </div>
887                 </div>
888                 <div class="col-sm-offset-2 col-md-2 mb16">
889                     <button class="btn btn-primary btn-lg">Update</button>
890                 </div>
891             </form>
892             </div>
893         </div>
894         <script type="text/javascript">
895             CKEDITOR.replace("description");
896         </script>
897     </t>
898 </template>
899
900 <template id="user_detail_full">
901     <t t-call="website_forum.header">
902         <h1 class="mt0 page-header">
903             <span t-field="user.name"/>
904             <small>profile</small>
905             <t t-call="website.publish_management" groups="base.group_website_publisher">
906                 <t t-set="object" t-value="user"/>
907             </t>
908         </h1>
909         <div class="row">
910             <div class="col-sm-2">
911                 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
912             </div>
913             <div class="col-sm-10">
914                 <table class="table table-condensed">
915                 <tr>
916                     <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
917                     <td>member since</td>
918                     <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
919                 </tr><tr>
920                     <td>last connection</td>
921                     <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
922                 </tr>
923                 <tr>
924                     <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
925                     <td>website</td>
926                     <td>
927                         <a t-att-href="user.website" t-if="user.website">
928                             <span t-field="user.website"/>
929                         </a>
930                     </td>
931                 </tr><tr>
932                     <td>location</td>
933                     <td>
934                         <span t-field="user.city"/>
935                         <span t-if="user.city and user.country_id">, </span>
936                         <span t-field="user.country_id"/>
937                         <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
938
939                     </td>
940                 </tr>
941                 <tr>
942                     <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
943                     <td>karma</td>
944                     <td><span t-field="user.karma"/></td>
945                 </tr><tr>
946                     <td>votes</td>
947                     <td>
948                         <span class="fa fa-thumbs-up"/>
949                         <span t-esc="up_votes"/>
950                         <span class="fa fa-thumbs-down"/>
951                         <span t-esc="down_votes"/>
952                     </td>
953                 </tr>
954                 </table>
955                 <div class="well well-sm">
956                     <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
957                     <t t-if="uid == user.id">
958                         <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
959                     </t>
960                 </div>
961             </div>
962         </div>
963
964         <ul class="nav nav-tabs">
965             <li class="active">
966                 <a href="#questions" data-toggle="tab"><t t-esc="count_questions"/> Questions</a>
967             </li>
968             <li>
969                 <a href="#answers" data-toggle="tab"><t t-esc="count_answers"/> Answers</a>
970             </li>
971             <li t-if="uid == user.id">
972                 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
973             </li>
974             <li t-if="uid == user.id">
975                 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
976             </li>
977             <li t-if="uid == user.id">
978                 <a href="#activity" data-toggle="tab">Activity</a>
979             </li>
980             <li>
981                 <a href="#badges" data-toggle="tab">Badges</a>
982             </li>
983             <li t-if="uid == user.id">
984                 <a href="#votes" data-toggle="tab">Votes</a>
985             </li>
986         </ul>
987         <div class="tab-content mt16">
988             <div class="tab-pane active" id="questions">
989                 <div class="mb16" t-foreach="questions" t-as="question">
990                     <t t-call="website_forum.display_post"/>
991                 </div>
992             </div><div class="tab-pane" id="answers">
993                 <div t-foreach="answers" t-as="answer">
994                     <t t-call="website_forum.display_post_answer"/>
995                 </div>
996             </div>
997             <div class="tab-pane" id="karma">
998                 <h1>Karma</h1>
999             </div>
1000             <div class="tab-pane" id="badges">
1001                 <t t-call="website_forum.user_badges"/>
1002             </div>
1003             <div class="tab-pane" id="favourite_question" t-if="uid == user.id">
1004                 <div t-foreach="favourite" t-as="question">
1005                     <t t-call="website_forum.display_post"/>
1006                 </div>
1007             </div>
1008             <div class="tab-pane" id="followed_question" t-if="uid == user.id">
1009                 <div t-foreach="followed" t-as="question" class="mb16">
1010                     <t t-call="website_forum.display_post"/>
1011                 </div>
1012             </div>
1013             <div class="tab-pane" id="votes" t-if="uid == user.id">
1014                 <t t-call="website_forum.user_votes"/>
1015             </div>
1016             <div class="tab-pane" id="activity" t-if="uid == user.id">
1017                 <ul class="list-unstyled">
1018                     <li t-foreach="activities" t-as="activity">
1019                         <span t-field="activity.date" t-field-options='{"format": "short"}'/>
1020                         <span t-esc="activity.subtype_id.name" class="label label-info"/>
1021                         <t t-set="post" t-value="posts[activity.res_id]"/>
1022                         <span t-if="post[1]">
1023                             <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
1024                                 <span t-esc="post[0].name"/>
1025                             </a>
1026                         </span>
1027                         <span t-if="not post[1]">
1028                             <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
1029                                 <span t-esc="post[0].name"/>
1030                             </a>
1031                         </span>
1032                     </li>
1033                 </ul>
1034             </div>
1035         </div>
1036     </t>
1037 </template>
1038
1039 <template id="user_badges">
1040     <table class="table mt32 mb64">
1041         <tr t-foreach="user.badge_ids" t-as="badge">
1042             <td>
1043                 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
1044                     <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
1045                     <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
1046                     <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
1047                     <span t-field="badge.badge_id.name"/>
1048                 </a>
1049             </td><td>
1050                 <b t-esc="badge.badge_id.stat_count_distinct"/>
1051                 <i class="text-muted">awarded users</i>
1052             </td><td>
1053                 <span t-field="badge.badge_id.description"/>
1054             </td>
1055         </tr>
1056     </table>
1057     <div class="mb16" t-if="not user.badge_ids">
1058         <b>No badge yet!</b><br/>
1059         <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
1060     </div>
1061 </template>
1062
1063 <template id="user_votes">
1064     <div t-foreach="vote_post" t-as="vote">
1065         <t t-esc="vote.post_id.create_date"/>
1066         <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
1067         <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
1068         <t t-if="vote.post_id.parent_id">
1069             <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.parent_id.id }/#answer-#{ vote.post_id.id }" t-esc="vote.post_id.parent_id.name" style="margin-left:10px"/>
1070         </t>
1071         <t t-if="not vote.post_id.parent_id">
1072             <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
1073         </t>
1074     </div>
1075     <div class="mb16" t-if="not vote_post">
1076         <b>No vote given by you yet!</b>
1077     </div>
1078 </template>
1079
1080 <!-- User Navbar -->
1081 <template id="content_new_forum" inherit_id="website.user_navbar" groups="base.group_user">
1082     <xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
1083         <li><a href="#" data-action="new_forum">New Forum</a></li>
1084     </xpath>
1085 </template>
1086
1087     </data>
1088 </openerp>