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