1 <?xml version="1.0" encoding="utf-8"?>
5 <!-- Layout add nav and footer -->
6 <template id="header_footer_custom" inherit_id="website.footer_default"
7 name="Footer Questions Link">
8 <xpath expr="//ul[@id='products']" position="inside">
9 <li><a t-attf-href="/forum/%(website_forum.forum_help)d">Q&A</a></li>
10 <li><a href="/forum">Forums</a></li>
15 <template id="link_button">
16 <form method="POST" t-att-action="url">
17 <button t-attf-class="fa btn-link #{classes} #{karma and 'karma_required text-muted' or ''}" t-attf-data-karma="#{karma}">
18 <t t-esc="label"/></button>
22 <template id="assets_frontend" inherit_id="website.assets_frontend" name="website_forum assets">
23 <xpath expr="." position="inside">
24 <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
25 <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
26 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
27 <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
31 <template id="assets_editor" inherit_id="website.assets_editor" name="Forum Editor" groups="base.group_user">
32 <xpath expr="." position="inside">
33 <script type="text/javascript" src="/website_forum/static/src/js/website.tour.forum.js"/>
34 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.editor.js"/>
39 <template id="header" name="Forum Index">
40 <t t-call="website.layout">
42 <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
43 <script type="text/javascript">
44 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
45 ,['Outdent','Indent','Link','Unlink','Image'],] ;
48 <div class="container mt16 website_forum">
49 <div class="navbar navbar-default">
50 <div class="navbar-header">
51 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
52 <span class="sr-only">Toggle navigation</span>
53 <span class="icon-bar"></span>
54 <!-- <span class="icon-bar"></span> -->
55 <span class="icon-bar"></span>
57 <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
58 <span t-field="forum.name"/>
61 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
62 <ul class="nav navbar-nav">
63 <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
64 <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
66 <li t-att-class="searches.get('users') and 'active' or '' ">
67 <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
69 <li t-att-class="searches.get('tags') and 'active' or '' ">
70 <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
72 <li t-att-class="searches.get('badges') and 'active' or '' ">
73 <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
75 <li t-if="not is_public_user" t-att-class="searches.get('my_profile') and 'active' or '' ">
76 <a t-attf-href="/forum/#{ slug(forum) }/user/#{uid}">My Profile</a>
79 <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
80 <div class="form-group">
81 <input type="search" class="form-control"
82 name="search" placeholder="Search a question..."
83 t-att-value="search or ''"/>
84 <button type="submit" class="btn btn-default">Search</button>
91 <div id="wrap" class="container">
93 <div class="col-sm-9">
94 <div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable">
95 <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
96 <div t-field="notification.body"/>
97 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }#badges" class="fa fa-arrow-right">View Your Badges</a>
99 <div t-if="not validation_email_sent and not is_public_user and user.karma == 0" class="alert alert-danger alert-dismissable">
100 <button type="button" class="close validation_email_close" data-dismiss="alert" aria-hidden="true">&times;</button>
103 It appears your email has not been verified.
104 <a class="send_validation_email" href="#" t-att-forum-id="forum.id">Click here to send a verification email allowing you to participate to the forum.</a>
108 <div t-if="validation_email_done" class="alert alert-success alert-dismissable">
109 <button type="button" class="close validated_email_close" data-dismiss="alert" aria-hidden="true">&times;</button>
111 <p>Congratulations! Your email has just been validated. You may now participate to our forums.</p>
116 <div class="col-sm-3" id="right-column">
117 <a t-if="not header.get('ask_hide')"
118 t-attf-class="btn btn-primary btn-lg btn-block mb16 #{(user.karma < forum.karma_ask) and 'karma_required' or ''}"
119 t-attf-href="/forum/#{slug(forum)}/ask"
120 t-attf-data-karma="#{forum.karma_ask}">Ask a Question</a>
121 <div class="panel panel-default">
122 <div class="panel-heading">
123 <h3 class="panel-title">Keep Informed</h3>
125 <div class="panel-body">
126 <t t-call="website_mail.follow">
127 <t t-set="email" t-value="user.email"/>
128 <t t-set="object" t-value="forum"/>
132 <div class="panel panel-default" id="about_forum">
133 <div class="panel-heading">
134 <h3 class="panel-title">About This Forum</h3>
136 <div class="panel-body">
137 <t t-raw="forum.description"/>
138 <a t-if="not header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
139 <a t-if="header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}" class="fa fa-arrow-right"> Back to <span t-field="forum.name"/></a>
142 <div t-if="header.get('question_data')">
143 <div class="panel panel-default">
144 <div class="panel-heading text-center">
145 <h3 class="panel-title">Question tools</h3>
147 <div class="panel-body text-center">
148 <t t-call="website_mail.follow"><t t-set="object" t-value="question"/></t>
150 <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower(s)
153 <div class="panel-heading text-center">
154 <h3 class="panel-title ">Stats</h3>
156 <div class="panel-body">
157 <table class="table">
158 <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
159 <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
160 <span t-if="question.views>1">times</span>
161 <span t-if="question.views<=1">time</span>
163 <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
171 <div class="oe_structure"/>
175 <!-- Display a post -->
176 <template id="display_post">
177 <div class="question row">
178 <div class="col-md-2 hidden-xs text-center">
179 <div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
180 <span t-esc="question.child_count"/>
181 <div t-if="question.child_count>1" class="subtitle">Answers</div>
182 <div t-if="question.child_count<=1" class="subtitle">Answer</div>
185 <div class="col-md-10 clearfix">
186 <div class="question-name">
187 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
188 <span t-if="not question.active"><b> [Deleted]</b></span>
189 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
191 <t t-foreach="question.tag_ids" t-as="question_tag">
192 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{slug(question_tag)}/questions">
193 <span t-attf-class="pull-right badge #{tag and tag.name == question_tag.name and 'badge-active' ''}" t-field="question_tag.name"
194 style="margin-right: 4px;"/>
197 <div class="text-muted">
198 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
199 t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
200 style="display: inline-block;"/>
201 on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
202 <span class="visible-xs">
203 <b t-esc="question.child_count or 0"/>
204 <t t-if="question.child_count>1">answers</t>
205 <t t-if="question.child_count==1">answers</t>
207 with <b t-field="question.views"/> views
208 <span t-if="question.vote_count>0"> and
209 <b t-esc="question.vote_count or 0"/>
210 <t t-if="question.vote_count>1">votes</t>
211 <t t-if="question.vote_count==1">vote</t>
218 <!-- Display a post as an answer -->
219 <template id="display_post_answer">
220 <div class="clearfix">
221 <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
222 <div t-esc="len(answer.vote_ids)"/>
224 <div class="question-name" style="margin-left: 32px;">
225 <a style="font-size: 15px;" t-attf-href="/forum/#{ slug(forum) }/question/#{ answer.parent_id.id }/#answer-#{ answer.id }" t-esc="answer.parent_id.name"/>
226 <t t-if="len(answer.website_message_ids)>0">
227 (<t t-esc="len(answer.website_message_ids)"/>
228 <t t-if="len(answer.website_message_ids)>1">Comments</t>
229 <t t-if="len(answer.website_message_ids)<=1">Comment</t>)
237 <t t-call="website_forum.header">
238 <div t-field="forum.faq"/>
242 <!-- All Forums Layout -->
243 <template id="forum_all">
244 <t t-call="website.layout">
245 <div class="container">
246 <h1 class="mb32">Our forums</h1>
248 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
249 <a t-attf-href="/forum/#{ slug(forum) }">
250 <div class="fa fa-5x fa-comment mb16"/>
251 <div t-field="forum.name"/>
259 <!-- Specific Forum Layout -->
260 <template id="forum_index" name="Forum">
261 <t t-call="website_forum.header">
262 <h1 class="page-header mt0">
263 <t t-esc="question_count"/> <span>Questions</span>
265 <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
266 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
267 <t t-if="filters == 'all'">All</t>
268 <t t-if="filters == 'unanswered'">Unanswered</t>
269 <t t-if="filters == 'followed'">Followed</t>
270 <t t-if="tag"><span t-field="tag.name"/></t>
271 <t t-if="sorting == 'date'"> by activity date</t>
272 <t t-if="sorting == 'creation'"> by creation date</t>
273 <t t-if="sorting == 'answered'"> by most answered</t>
274 <t t-if="sorting == 'vote'"> by most voted</t>
277 <ul class="dropdown-menu">
278 <li class="dropdown-header">Filter on</li>
279 <li t-att-class="filters == 'all' and 'active' or '' ">
280 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
282 <li t-att-class="filters == 'unanswered' and 'active' or '' ">
283 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
285 <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
286 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
288 <li class="dropdown-header">Tags</li>
289 <li t-if="tag" t-att-class="tag and 'active' or '' ">
290 <a href=""><t t-esc="tag.name"/></a>
292 <li class="dropdown-header">Sort by</li>
293 <li t-att-class="sorting == 'date' and 'active' or '' ">
294 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
296 <li t-att-class="sorting == 'creation' and 'active' or '' ">
297 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='creation')">Newest</a>
299 <li t-att-class="sorting == 'answered' and 'active' or '' ">
300 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
302 <li t-att-class="sorting == 'vote' and 'active' or '' ">
303 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
308 <div t-foreach="question_ids" t-as="question" class="mb16">
309 <t t-call="website_forum.display_post"/>
311 <t t-call="website.pager"/>
316 <t t-call="website_forum.header">
317 <div class="oe_structure oe_empty"/>
318 <h1 class="mt32">Question not found!</h1>
319 <p>Sorry, this question is not available anymore.</p>
321 <a t-attf-href="/forum">Return to the question list.</a>
326 <!-- Edition: ask your question -->
327 <template id="ask_question">
328 <t t-call="website_forum.header">
329 <h1 class="mt0">Ask your Question</h1>
331 <li> please, try to make your question interesting to others </li>
332 <li> provide enough details and, if possible, give an example </li>
333 <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
335 <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
336 <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
337 class="form-control" placeholder="Enter your Question"/>
338 <h5 class="mt20">Please enter a descriptive question (should finish with a '?')</h5>
339 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
340 <textarea name="content" required="True" class="form-control load_editor">
341 <t t-esc="question_content"/>
344 <input type="text" name="question_tags" placeholder="Tags" class="form-control load_tags"/>
346 <button t-attf-class="btn btn-primary #{(user.karma < forum.karma_ask) and 'karma_required' or ''}"
347 id="btn_ask_your_question" t-att-data-karma="forum.karma_ask">Post Your Question</button>
349 <script type="text/javascript">
350 CKEDITOR.replace("content");
355 <!-- Edition: edit a post -->
356 <template id="edit_post">
357 <t t-call="website_forum.header">
358 <h3 t-if="not is_answer">Edit question</h3>
359 <h3 t-if="is_answer">Edit answer</h3>
360 <form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
361 <div t-if="not is_answer">
362 <input type="text" name="question_name" id="question_name" required="True"
363 t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
364 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
366 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
367 <textarea name="content" required="True" class="form-control load_editor">
368 <t t-esc="post.content"/>
370 <div t-if="not is_answer">
372 <input type="text" name="question_tag" class="form-control col-md-9 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
375 <button class="btn btn-primary btn-lg">Save</button>
377 <script type="text/javascript">
378 CKEDITOR.replace("content");
383 <!-- Moderation: close a question -->
384 <template id="close_question">
385 <t t-call="website_forum.header">
386 <h1 class="mt0">Close question</h1>
387 <p class="text-muted">
388 If you close this question, it will be hidden for most users. Only
389 users having a high karma can see closed questions to moderate
392 <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
393 <input name="post_id" t-att-value="question.id" type="hidden"/>
394 <div class="form-group">
395 <label class="col-md-3 control-label" for="reason">Question:</label>
396 <div class="col-md-8 mt8">
397 <span t-field="question.name"/>
400 <div class="form-group">
401 <label class="col-md-3 control-label" for="reason">Reason:</label>
402 <div class="col-md-8">
403 <select class="form-control" name="reason_id">
404 <t t-foreach="reasons or []" t-as="reason">
405 <option t-att-value="reason.id" t-att-selected="reason.id == question.closed_reason_id.id"><t t-esc="reason.name"/></option>
410 <div class="form-group">
411 <div class="col-md-offset-3 col-md-8">
412 <button class="btn btn-primary">Close question</button>
413 <span class="text-muted">or</span>
414 <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">back to question</a>
421 <!-- Edition: post an answer -->
422 <template id="post_answer">
423 <h3 class="mt10">Your answer</h3>
425 <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
426 <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
427 - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
428 - it really helps to select the best questions and answers!
430 <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
431 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
432 <textarea name="content" class="form-control load_editor" required="True"/>
433 <button t-attf-class="btn btn-primary mt16 #{not question.can_answer and 'karma_required' or ''}"
434 id="btn_ask_your_question" t-att-data-karma="question.karma_answer">Post Your Answer</button>
436 <script type="text/javascript">
437 CKEDITOR.replace("content");
442 <div t-attf-class="box oe_grey">
443 <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 ''}"
444 t-attf-data-karma="#{post.user_vote == 1 and post.karma_downvote or post.karma_upvote}"
445 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
446 <span id="vote_count" t-esc="post.vote_count"/>
447 <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 ''}"
448 t-attf-data-karma="#{post.user_vote == -1 and post.karma_upvote or post.karma_downvote}"
449 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
450 <div t-if="vote_count > 1" class="subtitle">
453 <div t-if="vote_count < 2" class="subtitle">
459 <!-- Specific Post Layout -->
460 <template id="post_description_full" name="Question Navigation">
461 <t t-call="website_forum.header">
462 <div t-attf-class="row question #{not question.active and 'alert alert-danger' or ''}">
463 <div class="col-md-2 hidden-xs text-center">
464 <t t-call="website_forum.vote">
465 <t t-set="post" t-value="question"/>
467 <div class="text-muted text-center">
468 <span t-field="question.views"/> Views
471 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
472 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
475 <div class="col-md-10">
477 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
478 <span t-if="not question.active"><b> [Deleted]</b></span>
479 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
481 <div class="alert alert-info text-center" t-if="question.state == 'close'">
483 <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>
485 <t t-if="question.closed_uid">
486 <b>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.closed_uid.id }"
487 t-field="question.closed_uid"
488 t-field-options='{"widget": "contact", "fields": ["name"]}'
489 style="display: inline-block;"/></b>
491 <b>on <span t-field="question.closed_date"/></b>
492 <div class="mt16 mb24 text-center">
493 <t t-call="website_forum.link_button">
494 <t t-set="url" t-value="'/forum/' + slug(forum) + '/question/' + slug(question) + '/reopen'"/>
495 <t t-set="label" t-value="'Reopen'"/>
496 <t t-set="classes" t-value="'fa-arrow-right'"/>
497 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
501 <t t-raw="question.content"/>
502 <div class="mt16 clearfix">
503 <div class="pull-right">
504 <div class="text-right">
505 <t t-foreach="question.tag_ids" t-as="tag">
506 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
509 <ul class="list-inline" id="options">
511 <a style="cursor: pointer" t-att-data-toggle="question.can_comment and 'collapse' or ''"
512 t-attf-class="fa fa-comment-o #{not question.can_comment and 'karma_required text-muted' or ''}"
513 t-attf-data-karma="#{not question.can_comment and question.karma_comment or 0}"
514 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
518 <li t-if="question.state != 'close'">
519 <t t-call="website_forum.link_button">
520 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/ask_for_close'"/>
521 <t t-set="label" t-value="'Close'"/>
522 <t t-set="classes" t-value="'fa-times'"/>
523 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
526 <li t-if="question.state == 'close'">
527 <t t-call="website_forum.link_button">
528 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/reopen'"/>
529 <t t-set="label" t-value="'Reopen'"/>
530 <t t-set="classes" t-value="'fa-undo'"/>
531 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
535 <t t-call="website_forum.link_button">
536 <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/edit'"/>
537 <t t-set="label" t-value="'Edit'"/>
538 <t t-set="classes" t-value="'fa-edit'"/>
539 <t t-set="karma" t-value="not question.can_edit and question.karma_edit or 0"/>
542 <li t-if="question.active">
543 <t t-call="website_forum.link_button">
544 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/delete'"/>
545 <t t-set="label" t-value="'Delete'"/>
546 <t t-set="classes" t-value="'fa-trash-o'"/>
547 <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
550 <li t-if="not question.active">
551 <t t-call="website_forum.link_button">
552 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/undelete'"/>
553 <t t-set="label" t-value="'Undelete'"/>
554 <t t-set="classes" t-value="'fa-trash-o'"/>
555 <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
561 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{question.create_uid.id}/avatar"/>
563 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
564 t-field="question.create_uid"
565 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
566 style="display: inline-block;"/>
567 <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
568 <span class="text-muted">Asked on <span t-field="question.create_date" t-field-options='{"format":"short"}'/></span>
571 <div class="visible-xs text-center">
572 <t t-call="website_forum.vote">
573 <t t-set="post" t-value="question"/>
575 <div class="text-muted text-center">
576 <span t-field="question.views"/> Views
579 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
580 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
584 <t t-call="website_forum.post_comment">
585 <t t-set="object" t-value="question"/>
591 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
592 <a t-attf-id="answer-#{str(answer.id)}"/>
593 <div t-attf-class="forum_answer row" t-attf-id="answer_#{answer.id}" >
594 <div class="col-md-2 hidden-xs text-center">
595 <t t-call="website_forum.vote">
596 <t t-set="post" t-value="answer"/>
598 <div class="text-muted mt8">
599 <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 ''}"
600 t-attf-data-karma="#{answer.karma_accept}"
601 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
604 <div class="col-md-10 clearfix">
605 <t t-raw="answer.content"/>
607 <ul class="list-inline pull-right">
609 <a t-attf-class="fa fa-comment-o #{not answer.can_comment and 'karma_required text-muted' or ''}"
610 t-attf-data-karma="#{not answer.can_comment and answer.karma_comment or 0}"
611 style="cursor: pointer" t-att-data-toggle="answer.can_comment and 'collapse' or ''"
612 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
616 <t t-call="website_forum.link_button">
617 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/edit'"/>
618 <t t-set="label" t-value="'Edit'"/>
619 <t t-set="classes" t-value="'fa fa-edit'"/>
620 <t t-set="karma" t-value="not answer.can_edit and answer.karma_edit or 0"/>
624 <t t-call="website_forum.link_button">
625 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/delete'"/>
626 <t t-set="label" t-value="'Delete'"/>
627 <t t-set="classes" t-value="'fa-trash-o'"/>
628 <t t-set="karma" t-value="not answer.can_unlink and answer.karma_unlink or 0"/>
632 <t t-call="website_forum.link_button">
633 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/convert_to_comment'"/>
634 <t t-set="label" t-value="'Convert as a comment'"/>
635 <t t-set="classes" t-value="'fa-magic'"/>
636 <t t-set="karma" t-value="not answer.can_comment_convert and answer.karma_comment_convert or 0"/>
640 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{answer.create_uid.id}/avatar"/>
642 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ answer.create_uid.id }"
643 t-field="answer.create_uid"
644 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
645 style="display: inline-block;"/>
646 <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
647 <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
649 <div class="visible-xs text-center">
650 <t t-call="website_forum.vote">
651 <t t-set="post" t-value="answer"/>
653 <div class="text-muted mt8">
654 <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 ''}"
655 t-attf-data-karma="#{answer.karma_accept}"
656 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
660 <t t-call="website_forum.post_comment">
661 <t t-set="object" t-value="answer"/>
666 <div t-if="not question.uid_has_answered">
667 <t t-call="website_forum.post_answer"/>
669 <div t-if="question.uid_has_answered" class="mb16">
670 <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
671 <span class="text-muted">(only one answer per question is allowed)</span>
676 <!-- Utility template: Post a Comment -->
677 <template id="post_comment">
678 <div class="row clearfix">
679 <div class="col-sm-10 col-sm-offset-2">
680 <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
681 <small class="text-muted">
682 <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"/>
683 <t t-call="website_forum.link_button">
684 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/delete'"/>
685 <t t-set="label" t-value="' '"/>
686 <t t-set="karma" t-value="user.karma<required_karma and required_karma or 0"/>
687 <t t-set="classes" t-value="'close comment_delete fa-times'"/>
690 <span t-field="message.body"/>
691 <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"/>
692 <t t-call="website_forum.link_button">
693 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/convert_to_answer'"/>
694 <t t-set="label" t-value="'Convert as an answer'"/>
695 <t t-set="karma" t-value="user.karma<required_karma and required_karma or 0"/>
696 <t t-set="classes" t-value="'fa-magic pull-right'"/>
698 <a t-attf-href="/forum/#{slug(forum)}/partner/#{message.author_id.id}"
699 t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
700 style="display: inline-block;"/>
701 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
704 <div class="css_editable_mode_hidden">
705 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
706 t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
707 <input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
708 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
709 <button type="submit" class="btn btn-primary mt8">Post</button>
717 <t t-call="website_forum.header">
721 <p class="text-muted">
722 A tag is a label that categorizes your question with other,
723 similar questions. Using the right tags makes it easier for
724 others to find and answer your question.
727 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
728 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
729 <span t-field="tag.name"/>
732 X <t t-esc="tag.posts_count"/>
739 <template id="badge">
740 <t t-call="website_forum.header">
745 Besides gaining reputation with your questions and answers,
746 you receive badges for being especially helpful. Badges
747 appear on your profile page, and your posts.
749 <table class="table mt32 mb64">
750 <tr t-foreach="badges" t-as="badge">
752 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
753 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
754 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
755 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
756 <span t-field="badge.name"/>
759 <b t-esc="badge.stat_count_distinct"/>
760 <i class="text-muted">awarded users</i>
762 <span t-field="badge.description"/>
769 <template id="badge_user">
770 <t t-call="website_forum.header">
771 <h3 class="mt32 mb32">
772 <b>Badge "<span t-field="badge.name"/>"</b>
775 <div class="pull-left badge">
776 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
777 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
778 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
779 <span t-field="badge.name"/>
781 <span t-field="badge.description" style="margin-left:20px"/>
784 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
785 <span t-if="badge.stat_count_distinct>1">users</span>
786 <span t-if="badge.stat_count_distinct<=1">user</span>
790 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
791 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
793 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
800 <template id="users">
801 <t t-call="website_forum.header">
802 <div t-foreach="users" t-as="row_users" class="row mt16">
803 <div t-foreach="row_users" t-as="user" class="col-sm-4">
804 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
806 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
807 <t t-if="user.country_id">
808 <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
810 <b><t t-esc="user.karma"/></b>
811 <t t-raw="separator"/>
814 <span class="fa fa-circle badge-gold"/>
815 <t t-esc="user.gold_badge"/>
816 <span class="fa fa-circle badge-silver"/>
817 <t t-esc="user.silver_badge"/>
818 <span class="fa fa-circle badge-bronze"/>
819 <t t-esc="user.bronze_badge"/>
825 <div class="pull-left">
826 <t t-call="website.pager"/>
831 <!--Private profile-->
832 <template id="private_profile">
833 <t t-call="website_forum.header">
834 <h1 class="mt32">This profile is private!</h1>
836 <a t-attf-href="/forum/#{slug(forum)}">Return to the question list.</a>
841 <template id="edit_profile">
842 <t t-call="website_forum.header">
843 <h3>Edit Profile</h3>
845 <div class="col-md-2">
846 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
848 <div class="col-md-10">
849 <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
850 <input name="user_id" t-att-value="user.id" type="hidden"/>
851 <div class="form-group">
852 <label class="col-md-2 control-label mb16" for="user_name">Real name</label>
853 <div class="col-md-8 mb16">
854 <input type="text" class="form-control" name="name" id="user_name" required="True" t-attf-value="#{user.name}"/>
857 <div class="form-group">
858 <label class="col-md-2 control-label mb16" for="user_website_published" t-if="user.id == uid">Public profile</label>
859 <div class="col-md-8 mb16" t-if="user.id == uid">
860 <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" t-if="not user.website_published"/>
861 <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" checked="checked" t-if="user.website_published"/>
864 <div class="form-group">
865 <label class="col-md-2 control-label mb16" for="user_website">Website</label>
866 <div class="col-md-8 mb16">
867 <input type="text" class="form-control" name="website" id="user_website" t-attf-value="#{user.partner_id.website or ''}"/>
870 <div class="form-group">
871 <div t-if="email_required" class="alert alert-danger alert-dismissable oe_forum_email_required">
872 <button type="button" class="close" data-dismiss="alert">x</button>
873 <p>Please enter a valid email address in order to receive notifications from answers or comments.</p>
875 <label class="col-md-2 control-label mb16" for="user_email">Email</label>
876 <div class="col-md-8 mb16">
877 <input type="text" class="form-control" name="email" id="user_email" required="True" t-attf-value="#{user.partner_id.email}"/>
880 <div class="form-group">
881 <label class="col-md-2 control-label mb16" for="user_city">City</label>
882 <div class="col-md-8 mb16">
883 <input type="text" class="form-control" name="city" id="user_city" t-attf-value="#{user.partner_id.city or ''}"/>
886 <div class="form-group">
887 <label class="col-md-2 control-label mb16">Country</label>
888 <div class="col-md-8 mb16">
889 <select class="form-control" name="country">
890 <option value="">Country...</option>
891 <t t-foreach="countries or []" t-as="country">
892 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country_id.id"><t t-esc="country.name"/></option>
897 <!--Note: using website_description fiels instead of using commnt firld of partner-->
898 <div class="form-group">
899 <label class="col-md-2 control-label mb16" for="description">Biography</label>
900 <div class="col-md-8 mb16">
901 <textarea name="description" id="description" style="min-height: 120px" required="True"
902 class="form-control load_editor"><t t-esc="user.partner_id.website_description"/></textarea>
905 <div class="col-sm-offset-2 col-md-2 mb16">
906 <button class="btn btn-primary btn-lg">Update</button>
911 <script type="text/javascript">
912 CKEDITOR.replace("description");
917 <template id="user_detail_full">
918 <t t-call="website_forum.header">
919 <h1 class="mt0 page-header">
920 <span t-field="user.name"/>
921 <small>profile</small>
922 <t t-call="website.publish_management" groups="base.group_website_publisher">
923 <t t-set="object" t-value="user"/>
927 <div class="col-sm-2">
928 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
930 <div class="col-sm-10">
931 <table class="table table-condensed">
933 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
934 <td>member since</td>
935 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
937 <td>last connection</td>
938 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
941 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
944 <a t-att-href="user.website" t-if="user.website">
945 <span t-field="user.website"/>
951 <span t-field="user.city"/>
952 <span t-if="user.city and user.country_id">, </span>
953 <span t-field="user.country_id"/>
954 <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
959 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
961 <td><span t-field="user.karma"/></td>
965 <span class="fa fa-thumbs-up"/>
966 <span t-esc="up_votes"/>
967 <span class="fa fa-thumbs-down"/>
968 <span t-esc="down_votes"/>
972 <div class="well well-sm">
973 <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
974 <t t-if="uid == user.id">
975 <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
981 <ul class="nav nav-tabs">
983 <a href="#questions" data-toggle="tab"><t t-esc="count_questions"/> Questions</a>
986 <a href="#answers" data-toggle="tab"><t t-esc="count_answers"/> Answers</a>
988 <li t-if="uid == user.id">
989 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
991 <li t-if="uid == user.id">
992 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
994 <li t-if="uid == user.id">
995 <a href="#activity" data-toggle="tab">Activity</a>
998 <a href="#badges" data-toggle="tab">Badges</a>
1000 <li t-if="uid == user.id">
1001 <a href="#votes" data-toggle="tab">Votes</a>
1004 <div class="tab-content mt16">
1005 <div class="tab-pane active" id="questions">
1006 <div class="mb16" t-foreach="questions" t-as="question">
1007 <t t-call="website_forum.display_post"/>
1009 </div><div class="tab-pane" id="answers">
1010 <div t-foreach="answers" t-as="answer">
1011 <t t-call="website_forum.display_post_answer"/>
1014 <div class="tab-pane" id="karma">
1017 <div class="tab-pane" id="badges">
1018 <t t-call="website_forum.user_badges"/>
1020 <div class="tab-pane" id="favourite_question" t-if="uid == user.id">
1021 <div t-foreach="favourite" t-as="question">
1022 <t t-call="website_forum.display_post"/>
1025 <div class="tab-pane" id="followed_question" t-if="uid == user.id">
1026 <div t-foreach="followed" t-as="question" class="mb16">
1027 <t t-call="website_forum.display_post"/>
1030 <div class="tab-pane" id="votes" t-if="uid == user.id">
1031 <t t-call="website_forum.user_votes"/>
1033 <div class="tab-pane" id="activity" t-if="uid == user.id">
1034 <ul class="list-unstyled">
1035 <li t-foreach="activities" t-as="activity">
1036 <span t-field="activity.date" t-field-options='{"format": "short"}'/>
1037 <span t-esc="activity.subtype_id.name" class="label label-info"/>
1038 <t t-set="post" t-value="posts[activity.res_id]"/>
1039 <span t-if="post[1]">
1040 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
1041 <span t-esc="post[0].name"/>
1044 <span t-if="not post[1]">
1045 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
1046 <span t-esc="post[0].name"/>
1056 <template id="user_badges">
1057 <table class="table mt32 mb64">
1058 <tr t-foreach="user.badge_ids" t-as="badge">
1060 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
1061 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
1062 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
1063 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
1064 <span t-field="badge.badge_id.name"/>
1067 <b t-esc="badge.badge_id.stat_count_distinct"/>
1068 <i class="text-muted">awarded users</i>
1070 <span t-field="badge.badge_id.description"/>
1074 <div class="mb16" t-if="not user.badge_ids">
1075 <b>No badge yet!</b><br/>
1076 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
1080 <template id="user_votes">
1081 <div t-foreach="vote_post" t-as="vote">
1082 <t t-esc="vote.post_id.create_date"/>
1083 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
1084 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
1085 <t t-if="vote.post_id.parent_id">
1086 <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"/>
1088 <t t-if="not vote.post_id.parent_id">
1089 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
1092 <div class="mb16" t-if="not vote_post">
1093 <b>No vote given by you yet!</b>
1097 <!-- User Navbar -->
1098 <template id="content_new_forum" inherit_id="website.user_navbar" groups="base.group_user">
1099 <xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
1100 <li><a href="#" data-action="new_forum">New Forum</a></li>