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