1 <?xml version="1.0" encoding="utf-8"?>
6 <template id="assets_frontend" inherit_id="website.assets_frontend" name="website_forum assets">
7 <xpath expr="/t" position="inside">
8 <link rel='stylesheet' href="/website_forum/static/src/css/website_forum.css"/>
9 <script type="text/javascript" src="/website_forum/static/src/js/website.tour.forum.js"/>
10 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.editor.js"/>
14 <!-- Layout add nav and footer -->
15 <template id="header_footer_custom" inherit_id="website.footer_default"
16 name="Footer Questions Link">
17 <xpath expr="//ul[@id='products']" position="inside">
18 <li><a t-attf-href="/forum/%(website_forum.forum_help)d">Q&A</a></li>
19 <li><a href="/forum">Forums</a></li>
24 <template id="link_button">
25 <form method="POST" t-att-action="url">
26 <button t-attf-class="fa btn-link #{classes} #{karma and 'karma_required text-muted' or ''}" t-attf-data-karma="#{karma}">
27 <t t-esc="label"/></button>
31 <template id="assets_frontend" inherit_id="website.assets_frontend" name="website_forum assets">
32 <xpath expr="." position="inside">
33 <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
34 <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
35 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
36 <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
41 <template id="header" name="Forum Index">
42 <t t-call="website.layout">
44 <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
45 <script type="text/javascript">
46 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
47 ,['Outdent','Indent','Link','Unlink','Image'],] ;
50 <div class="container mt16 website_forum">
51 <div class="navbar navbar-default">
52 <div class="navbar-header">
53 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
54 <span class="sr-only">Toggle navigation</span>
55 <span class="icon-bar"></span>
56 <!-- <span class="icon-bar"></span> -->
57 <span class="icon-bar"></span>
59 <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
60 <span t-field="forum.name"/>
63 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
64 <ul class="nav navbar-nav">
65 <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
66 <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
68 <li t-att-class="searches.get('users') and 'active' or '' ">
69 <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
71 <li t-att-class="searches.get('tags') and 'active' or '' ">
72 <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
74 <li t-att-class="searches.get('badges') and 'active' or '' ">
75 <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
77 <li t-if="not is_public_user" t-att-class="searches.get('my_profile') and 'active' or '' ">
78 <a t-attf-href="/forum/#{ slug(forum) }/user/#{uid}">My Profile</a>
81 <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
82 <div class="form-group">
83 <input type="search" class="form-control"
84 name="search" placeholder="Search a question..."
85 t-att-value="search or ''"/>
86 <button type="submit" class="btn btn-default">Search</button>
93 <div id="wrap" class="container">
95 <div class="col-sm-9">
96 <div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable">
97 <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
98 <div t-field="notification.body"/>
99 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }#badges" class="fa fa-arrow-right">View Your Badges</a>
103 <div class="col-sm-3" id="right-column">
104 <a t-if="not header.get('ask_hide')" class="btn btn-primary btn-lg btn-block mb16" t-attf-href="/forum/#{slug(forum)}/ask">Ask a Question</a>
105 <div class="panel panel-default">
106 <div class="panel-heading">
107 <h3 class="panel-title">Keep Informed</h3>
109 <div class="panel-body">
110 <t t-call="website_mail.follow">
111 <t t-set="email" t-value="user.email"/>
112 <t t-set="object" t-value="forum"/>
116 <div class="panel panel-default" id="about_forum">
117 <div class="panel-heading">
118 <h3 class="panel-title">About This Forum</h3>
120 <div class="panel-body">
121 <t t-raw="forum.description"/>
122 <a t-if="not header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
123 <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>
126 <div t-if="header.get('question_data')">
127 <div class="panel panel-default">
128 <div class="panel-heading text-center">
129 <h3 class="panel-title">Question tools</h3>
131 <div class="panel-body text-center">
132 <t t-call="website_mail.follow"><t t-set="object" t-value="question"/></t>
134 <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower(s)
137 <div class="panel-heading text-center">
138 <h3 class="panel-title ">Stats</h3>
140 <div class="panel-body">
141 <table class="table">
142 <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
143 <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
144 <span t-if="question.views>1">times</span>
145 <span t-if="question.views<=1">time</span>
147 <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
155 <div class="oe_structure"/>
159 <!-- Display a post -->
160 <template id="display_post">
161 <div class="question row">
162 <div class="col-md-2 hidden-xs text-center">
163 <div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
164 <span t-esc="question.child_count"/>
165 <div t-if="question.child_count>1" class="subtitle">Answers</div>
166 <div t-if="question.child_count<=1" class="subtitle">Answer</div>
169 <div class="col-md-10 clearfix">
170 <div class="question-name">
171 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
172 <span t-if="not question.active"><b> [Deleted]</b></span>
173 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
175 <t t-foreach="question.tag_ids" t-as="question_tag">
176 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{slug(question_tag)}/questions">
177 <span t-attf-class="pull-right badge #{tag and tag.name == question_tag.name and 'badge-active' ''}" t-field="question_tag.name"
178 style="margin-right: 4px;"/>
181 <div class="text-muted">
182 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
183 t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
184 style="display: inline-block;"/>
185 on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
186 <span class="visible-xs">
187 <b t-esc="question.child_count or 0"/>
188 <t t-if="question.child_count>1">answers</t>
189 <t t-if="question.child_count==1">answers</t>
191 with <b t-field="question.views"/> views
192 <span t-if="question.vote_count>0"> and
193 <b t-esc="question.vote_count or 0"/>
194 <t t-if="question.vote_count>1">votes</t>
195 <t t-if="question.vote_count==1">vote</t>
202 <!-- Display a post as an answer -->
203 <template id="display_post_answer">
204 <div class="clearfix">
205 <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
206 <div t-esc="len(answer.vote_ids)"/>
208 <div class="question-name" style="margin-left: 32px;">
209 <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"/>
210 <t t-if="len(answer.website_message_ids)>0">
211 (<t t-esc="len(answer.website_message_ids)"/>
212 <t t-if="len(answer.website_message_ids)>1">Comments</t>
213 <t t-if="len(answer.website_message_ids)<=1">Comment</t>)
221 <t t-call="website_forum.header">
222 <div t-field="forum.faq"/>
226 <!-- All Forums Layout -->
227 <template id="forum_all">
228 <t t-call="website.layout">
229 <div class="container">
230 <h1 class="mb32">Our forums</h1>
232 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
233 <a t-attf-href="/forum/#{ slug(forum) }">
234 <div class="fa fa-5x fa-comment mb16"/>
235 <div t-field="forum.name"/>
243 <!-- Specific Forum Layout -->
244 <template id="forum_index" name="Forum">
245 <t t-call="website_forum.header">
246 <h1 class="page-header mt0">
247 <t t-esc="question_count"/> <span>Questions</span>
249 <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
250 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
251 <t t-if="filters == 'all'">All</t>
252 <t t-if="filters == 'unanswered'">Unanswered</t>
253 <t t-if="filters == 'followed'">Followed</t>
254 <t t-if="tag"><span t-field="tag.name"/></t>
255 <t t-if="sorting == 'date'"> by activity date</t>
256 <t t-if="sorting == 'creation'"> by creation date</t>
257 <t t-if="sorting == 'answered'"> by most answered</t>
258 <t t-if="sorting == 'vote'"> by most voted</t>
261 <ul class="dropdown-menu">
262 <li class="dropdown-header">Filter on</li>
263 <li t-att-class="filters == 'all' and 'active' or '' ">
264 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
266 <li t-att-class="filters == 'unanswered' and 'active' or '' ">
267 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
269 <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
270 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
272 <li class="dropdown-header">Tags</li>
273 <li t-if="tag" t-att-class="tag and 'active' or '' ">
274 <a href=""><t t-esc="tag.name"/></a>
276 <li class="dropdown-header">Sort by</li>
277 <li t-att-class="sorting == 'date' and 'active' or '' ">
278 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
280 <li t-att-class="sorting == 'creation' and 'active' or '' ">
281 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='creation')">Newest</a>
283 <li t-att-class="sorting == 'answered' and 'active' or '' ">
284 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
286 <li t-att-class="sorting == 'vote' and 'active' or '' ">
287 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
292 <div t-foreach="question_ids" t-as="question" class="mb16">
293 <t t-call="website_forum.display_post"/>
295 <t t-call="website.pager"/>
300 <t t-call="website_forum.header">
301 <div class="oe_structure oe_empty"/>
302 <h1 class="mt32">Question not found!</h1>
303 <p>Sorry, this question is not available anymore.</p>
305 <a t-attf-href="/forum">Return to the question list.</a>
310 <!-- Edition: ask your question -->
311 <template id="ask_question">
312 <t t-call="website_forum.header">
313 <h1 class="mt0">Ask your Question</h1>
315 <li> please, try to make your question interesting to others </li>
316 <li> provide enough details and, if possible, give an example </li>
317 <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
319 <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
320 <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
321 class="form-control" placeholder="Enter your Question"/>
322 <h5 class="mt20">Please enter a descriptive question (should finish with a '?')</h5>
323 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
324 <textarea name="content" required="True" class="form-control load_editor">
325 <t t-esc="question_content"/>
328 <input type="text" name="question_tags" placeholder="Tags" class="form-control load_tags"/>
330 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Question</button>
332 <script type="text/javascript">
333 CKEDITOR.replace("content");
338 <!-- Edition: edit a post -->
339 <template id="edit_post">
340 <t t-call="website_forum.header">
341 <h3 t-if="not is_answer">Edit question</h3>
342 <h3 t-if="is_answer">Edit answer</h3>
343 <form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
344 <div t-if="not is_answer">
345 <input type="text" name="question_name" id="question_name" required="True"
346 t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
347 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
349 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
350 <textarea name="content" required="True" class="form-control load_editor">
351 <t t-esc="post.content"/>
353 <div t-if="not is_answer">
355 <input type="text" name="question_tag" class="form-control col-md-9 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
358 <button class="btn btn-primary btn-lg">Save</button>
360 <script type="text/javascript">
361 CKEDITOR.replace("content");
366 <!-- Moderation: close a question -->
367 <template id="close_question">
368 <t t-call="website_forum.header">
369 <h1 class="mt0">Close question</h1>
370 <p class="text-muted">
371 If you close this question, it will be hidden for most users. Only
372 users having a high karma can see closed questions to moderate
375 <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
376 <input name="post_id" t-att-value="question.id" type="hidden"/>
377 <div class="form-group">
378 <label class="col-md-3 control-label" for="reason">Question:</label>
379 <div class="col-md-8 mt8">
380 <span t-field="question.name"/>
383 <div class="form-group">
384 <label class="col-md-3 control-label" for="reason">Reason:</label>
385 <div class="col-md-8">
386 <select class="form-control" name="reason_id">
387 <t t-foreach="reasons or []" t-as="reason">
388 <option t-att-value="reason.id" t-att-selected="reason.id == question.closed_reason_id.id"><t t-esc="reason.name"/></option>
393 <div class="form-group">
394 <div class="col-md-offset-3 col-md-8">
395 <button class="btn btn-primary">Close question</button>
396 <span class="text-muted">or</span>
397 <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">back to question</a>
404 <!-- Edition: post an answer -->
405 <template id="post_answer">
406 <h3 class="mt10">Your answer</h3>
408 <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
409 <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
410 - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
411 - it really helps to select the best questions and answers!
413 <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
414 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
415 <textarea name="content" class="form-control load_editor" required="True"/>
416 <button class="btn btn-primary mt16" id="btn_ask_your_question">Post Your Answer</button>
418 <script type="text/javascript">
419 CKEDITOR.replace("content");
424 <div t-attf-class="box oe_grey">
425 <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 ''}"
426 t-attf-data-karma="#{post.user_vote == 1 and post.karma_downvote or post.karma_upvote}"
427 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
428 <span id="vote_count" t-esc="post.vote_count"/>
429 <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 ''}"
430 t-attf-data-karma="#{post.user_vote == -1 and post.karma_upvote or post.karma_downvote}"
431 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
432 <div t-if="vote_count > 1" class="subtitle">
435 <div t-if="vote_count < 2" class="subtitle">
441 <!-- Specific Post Layout -->
442 <template id="post_description_full" name="Question Navigation">
443 <t t-call="website_forum.header">
444 <div t-attf-class="row question #{not question.active and 'alert alert-danger' or ''}">
445 <div class="col-md-2 hidden-xs text-center">
446 <t t-call="website_forum.vote">
447 <t t-set="post" t-value="question"/>
449 <div class="text-muted text-center">
450 <span t-field="question.views"/> Views
453 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
454 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
457 <div class="col-md-10">
459 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
460 <span t-if="not question.active"><b> [Deleted]</b></span>
461 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
463 <div class="alert alert-info text-center" t-if="question.state == 'close'">
465 <b>The question has been closed<t t-if="question.closed_reason_id"> for reason: <i t-esc="question.closed_reason_id.name"/></t></b>
467 <t t-if="question.closed_uid">
468 <b>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.closed_uid.id }"
469 t-field="question.closed_uid"
470 t-field-options='{"widget": "contact", "fields": ["name"]}'
471 style="display: inline-block;"/></b>
473 <b>on <span t-field="question.closed_date"/></b>
474 <div class="mt16 mb24 text-center">
475 <t t-call="website_forum.link_button">
476 <t t-set="url" t-value="'/forum/' + slug(forum) + '/question/' + slug(question) + '/reopen'"/>
477 <t t-set="label" t-value="'Reopen'"/>
478 <t t-set="classes" t-value="'fa-arrow-right'"/>
479 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
483 <t t-raw="question.content"/>
484 <div class="mt16 clearfix">
485 <div class="pull-right">
486 <div class="text-right">
487 <t t-foreach="question.tag_ids" t-as="tag">
488 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
491 <ul class="list-inline" id="options">
493 <a style="cursor: pointer" data-toggle="collapse"
494 t-attf-class="fa fa-comment-o #{not question.can_comment and 'karma_required text-muted' or ''}"
495 t-attf-data-karma="#{not question.can_comment and question.karma_comment or 0}"
496 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
500 <li t-if="question.state != 'close'">
501 <t t-call="website_forum.link_button">
502 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/ask_for_close'"/>
503 <t t-set="label" t-value="'Close'"/>
504 <t t-set="classes" t-value="'fa-times'"/>
505 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
508 <li t-if="question.state == 'close'">
509 <t t-call="website_forum.link_button">
510 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/reopen'"/>
511 <t t-set="label" t-value="'Reopen'"/>
512 <t t-set="classes" t-value="'fa-undo'"/>
513 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
517 <t t-call="website_forum.link_button">
518 <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/edit'"/>
519 <t t-set="label" t-value="'Edit'"/>
520 <t t-set="classes" t-value="'fa-edit'"/>
521 <t t-set="karma" t-value="not question.can_edit and question.karma_edit or 0"/>
524 <li t-if="question.active">
525 <t t-call="website_forum.link_button">
526 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/delete'"/>
527 <t t-set="label" t-value="'Delete'"/>
528 <t t-set="classes" t-value="'fa-trash-o'"/>
529 <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
532 <li t-if="not question.active">
533 <t t-call="website_forum.link_button">
534 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/undelete'"/>
535 <t t-set="label" t-value="'Undelete'"/>
536 <t t-set="classes" t-value="'fa-trash-o'"/>
537 <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
543 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{question.create_uid.id}/avatar"/>
545 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
546 t-field="question.create_uid"
547 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
548 style="display: inline-block;"/>
549 <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
550 <span class="text-muted">Asked on <span t-field="question.create_date" t-field-options='{"format":"short"}'/></span>
553 <div class="visible-xs text-center">
554 <t t-call="website_forum.vote">
555 <t t-set="post" t-value="question"/>
557 <div class="text-muted text-center">
558 <span t-field="question.views"/> Views
561 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
562 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
566 <t t-call="website_forum.post_comment">
567 <t t-set="object" t-value="question"/>
573 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
574 <a t-attf-id="answer-#{str(answer.id)}"/>
575 <div t-attf-class="forum_answer row" t-attf-id="answer_#{answer.id}" >
576 <div class="col-md-2 hidden-xs text-center">
577 <t t-call="website_forum.vote">
578 <t t-set="post" t-value="answer"/>
580 <div class="text-muted mt8">
581 <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 ''}"
582 t-attf-data-karma="#{answer.karma_accept}"
583 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
586 <div class="col-md-10 clearfix">
587 <t t-raw="answer.content"/>
589 <ul class="list-inline pull-right">
591 <a t-attf-class="fa fa-comment-o #{not answer.can_comment and 'karma_required text-muted' or ''}"
592 t-attf-data-karma="#{not answer.can_comment and answer.karma_comment or 0}"
593 style="cursor: pointer" data-toggle="collapse"
594 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
598 <t t-call="website_forum.link_button">
599 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/edit'"/>
600 <t t-set="label" t-value="'Edit'"/>
601 <t t-set="classes" t-value="'fa fa-edit'"/>
602 <t t-set="karma" t-value="not answer.can_edit and answer.karma_edit or 0"/>
606 <t t-call="website_forum.link_button">
607 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/delete'"/>
608 <t t-set="label" t-value="'Delete'"/>
609 <t t-set="classes" t-value="'fa-trash-o'"/>
610 <t t-set="karma" t-value="not answer.can_unlink and answer.karma_unlink or 0"/>
614 <t t-call="website_forum.link_button">
615 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/convert_to_comment'"/>
616 <t t-set="label" t-value="'Convert as a comment'"/>
617 <t t-set="classes" t-value="'fa-magic'"/>
618 <t t-set="karma" t-value="not answer.can_comment_convert and answer.karma_comment_convert or 0"/>
622 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{answer.create_uid.id}/avatar"/>
624 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ answer.create_uid.id }"
625 t-field="answer.create_uid"
626 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
627 style="display: inline-block;"/>
628 <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
629 <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
631 <div class="visible-xs text-center">
632 <t t-call="website_forum.vote">
633 <t t-set="post" t-value="answer"/>
635 <div class="text-muted mt8">
636 <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 ''}"
637 t-attf-data-karma="#{answer.karma_accept}"
638 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
642 <t t-call="website_forum.post_comment">
643 <t t-set="object" t-value="answer"/>
648 <div t-if="not question.uid_has_answered">
649 <t t-call="website_forum.post_answer"/>
651 <div t-if="question.uid_has_answered" class="mb16">
652 <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
653 <span class="text-muted">(only one answer per question is allowed)</span>
658 <!-- Utility template: Post a Comment -->
659 <template id="post_comment">
660 <div class="row clearfix">
661 <div class="col-sm-10 col-sm-offset-2">
662 <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
663 <small class="text-muted">
664 <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"/>
665 <t t-call="website_forum.link_button">
666 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/delete'"/>
667 <t t-set="label" t-value="' '"/>
668 <t t-set="karma" t-value="user.karma<required_karma and required_karma or 0"/>
669 <t t-set="classes" t-value="'close comment_delete fa-times'"/>
672 <span t-field="message.body"/>
673 <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"/>
674 <t t-call="website_forum.link_button">
675 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/convert_to_answer'"/>
676 <t t-set="label" t-value="'Convert as an answer'"/>
677 <t t-set="karma" t-value="user.karma<required_karma and required_karma or 0"/>
678 <t t-set="classes" t-value="'fa-magic pull-right'"/>
680 <a t-attf-href="/forum/#{slug(forum)}/partner/#{message.author_id.id}"
681 t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
682 style="display: inline-block;"/>
683 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
686 <div class="css_editable_mode_hidden">
687 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
688 t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
689 <input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
690 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
691 <button type="submit" class="btn btn-primary mt8">Post</button>
699 <t t-call="website_forum.header">
703 <p class="text-muted">
704 A tag is a label that categorizes your question with other,
705 similar questions. Using the right tags makes it easier for
706 others to find and answer your question.
709 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
710 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
711 <span t-field="tag.name"/>
714 X <t t-esc="tag.posts_count"/>
721 <template id="badge">
722 <t t-call="website_forum.header">
727 Besides gaining reputation with your questions and answers,
728 you receive badges for being especially helpful. Badges
729 appear on your profile page, and your posts.
731 <table class="table mt32 mb64">
732 <tr t-foreach="badges" t-as="badge">
734 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
735 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
736 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
737 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
738 <span t-field="badge.name"/>
741 <b t-esc="badge.stat_count_distinct"/>
742 <i class="text-muted">awarded users</i>
744 <span t-field="badge.description"/>
751 <template id="badge_user">
752 <t t-call="website_forum.header">
753 <h3 class="mt32 mb32">
754 <b>Badge "<span t-field="badge.name"/>"</b>
757 <div class="pull-left badge">
758 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
759 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
760 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
761 <span t-field="badge.name"/>
763 <span t-field="badge.description" style="margin-left:20px"/>
766 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
767 <span t-if="badge.stat_count_distinct>1">users</span>
768 <span t-if="badge.stat_count_distinct<=1">user</span>
772 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
773 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
775 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
782 <template id="users">
783 <t t-call="website_forum.header">
784 <div t-foreach="users" t-as="row_users" class="row mt16">
785 <div t-foreach="row_users" t-as="user" class="col-sm-4">
786 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
788 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
789 <t t-if="user.country_id">
790 <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
792 <b><t t-esc="user.karma"/></b>
793 <t t-raw="separator"/>
796 <span class="fa fa-circle badge-gold"/>
797 <t t-esc="user.gold_badge"/>
798 <span class="fa fa-circle badge-silver"/>
799 <t t-esc="user.silver_badge"/>
800 <span class="fa fa-circle badge-bronze"/>
801 <t t-esc="user.bronze_badge"/>
807 <div class="pull-left">
808 <t t-call="website.pager"/>
813 <!--Private profile-->
814 <template id="private_profile">
815 <t t-call="website_forum.header">
816 <h1 class="mt32">This profile is private!</h1>
818 <a t-attf-href="/forum/#{slug(forum)}">Return to the question list.</a>
823 <template id="edit_profile">
824 <t t-call="website_forum.header">
825 <h3>Edit Profile</h3>
827 <div class="col-md-2">
828 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
830 <div class="col-md-10">
831 <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
832 <input name="user_id" t-att-value="user.id" type="hidden"/>
833 <div class="form-group">
834 <label class="col-md-2 control-label mb16" for="user_name">Real name</label>
835 <div class="col-md-8 mb16">
836 <input type="text" class="form-control" name="name" id="user_name" required="True" t-attf-value="#{user.name}"/>
839 <div class="form-group">
840 <label class="col-md-2 control-label mb16" for="user_website_published" t-if="user.id == uid">Public profile</label>
841 <div class="col-md-8 mb16" t-if="user.id == uid">
842 <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" t-if="not user.website_published"/>
843 <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" checked="checked" t-if="user.website_published"/>
846 <div class="form-group">
847 <label class="col-md-2 control-label mb16" for="user_website">Website</label>
848 <div class="col-md-8 mb16">
849 <input type="text" class="form-control" name="website" id="user_website" t-attf-value="#{user.partner_id.website or ''}"/>
852 <div class="form-group">
853 <div t-if="email_required" class="alert alert-danger alert-dismissable oe_forum_email_required">
854 <button type="button" class="close" data-dismiss="alert">x</button>
855 <p>Please enter a valid email address in order to receive notifications from answers or comments.</p>
857 <label class="col-md-2 control-label mb16" for="user_email">Email</label>
858 <div class="col-md-8 mb16">
859 <input type="text" class="form-control" name="email" id="user_email" required="True" t-attf-value="#{user.partner_id.email}"/>
862 <div class="form-group">
863 <label class="col-md-2 control-label mb16" for="user_city">City</label>
864 <div class="col-md-8 mb16">
865 <input type="text" class="form-control" name="city" id="user_city" t-attf-value="#{user.partner_id.city or ''}"/>
868 <div class="form-group">
869 <label class="col-md-2 control-label mb16">Country</label>
870 <div class="col-md-8 mb16">
871 <select class="form-control" name="country">
872 <option value="">Country...</option>
873 <t t-foreach="countries or []" t-as="country">
874 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country_id.id"><t t-esc="country.name"/></option>
879 <!--Note: using website_description fiels instead of using commnt firld of partner-->
880 <div class="form-group">
881 <label class="col-md-2 control-label mb16" for="description">Biography</label>
882 <div class="col-md-8 mb16">
883 <textarea name="description" id="description" style="min-height: 120px" required="True"
884 class="form-control load_editor"><t t-esc="user.partner_id.website_description"/></textarea>
887 <div class="col-sm-offset-2 col-md-2 mb16">
888 <button class="btn btn-primary btn-lg">Update</button>
893 <script type="text/javascript">
894 CKEDITOR.replace("description");
899 <template id="user_detail_full">
900 <t t-call="website_forum.header">
901 <h1 class="mt0 page-header">
902 <span t-field="user.name"/>
903 <small>profile</small>
904 <t t-call="website.publish_management" groups="base.group_website_publisher">
905 <t t-set="object" t-value="user"/>
909 <div class="col-sm-2">
910 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
912 <div class="col-sm-10">
913 <table class="table table-condensed">
915 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
916 <td>member since</td>
917 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
919 <td>last connection</td>
920 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
923 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
926 <a t-att-href="user.website" t-if="user.website">
927 <span t-field="user.website"/>
933 <span t-field="user.city"/>
934 <span t-if="user.city and user.country_id">, </span>
935 <span t-field="user.country_id"/>
936 <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
941 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
943 <td><span t-field="user.karma"/></td>
947 <span class="fa fa-thumbs-up"/>
948 <span t-esc="up_votes"/>
949 <span class="fa fa-thumbs-down"/>
950 <span t-esc="down_votes"/>
954 <div class="well well-sm">
955 <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
956 <t t-if="uid == user.id">
957 <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
963 <ul class="nav nav-tabs">
965 <a href="#questions" data-toggle="tab"><t t-esc="count_questions"/> Questions</a>
968 <a href="#answers" data-toggle="tab"><t t-esc="count_answers"/> Answers</a>
970 <li t-if="uid == user.id">
971 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
973 <li t-if="uid == user.id">
974 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
976 <li t-if="uid == user.id">
977 <a href="#activity" data-toggle="tab">Activity</a>
980 <a href="#badges" data-toggle="tab">Badges</a>
982 <li t-if="uid == user.id">
983 <a href="#votes" data-toggle="tab">Votes</a>
986 <div class="tab-content mt16">
987 <div class="tab-pane active" id="questions">
988 <div class="mb16" t-foreach="questions" t-as="question">
989 <t t-call="website_forum.display_post"/>
991 </div><div class="tab-pane" id="answers">
992 <div t-foreach="answers" t-as="answer">
993 <t t-call="website_forum.display_post_answer"/>
996 <div class="tab-pane" id="karma">
999 <div class="tab-pane" id="badges">
1000 <t t-call="website_forum.user_badges"/>
1002 <div class="tab-pane" id="favourite_question" t-if="uid == user.id">
1003 <div t-foreach="favourite" t-as="question">
1004 <t t-call="website_forum.display_post"/>
1007 <div class="tab-pane" id="followed_question" t-if="uid == user.id">
1008 <div t-foreach="followed" t-as="question" class="mb16">
1009 <t t-call="website_forum.display_post"/>
1012 <div class="tab-pane" id="votes" t-if="uid == user.id">
1013 <t t-call="website_forum.user_votes"/>
1015 <div class="tab-pane" id="activity" t-if="uid == user.id">
1016 <ul class="list-unstyled">
1017 <li t-foreach="activities" t-as="activity">
1018 <span t-field="activity.date" t-field-options='{"format": "short"}'/>
1019 <span t-esc="activity.subtype_id.name" class="label label-info"/>
1020 <t t-set="post" t-value="posts[activity.res_id]"/>
1021 <span t-if="post[1]">
1022 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
1023 <span t-esc="post[0].name"/>
1026 <span t-if="not post[1]">
1027 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
1028 <span t-esc="post[0].name"/>
1038 <template id="user_badges">
1039 <table class="table mt32 mb64">
1040 <tr t-foreach="user.badge_ids" t-as="badge">
1042 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
1043 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
1044 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
1045 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
1046 <span t-field="badge.badge_id.name"/>
1049 <b t-esc="badge.badge_id.stat_count_distinct"/>
1050 <i class="text-muted">awarded users</i>
1052 <span t-field="badge.badge_id.description"/>
1056 <div class="mb16" t-if="not user.badge_ids">
1057 <b>No badge yet!</b><br/>
1058 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
1062 <template id="user_votes">
1063 <div t-foreach="vote_post" t-as="vote">
1064 <t t-esc="vote.post_id.create_date"/>
1065 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
1066 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
1067 <t t-if="vote.post_id.parent_id">
1068 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.parent_id.id }/#answer-#{ vote.post_id.id }" t-esc="vote.post_id.parent_id.name" style="margin-left:10px"/>
1070 <t t-if="not vote.post_id.parent_id">
1071 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
1074 <div class="mb16" t-if="not vote_post">
1075 <b>No vote given by you yet!</b>
1079 <!-- User Navbar -->
1080 <template id="content_new_forum" inherit_id="website.user_navbar" groups="base.group_user">
1081 <xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
1082 <li><a href="#" data-action="new_forum">New Forum</a></li>