1 <?xml version="1.0" encoding="utf-8"?>
6 <template id="editor_head" inherit_id="website.editor_head"
8 <xpath expr="." position="inside">
9 <link rel='stylesheet' href="/website_forum/static/src/css/website_forum.css"/>
11 <script type="text/javascript" src="/website_forum/static/src/js/website.tour.forum.js"/>
12 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.editor.js"/>
16 <!-- Layout add nav and footer -->
17 <template id="header_footer_custom" inherit_id="website.footer_default"
18 name="Footer Questions Link">
19 <xpath expr="//ul[@id='products']" position="inside">
20 <li><a t-attf-href="/forum/%(website_forum.forum_help)d">Q&A</a></li>
21 <li><a href="/forum">Forums</a></li>
26 <template id="link_button">
27 <form method="POST" t-att-action="url">
28 <button t-attf-class="fa btn-link #{classes} #{karma and 'karma_required text-muted' or ''}" t-attf-data-karma="#{karma}">
29 <t t-esc="label"/></button>
34 <template id="header" name="Forum Index">
35 <t t-call="website.layout">
37 <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
38 <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
39 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
40 <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
41 <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
42 <script type="text/javascript">
43 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
44 ,['Outdent','Indent','Link','Unlink','Image'],] ;
47 <div class="container mt16">
48 <div class="navbar navbar-default">
49 <div class="navbar-header">
50 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
51 <span class="sr-only">Toggle navigation</span>
52 <span class="icon-bar"></span>
53 <!-- <span class="icon-bar"></span> -->
54 <span class="icon-bar"></span>
56 <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
57 <span t-field="forum.name"/>
60 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
61 <ul class="nav navbar-nav">
62 <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
63 <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
65 <li t-att-class="searches.get('users') and 'active' or '' ">
66 <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
68 <li t-att-class="searches.get('tags') and 'active' or '' ">
69 <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
71 <li t-att-class="searches.get('badges') and 'active' or '' ">
72 <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
74 <li t-if="not is_public_user" t-att-class="searches.get('my_profile') and 'active' or '' ">
75 <a t-attf-href="/forum/#{ slug(forum) }/user/#{user.id}">My Profile</a>
78 <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
79 <div class="form-group">
80 <input type="search" class="form-control"
81 name="search" placeholder="Search a question..."
82 t-att-value="search or ''"/>
83 <button type="submit" class="btn btn-default">Search</button>
90 <div id="wrap" class="container">
92 <div class="col-sm-9">
93 <div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable">
94 <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
95 <div t-field="notification.body"/>
96 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }#badges" class="fa fa-arrow-right">View Your Badges</a>
100 <div class="col-sm-3" id="right-column">
101 <a t-if="not header.get('ask_hide')" class="btn btn-primary btn-lg btn-block mb16" t-attf-href="/forum/#{slug(forum)}/ask">Ask a Question</a>
102 <div class="panel panel-default">
103 <div class="panel-heading">
104 <h3 class="panel-title">Keep Informed</h3>
106 <div class="panel-body">
107 <t t-call="website_mail.follow">
108 <t t-set="email" t-value="user.email"/>
109 <t t-set="object" t-value="forum"/>
113 <div class="panel panel-default" id="about_forum">
114 <div class="panel-heading">
115 <h3 class="panel-title">About This Forum</h3>
117 <div class="panel-body">
118 <t t-raw="forum.description"/>
119 <a t-if="not header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
120 <a t-if="header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}" class="fa fa-arrow-right"> Back to <span t-field="forum.name"/></a>
123 <div t-if="header.get('question_data')">
124 <div class="panel panel-default">
125 <div class="panel-heading text-center">
126 <h3 class="panel-title">Question tools</h3>
128 <div class="panel-body text-center">
129 <t t-call="website_mail.follow"><t t-set="object" t-value="question"/></t>
131 <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower(s)
134 <div class="panel-heading text-center">
135 <h3 class="panel-title ">Stats</h3>
137 <div class="panel-body">
138 <table class="table">
139 <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
140 <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
141 <span t-if="question.views>1">times</span>
142 <span t-if="question.views<=1">time</span>
144 <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
152 <div class="oe_structure"/>
156 <!-- Display a post -->
157 <template id="display_post">
158 <div class="question clearfix">
159 <div class="col-md-2 hidden-xs text-center">
160 <div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
161 <span t-esc="question.child_count"/>
162 <div t-if="question.child_count>1" class="subtitle">Answers</div>
163 <div t-if="question.child_count<=1" class="subtitle">Answer</div>
166 <div class="col-md-10 clearfix">
167 <div class="question-name">
168 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
169 <span t-if="not question.active"><b> [Deleted]</b></span>
170 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
172 <t t-foreach="question.tag_ids" t-as="question_tag">
173 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{slug(question_tag)}/questions">
174 <span t-attf-class="pull-right badge #{tag and tag.name == question_tag.name and 'badge-active' ''}" t-field="question_tag.name"
175 style="margin-right: 4px;"/>
178 <div class="text-muted">
179 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
180 t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
181 style="display: inline-block;"/>
182 on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
183 <span class="visible-xs">
184 <b t-esc="question.child_count or 0"/>
185 <t t-if="question.child_count>1">answers</t>
186 <t t-if="question.child_count==1">answers</t>
188 with <b t-field="question.views"/> views
189 <span t-if="question.vote_count>0"> and
190 <b t-esc="question.vote_count or 0"/>
191 <t t-if="question.vote_count>1">votes</t>
192 <t t-if="question.vote_count==1">vote</t>
199 <!-- Display a post as an answer -->
200 <template id="display_post_answer">
201 <div class="clearfix">
202 <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
203 <div t-esc="len(answer.vote_ids)"/>
205 <div class="question-name" style="margin-left: 32px;">
206 <a style="font-size: 15px;" t-attf-href="/forum/#{ slug(forum) }/question/#{ answer.parent_id.id }/#answer-#{ answer.id }" t-esc="answer.parent_id.name"/>
207 <t t-if="len(answer.website_message_ids)>0">
208 (<t t-esc="len(answer.website_message_ids)"/>
209 <t t-if="len(answer.website_message_ids)>1">Comments</t>
210 <t t-if="len(answer.website_message_ids)<=1">Comment</t>)
218 <t t-call="website_forum.header">
219 <div t-field="forum.faq"/>
223 <!-- All Forums Layout -->
224 <template id="forum_all">
225 <t t-call="website.layout">
226 <div class="container">
227 <h1 class="mb32">Our forums</h1>
229 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
230 <a t-attf-href="/forum/#{ slug(forum) }">
231 <div class="fa fa-5x fa-comment mb16"/>
232 <div t-field="forum.name"/>
240 <!-- Specific Forum Layout -->
241 <template id="forum_index" name="Forum">
242 <t t-call="website_forum.header">
243 <h1 class="page-header mt0">
244 <t t-esc="question_count"/> <span>Questions</span>
246 <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
247 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
248 <t t-if="filters == 'all'">All</t>
249 <t t-if="filters == 'unanswered'">Unanswered</t>
250 <t t-if="filters == 'followed'">Followed</t>
251 <t t-if="tag"><span t-field="tag.name"/></t>
252 <t t-if="sorting == 'date'"> by activity date</t>
253 <t t-if="sorting == 'creation'"> by creation date</t>
254 <t t-if="sorting == 'answered'"> by most answered</t>
255 <t t-if="sorting == 'vote'"> by most voted</t>
258 <ul class="dropdown-menu">
259 <li class="dropdown-header">Filter on</li>
260 <li t-att-class="filters == 'all' and 'active' or '' ">
261 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
263 <li t-att-class="filters == 'unanswered' and 'active' or '' ">
264 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
266 <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
267 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
269 <li class="dropdown-header">Tags</li>
270 <li t-if="tag" t-att-class="tag and 'active' or '' ">
271 <a href=""><t t-esc="tag.name"/></a>
273 <li class="dropdown-header">Sort by</li>
274 <li t-att-class="sorting == 'date' and 'active' or '' ">
275 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
277 <li t-att-class="sorting == 'creation' and 'active' or '' ">
278 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='creation')">Newest</a>
280 <li t-att-class="sorting == 'answered' and 'active' or '' ">
281 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
283 <li t-att-class="sorting == 'vote' and 'active' or '' ">
284 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
289 <div t-foreach="question_ids" t-as="question" class="mb16">
290 <t t-call="website_forum.display_post"/>
292 <t t-call="website.pager"/>
297 <t t-call="website_forum.header">
298 <div class="oe_structure oe_empty"/>
299 <h1 class="mt32">Question not found!</h1>
300 <p>Sorry, this question is not available anymore.</p>
302 <a t-attf-href="/forum">Return to the question list.</a>
307 <!-- Edition: ask your question -->
308 <template id="ask_question">
309 <t t-call="website_forum.header">
310 <h1 class="mt0">Ask your Question</h1>
312 <li> please, try to make your question interesting to others </li>
313 <li> provide enough details and, if possible, give an example </li>
314 <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
316 <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
317 <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
318 class="form-control" placeholder="Enter your Question"/>
319 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
320 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
321 <textarea name="content" required="True" class="form-control load_editor">
322 <t t-esc="question_content"/>
325 <input type="text" name="question_tags" placeholder="Tags" class="form-control load_tags"/>
327 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Question</button>
329 <script type="text/javascript">
330 CKEDITOR.replace("content");
335 <!-- Edition: edit a post -->
336 <template id="edit_post">
337 <t t-call="website_forum.header">
338 <h3 t-if="not is_answer">Edit question</h3>
339 <h3 t-if="is_answer">Edit answer</h3>
340 <form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
341 <div t-if="not is_answer">
342 <input type="text" name="question_name" id="question_name" required="True"
343 t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
344 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
346 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
347 <textarea name="content" required="True" class="form-control load_editor">
348 <t t-esc="post.content"/>
350 <div t-if="not is_answer">
352 <input type="text" name="question_tag" class="form-control col-md-9 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
355 <button class="btn btn-primary btn-lg">Save</button>
357 <script type="text/javascript">
358 CKEDITOR.replace("content");
363 <!-- Moderation: close a question -->
364 <template id="close_question">
365 <t t-call="website_forum.header">
366 <h1 class="mt0">Close question</h1>
367 <p class="text-muted">
368 If you close this question, it will be hidden for most users. Only
369 users having a high karma can see closed questions to moderate
372 <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
373 <input name="post_id" t-att-value="question.id" type="hidden"/>
374 <div class="form-group">
375 <label class="col-md-3 control-label" for="reason">Question:</label>
376 <div class="col-md-8 mt8">
377 <span t-field="question.name"/>
380 <div class="form-group">
381 <label class="col-md-3 control-label" for="reason">Reason:</label>
382 <div class="col-md-8">
383 <select class="form-control" name="reason_id">
384 <t t-foreach="reasons or []" t-as="reason">
385 <option t-att-value="reason.id" t-att-selected="reason.id == question.closed_reason_id.id"><t t-esc="reason.name"/></option>
390 <div class="form-group">
391 <div class="col-md-offset-3 col-md-8">
392 <button class="btn btn-primary">Close question</button>
393 <span class="text-muted">or</span>
394 <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">back to question</a>
401 <!-- Edition: post an answer -->
402 <template id="post_answer">
403 <h3 class="mt10">Your answer</h3>
405 <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
406 <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
407 - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
408 - it really helps to select the best questions and answers!
410 <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
411 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
412 <textarea name="content" class="form-control load_editor" required="True"/>
413 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Answer</button>
415 <script type="text/javascript">
416 CKEDITOR.replace("content");
421 <div t-attf-class="box oe_grey">
422 <a t-attf-class="vote_up fa fa-thumbs-up no-decoration #{post.user_vote == 1 and 'text-success' or ''} #{((post.user_vote == 1 and not post.can_downvote) or not post.can_upvote) and 'karma_required' or ''}"
423 t-attf-data-karma="#{post.user_vote == 1 and post.karma_downvote or post.karma_upvote}"
424 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
425 <span id="vote_count" t-esc="post.vote_count"/>
426 <a t-attf-class="vote_down fa fa-thumbs-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''} #{((post.user_vote == -1 and not post.can_upvote) or not post.can_downvote) and 'karma_required' or ''}"
427 t-attf-data-karma="#{post.user_vote == -1 and post.karma_upvote or post.karma_downvote}"
428 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
429 <div t-if="vote_count > 1" class="subtitle">
432 <div t-if="vote_count < 2" class="subtitle">
438 <!-- Specific Post Layout -->
439 <template id="post_description_full" name="Question Navigation">
440 <t t-call="website_forum.header">
441 <div t-attf-class="question #{not question.active and 'alert alert-danger' or ''}">
442 <div class="col-md-2 hidden-xs text-center">
443 <t t-call="website_forum.vote">
444 <t t-set="post" t-value="question"/>
446 <div class="text-muted text-center">
447 <span t-field="question.views"/> Views
450 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
451 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
454 <div class="col-md-10">
456 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
457 <span t-if="not question.active"><b> [Deleted]</b></span>
458 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
460 <div class="alert alert-info text-center" t-if="question.state == 'close'">
462 <b>The question has been closed<t t-if="question.closed_reason_id"> for reason: <i t-esc="question.closed_reason_id.name"/></t></b>
464 <t t-if="question.closed_uid">
465 <b>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.closed_uid.id }"
466 t-field="question.closed_uid"
467 t-field-options='{"widget": "contact", "fields": ["name"]}'
468 style="display: inline-block;"/></b>
470 <b>on <span t-field="question.closed_date"/></b>
471 <div class="mt16 mb24 text-center">
472 <t t-call="website_forum.link_button">
473 <t t-set="url" t-value="'/forum/' + slug(forum) + '/question/' + slug(question) + '/reopen'"/>
474 <t t-set="label" t-value="'Reopen'"/>
475 <t t-set="classes" t-value="'fa-arrow-right'"/>
476 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
480 <t t-raw="question.content"/>
481 <div class="mt16 clearfix">
482 <div class="pull-right">
483 <div class="text-right">
484 <t t-foreach="question.tag_ids" t-as="tag">
485 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
488 <ul class="list-inline" id="options">
490 <a style="cursor: pointer" data-toggle="collapse"
491 t-attf-class="fa fa-comment-o #{not question.can_comment and 'karma_required text-muted' or ''}"
492 t-attf-data-karma="#{not question.can_comment and question.karma_comment or 0}"
493 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
497 <li t-if="question.state != 'close'">
498 <t t-call="website_forum.link_button">
499 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/ask_for_close'"/>
500 <t t-set="label" t-value="'Close'"/>
501 <t t-set="classes" t-value="'fa-times'"/>
502 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
505 <li t-if="question.state == 'close'">
506 <t t-call="website_forum.link_button">
507 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/reopen'"/>
508 <t t-set="label" t-value="'Reopen'"/>
509 <t t-set="classes" t-value="'fa-undo'"/>
510 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
514 <t t-call="website_forum.link_button">
515 <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/edit'"/>
516 <t t-set="label" t-value="'Edit'"/>
517 <t t-set="classes" t-value="'fa-edit'"/>
518 <t t-set="karma" t-value="not question.can_edit and question.karma_edit or 0"/>
521 <li t-if="question.active">
522 <t t-call="website_forum.link_button">
523 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/delete'"/>
524 <t t-set="label" t-value="'Delete'"/>
525 <t t-set="classes" t-value="'fa-trash-o'"/>
526 <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
529 <li t-if="not question.active">
530 <t t-call="website_forum.link_button">
531 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/undelete'"/>
532 <t t-set="label" t-value="'Undelete'"/>
533 <t t-set="classes" t-value="'fa-trash-o'"/>
534 <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
540 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{question.create_uid.id}/avatar"/>
542 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
543 t-field="question.create_uid"
544 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
545 style="display: inline-block;"/>
546 <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
547 <span class="text-muted">Asked on <span t-field="question.create_date" t-field-options='{"format":"short"}'/></span>
550 <div class="visible-xs text-center">
551 <t t-call="website_forum.vote">
552 <t t-set="post" t-value="question"/>
554 <div class="text-muted text-center">
555 <span t-field="question.views"/> Views
558 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
559 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
563 <t t-call="website_forum.post_comment">
564 <t t-set="object" t-value="question"/>
570 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
571 <a t-attf-id="answer-#{str(answer.id)}"/>
572 <div t-attf-class="forum_answer" t-attf-id="answer_#{answer.id}" >
573 <div class="col-md-2 hidden-xs text-center">
574 <t t-call="website_forum.vote">
575 <t t-set="post" t-value="answer"/>
577 <div class="text-muted mt8">
578 <a t-attf-class="accept_answer fa fa-2x fa-check-circle no-decoration #{answer.is_correct and 'oe_answer_true' or 'oe_answer_false'} #{not answer.can_accept and 'karma_required' or ''}"
579 t-attf-data-karma="#{answer.karma_accept}"
580 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
583 <div class="col-md-10 clearfix">
584 <t t-raw="answer.content"/>
586 <ul class="list-inline pull-right">
588 <a t-attf-class="fa fa-comment-o #{not answer.can_comment and 'karma_required text-muted' or ''}"
589 t-attf-data-karma="#{not answer.can_comment and answer.karma_comment or 0}"
590 style="cursor: pointer" data-toggle="collapse"
591 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
595 <t t-call="website_forum.link_button">
596 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/edit'"/>
597 <t t-set="label" t-value="'Edit'"/>
598 <t t-set="classes" t-value="'fa fa-edit'"/>
599 <t t-set="karma" t-value="not answer.can_edit and answer.karma_edit or 0"/>
603 <t t-call="website_forum.link_button">
604 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/delete'"/>
605 <t t-set="label" t-value="'Delete'"/>
606 <t t-set="classes" t-value="'fa-trash-o'"/>
607 <t t-set="karma" t-value="not answer.can_unlink and answer.karma_unlink or 0"/>
611 <t t-call="website_forum.link_button">
612 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/convert_to_comment'"/>
613 <t t-set="label" t-value="'Convert as a comment'"/>
614 <t t-set="classes" t-value="'fa-magic'"/>
615 <t t-set="karma" t-value="not answer.can_comment_convert and answer.karma_comment_convert or 0"/>
619 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{answer.create_uid.id}/avatar"/>
621 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ answer.create_uid.id }"
622 t-field="answer.create_uid"
623 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
624 style="display: inline-block;"/>
625 <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
626 <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
628 <div class="visible-xs text-center">
629 <t t-call="website_forum.vote">
630 <t t-set="post" t-value="answer"/>
632 <div class="text-muted mt8">
633 <a t-attf-class="accept_answer fa fa-2x fa-check-circle no-decoration #{answer.is_correct and 'oe_answer_true' or 'oe_answer_false'} #{not answer.can_accept and 'karma_required' or ''}"
634 t-attf-data-karma="#{answer.karma_accept}"
635 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
639 <t t-call="website_forum.post_comment">
640 <t t-set="object" t-value="answer"/>
645 <div t-if="not question.uid_has_answered">
646 <t t-call="website_forum.post_answer"/>
648 <div t-if="question.uid_has_answered" class="mb16">
649 <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
650 <span class="text-muted">(only one answer per question is allowed)</span>
655 <!-- Utility template: Post a Comment -->
656 <template id="post_comment">
657 <div class="row clearfix">
658 <div class="col-sm-10 col-sm-offset-2">
659 <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
660 <small class="text-muted">
661 <button type="button" t-if="user.partner_id.id == message.author_id.id and user.karma>=750"
662 t-attf-data-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/delete"
663 class="close comment_delete">&times;</button>
664 <span t-field="message.body"/>
665 <t t-set="required_karma" t-value="message.author_id.id == user.partner_id.id and object.forum_id.karma_comment_convert_own or object.forum_id.karma_comment_convert_all"/>
666 <t t-call="website_forum.link_button">
667 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/convert_to_answer'"/>
668 <t t-set="label" t-value="'Convert as an answer'"/>
669 <t t-set="karma" t-value="user.karma<required_karma and required_karma or 0"/>
670 <t t-set="classes" t-value="'fa-magic pull-right'"/>
672 <a t-attf-href="/forum/#{slug(forum)}/partner/#{message.author_id.id}"
673 t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
674 style="display: inline-block;"/>
675 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
678 <div class="css_editable_mode_hidden">
679 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
680 t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
681 <input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
682 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
683 <button type="submit" class="btn btn-primary mt8">Post</button>
691 <t t-call="website_forum.header">
695 <p class="text-muted">
696 A tag is a label that categorizes your question with other,
697 similar questions. Using the right tags makes it easier for
698 others to find and answer your question.
701 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
702 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
703 <span t-field="tag.name"/>
706 X <t t-esc="tag.posts_count"/>
713 <template id="badge">
714 <t t-call="website_forum.header">
719 Besides gaining reputation with your questions and answers,
720 you receive badges for being especially helpful. Badges
721 appear on your profile page, and your posts.
723 <table class="table mt32 mb64">
724 <tr t-foreach="badges" t-as="badge">
726 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
727 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
728 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
729 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
730 <span t-field="badge.name"/>
733 <b t-esc="badge.stat_count_distinct"/>
734 <i class="text-muted">awarded users</i>
736 <span t-field="badge.description"/>
743 <template id="badge_user">
744 <t t-call="website_forum.header">
745 <h3 class="mt32 mb32">
746 <b>Badge "<span t-field="badge.name"/>"</b>
749 <div class="pull-left badge">
750 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
751 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
752 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
753 <span t-field="badge.name"/>
755 <span t-field="badge.description" style="margin-left:20px"/>
758 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
759 <span t-if="badge.stat_count_distinct>1">users</span>
760 <span t-if="badge.stat_count_distinct<=1">user</span>
764 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
765 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
767 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
774 <template id="users">
775 <t t-call="website_forum.header">
776 <div t-foreach="users" t-as="row_users" class="row mt16">
777 <div t-foreach="row_users" t-as="user" class="col-sm-4">
778 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
780 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
781 <t t-if="user.country_id">
782 <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
784 <b><t t-esc="user.karma"/></b>
785 <t t-raw="separator"/>
788 <span class="fa fa-circle badge-gold"/>
789 <t t-esc="user.gold_badge"/>
790 <span class="fa fa-circle badge-silver"/>
791 <t t-esc="user.silver_badge"/>
792 <span class="fa fa-circle badge-bronze"/>
793 <t t-esc="user.bronze_badge"/>
799 <div class="pull-left">
800 <t t-call="website.pager"/>
805 <!--Private profile-->
806 <template id="private_profile">
807 <t t-call="website_forum.header">
808 <h1 class="mt32">This profile is private!</h1>
810 <a t-attf-href="/forum/#{slug(forum)}">Return to the question list.</a>
815 <template id="edit_profile">
816 <t t-call="website_forum.header">
818 <t t-call="website.publish_management">
819 <t t-set="object" t-value="user"/>
822 <div class="col-md-2">
823 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
825 <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
826 <input name="user_id" t-att-value="user.id" type="hidden"/>
827 <label class="col-md-2 control-label mb16" for="user.name">Real name</label>
828 <div class="col-md-7 mb16">
829 <input type="text" class="col-md-7 mb16 form-control" name="name" required="True" t-attf-value="#{user.name}"/>
831 <label class="col-md-2 control-label mb16" for="user.partner_id.website">Website</label>
832 <div class="col-md-7 mb16">
833 <input type="text" class="form-control" name="website" t-attf-value="#{user.partner_id.website or ''}"/>
835 <label class="col-md-4 control-label mb16" for="user.partner_id.email">Email</label>
836 <div class="col-md-7 mb16">
837 <input type="text" class="form-control" name="email" required="True" t-attf-value="#{user.partner_id.email}"/>
839 <label class="col-md-4 control-label mb16" for="user.partner_id.city">City</label>
840 <div class="col-md-7 mb16">
841 <input type="text" class="form-control" name="city" t-attf-value="#{user.partner_id.city or ''}"/>
843 <label class="col-md-4 control-label mb16" for="contact_name">Country</label>
844 <div class="col-md-7 mb16">
845 <select class="form-control" name="country">
846 <option value="">Country...</option>
847 <t t-foreach="countries or []" t-as="country">
848 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country_id.id"><t t-esc="country.name"/></option>
852 <!--Note: using website_description fiels instead of using commnt firld of partner-->
853 <label class="col-md-4 control-label mb16" for="user.partner_id.website_description">Biography</label>
854 <div class="col-md-7 mb16">
855 <textarea name="description" style="min-height: 120px" required="True"
856 class="form-control"><t t-esc="user.partner_id.website_description"/></textarea>
858 <div class="col-sm-offset-4 col-md-4 mb16">
859 <button class="btn btn-primary btn-lg">Update</button>
865 <template id="user_detail_full">
866 <t t-call="website_forum.header">
867 <h1 class="mt0 page-header">
868 <span t-field="user.name"/>
869 <small>profile</small>
870 <t t-call="website.publish_management" groups="base.group_website_publisher">
871 <t t-set="object" t-value="user"/>
875 <div class="col-sm-2">
876 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
878 <div class="col-sm-10">
879 <table class="table table-condensed">
881 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
882 <td>member since</td>
883 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
885 <td>last connection</td>
886 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
889 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
892 <a t-att-href="user.website" t-if="user.website">
893 <span t-field="user.website"/>
899 <span t-field="user.city"/>
900 <span t-if="user.city and user.country_id">, </span>
901 <span t-field="user.country_id"/>
902 <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
907 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
909 <td><span t-field="user.karma"/></td>
913 <span class="fa fa-thumbs-up"/>
914 <span t-esc="up_votes"/>
915 <span class="fa fa-thumbs-down"/>
916 <span t-esc="down_votes"/>
920 <div class="well well-sm">
921 <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
922 <t t-if="uid == user.id">
923 <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
929 <ul class="nav nav-tabs">
931 <a href="#questions" data-toggle="tab"><t t-esc="len(questions)"/> Questions</a>
934 <a href="#answers" data-toggle="tab"><t t-esc="len(answers)"/> Answers</a>
936 <li t-if="uid == user.id">
937 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
939 <li t-if="uid == user.id">
940 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
942 <li t-if="uid == user.id">
943 <a href="#activity" data-toggle="tab">Activity</a>
946 <a href="#badges" data-toggle="tab">Badges</a>
948 <li t-if="uid == user.id">
949 <a href="#votes" data-toggle="tab">Votes</a>
952 <div class="tab-content mt16">
953 <div class="tab-pane active" id="questions">
954 <div class="mb16" t-foreach="questions" t-as="question">
955 <t t-call="website_forum.display_post"/>
957 </div><div class="tab-pane" id="answers">
958 <div t-foreach="answers" t-as="answer">
959 <t t-call="website_forum.display_post_answer"/>
962 <div class="tab-pane" id="karma">
965 <div class="tab-pane" id="badges">
966 <t t-call="website_forum.user_badges"/>
968 <div class="tab-pane" id="favourite_question">
969 <div t-foreach="favourite" t-as="question">
970 <t t-call="website_forum.display_post"/>
973 <div class="tab-pane" id="followed_question">
974 <div t-foreach="followed" t-as="question" class="mb16">
975 <t t-call="website_forum.display_post"/>
978 <div class="tab-pane" id="votes">
979 <t t-call="website_forum.user_votes"/>
981 <div class="tab-pane" id="activity">
982 <ul class="list-unstyled">
983 <li t-foreach="activities" t-as="activity">
984 <span t-field="activity.date" t-field-options='{"format": "short"}'/>
985 <span t-esc="activity.subtype_id.name" class="label label-info"/>
986 <t t-set="post" t-value="posts[activity.res_id]"/>
987 <span t-if="post[1]">
988 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
989 <span t-esc="post[0].name"/>
992 <span t-if="not post[1]">
993 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
994 <span t-esc="post[0].name"/>
1004 <template id="user_badges">
1005 <table class="table mt32 mb64">
1006 <tr t-foreach="user.badge_ids" t-as="badge">
1008 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
1009 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
1010 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
1011 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
1012 <span t-field="badge.badge_id.name"/>
1015 <b t-esc="badge.badge_id.stat_count_distinct"/>
1016 <i class="text-muted">awarded users</i>
1018 <span t-field="badge.badge_id.description"/>
1022 <div class="mb16" t-if="not user.badge_ids">
1023 <b>No badge yet!</b><br/>
1024 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
1028 <template id="user_votes">
1029 <div t-foreach="vote_post" t-as="vote">
1030 <t t-esc="vote.post_id.create_date"/>
1031 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
1032 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
1033 <t t-if="vote.post_id.parent_id">
1034 <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"/>
1036 <t t-if="not vote.post_id.parent_id">
1037 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
1040 <div class="mb16" t-if="not vote_post">
1041 <b>No vote given by you yet!</b>
1045 <!-- User Navbar -->
1046 <template id="content_new_forum" inherit_id="website.user_navbar" groups="base.group_user">
1047 <xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
1048 <li><a href="#" data-action="new_forum">New Forum</a></li>