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