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