1 <?xml version="1.0" encoding="utf-8"?>
6 <template id="assets_editor" inherit_id="website.assets_editor" name="Forum Editor Assets">
7 <xpath expr="." position="inside">
8 <link rel='stylesheet' href="/website_forum/static/src/css/website_forum.css"/>
9 <script type="text/javascript" src="/website_forum/static/src/js/website.tour.forum.js"/>
10 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.editor.js"/>
14 <template id="assets_forum" name="Forum Assets">
15 <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
16 <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
18 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
19 <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
20 <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
21 <script type="text/javascript">
22 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
23 ,['Outdent','Indent','Link','Unlink','Image'],] ;
27 <!-- Layout add nav and footer -->
28 <template id="header_footer_custom" inherit_id="website.footer_default"
29 name="Footer Questions Link">
30 <xpath expr="//ul[@id='products']" position="inside">
31 <li><a t-attf-href="/forum/%(website_forum.forum_help)d">Q&A</a></li>
32 <li><a href="/forum">Forums</a></li>
37 <template id="link_button">
38 <form method="POST" t-att-action="url">
39 <button t-attf-class="fa btn-link #{classes} #{karma and 'karma_required text-muted' or ''}" t-attf-data-karma="#{karma}">
40 <t t-esc="label"/></button>
45 <template id="header" name="Forum Index">
46 <t t-call="website.layout">
48 <t t-call-assets="website_forum.assets_forum"/>
51 <div class="container mt16 website_forum">
52 <div class="navbar navbar-default">
53 <div class="navbar-header">
54 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
55 <span class="sr-only">Toggle navigation</span>
56 <span class="icon-bar"></span>
57 <!-- <span class="icon-bar"></span> -->
58 <span class="icon-bar"></span>
60 <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
61 <span t-field="forum.name"/>
64 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
65 <ul class="nav navbar-nav">
66 <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
67 <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
69 <li t-att-class="searches.get('users') and 'active' or '' ">
70 <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
72 <li t-att-class="searches.get('tags') and 'active' or '' ">
73 <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
75 <li t-att-class="searches.get('badges') and 'active' or '' ">
76 <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
78 <li t-if="not is_public_user" t-att-class="searches.get('my_profile') and 'active' or '' ">
79 <a t-attf-href="/forum/#{ slug(forum) }/user/#{uid}">My Profile</a>
82 <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
83 <div class="form-group">
84 <input type="search" class="form-control"
85 name="search" placeholder="Search a question..."
86 t-att-value="search or ''"/>
87 <button type="submit" class="btn btn-default">Search</button>
94 <div id="wrap" class="container">
96 <div class="col-sm-9">
97 <div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable">
98 <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
99 <div t-field="notification.body"/>
100 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }#badges" class="fa fa-arrow-right">View Your Badges</a>
104 <div class="col-sm-3" id="right-column">
105 <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>
106 <div class="panel panel-default">
107 <div class="panel-heading">
108 <h3 class="panel-title">Keep Informed</h3>
110 <div class="panel-body">
111 <t t-call="website_mail.follow">
112 <t t-set="email" t-value="user.email"/>
113 <t t-set="object" t-value="forum"/>
117 <div class="panel panel-default" id="about_forum">
118 <div class="panel-heading">
119 <h3 class="panel-title">About This Forum</h3>
121 <div class="panel-body">
122 <t t-raw="forum.description"/>
123 <a t-if="not header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
124 <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>
127 <div t-if="header.get('question_data')">
128 <div class="panel panel-default">
129 <div class="panel-heading text-center">
130 <h3 class="panel-title">Question tools</h3>
132 <div class="panel-body text-center">
133 <t t-call="website_mail.follow"><t t-set="object" t-value="question"/></t>
135 <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower(s)
138 <div class="panel-heading text-center">
139 <h3 class="panel-title ">Stats</h3>
141 <div class="panel-body">
142 <table class="table">
143 <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
144 <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
145 <span t-if="question.views>1">times</span>
146 <span t-if="question.views<=1">time</span>
148 <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
156 <div class="oe_structure"/>
160 <!-- Display a post -->
161 <template id="display_post">
162 <div class="question row">
163 <div class="col-md-2 hidden-xs text-center">
164 <div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
165 <span t-esc="question.child_count"/>
166 <div t-if="question.child_count>1" class="subtitle">Answers</div>
167 <div t-if="question.child_count<=1" class="subtitle">Answer</div>
170 <div class="col-md-10 clearfix">
171 <div class="question-name">
172 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
173 <span t-if="not question.active"><b> [Deleted]</b></span>
174 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
176 <t t-foreach="question.tag_ids" t-as="question_tag">
177 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{slug(question_tag)}/questions">
178 <span t-attf-class="pull-right badge #{tag and tag.name == question_tag.name and 'badge-active' ''}" t-field="question_tag.name"
179 style="margin-right: 4px;"/>
182 <div class="text-muted">
183 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
184 t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
185 style="display: inline-block;"/>
186 on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
187 <span class="visible-xs">
188 <b t-esc="question.child_count or 0"/>
189 <t t-if="question.child_count>1">answers</t>
190 <t t-if="question.child_count==1">answers</t>
192 with <b t-field="question.views"/> views
193 <span t-if="question.vote_count>0"> and
194 <b t-esc="question.vote_count or 0"/>
195 <t t-if="question.vote_count>1">votes</t>
196 <t t-if="question.vote_count==1">vote</t>
203 <!-- Display a post as an answer -->
204 <template id="display_post_answer">
205 <div class="clearfix">
206 <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
207 <div t-esc="len(answer.vote_ids)"/>
209 <div class="question-name" style="margin-left: 32px;">
210 <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"/>
211 <t t-if="len(answer.website_message_ids)>0">
212 (<t t-esc="len(answer.website_message_ids)"/>
213 <t t-if="len(answer.website_message_ids)>1">Comments</t>
214 <t t-if="len(answer.website_message_ids)<=1">Comment</t>)
222 <t t-call="website_forum.header">
223 <div t-field="forum.faq"/>
227 <!-- All Forums Layout -->
228 <template id="forum_all">
229 <t t-call="website.layout">
230 <div class="container">
231 <h1 class="mb32">Our forums</h1>
233 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
234 <a t-attf-href="/forum/#{ slug(forum) }">
235 <div class="fa fa-5x fa-comment mb16"/>
236 <div t-field="forum.name"/>
244 <!-- Specific Forum Layout -->
245 <template id="forum_index" name="Forum">
246 <t t-call="website_forum.header">
247 <h1 class="page-header mt0">
248 <t t-esc="question_count"/> <span>Questions</span>
250 <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
251 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
252 <t t-if="filters == 'all'">All</t>
253 <t t-if="filters == 'unanswered'">Unanswered</t>
254 <t t-if="filters == 'followed'">Followed</t>
255 <t t-if="tag"><span t-field="tag.name"/></t>
256 <t t-if="sorting == 'date'"> by activity date</t>
257 <t t-if="sorting == 'creation'"> by creation date</t>
258 <t t-if="sorting == 'answered'"> by most answered</t>
259 <t t-if="sorting == 'vote'"> by most voted</t>
262 <ul class="dropdown-menu">
263 <li class="dropdown-header">Filter on</li>
264 <li t-att-class="filters == 'all' and 'active' or '' ">
265 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
267 <li t-att-class="filters == 'unanswered' and 'active' or '' ">
268 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
270 <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
271 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
273 <li class="dropdown-header">Tags</li>
274 <li t-if="tag" t-att-class="tag and 'active' or '' ">
275 <a href=""><t t-esc="tag.name"/></a>
277 <li class="dropdown-header">Sort by</li>
278 <li t-att-class="sorting == 'date' and 'active' or '' ">
279 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
281 <li t-att-class="sorting == 'creation' and 'active' or '' ">
282 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='creation')">Newest</a>
284 <li t-att-class="sorting == 'answered' and 'active' or '' ">
285 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
287 <li t-att-class="sorting == 'vote' and 'active' or '' ">
288 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
293 <div t-foreach="question_ids" t-as="question" class="mb16">
294 <t t-call="website_forum.display_post"/>
296 <t t-call="website.pager"/>
301 <t t-call="website_forum.header">
302 <div class="oe_structure oe_empty"/>
303 <h1 class="mt32">Question not found!</h1>
304 <p>Sorry, this question is not available anymore.</p>
306 <a t-attf-href="/forum">Return to the question list.</a>
311 <!-- Edition: ask your question -->
312 <template id="ask_question">
313 <t t-call="website_forum.header">
314 <h1 class="mt0">Ask Your Question</h1>
316 To improve your chance getting an answer:
319 <li>Set a clear, explicit and concise question title
321 <a href="#" data-placement="top" data-toggle="popover" data-content="Inventory Date Problem, Task remaining hours, Can you help solve solve my tax computation problem in Canada?" title="Click to get bad question samples">bad examples</a>
323 <a href="#" data-placement="bottom" data-toggle="popover" data-content="How to create a physical inventory at an anterior date?, How is the 'remaining hours' field computed on tasks?, How to configure TPS and TVQ's canadian taxes?" title="Click to get good question titles">good examples</a>
326 <li>Avoid unnecessary introductions (Hi,... Please... Thanks...),</li>
327 <li>Provide enough details and, if possible, give an example.</li>
329 <script type="text/javascript">
331 $("[data-toggle='popover']").popover();
334 <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
335 <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
336 class="form-control mb16" placeholder="Your Question Title..."/>
337 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
338 <textarea name="content" required="True" class="form-control load_editor">
339 <t t-esc="question_content"/>
342 <input type="text" name="question_tags" placeholder="Tags" class="form-control load_tags"/>
344 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Question</button>
346 <script type="text/javascript">
347 CKEDITOR.replace("content");
352 <!-- Edition: edit a post -->
353 <template id="edit_post">
354 <t t-call="website_forum.header">
355 <h3 t-if="not is_answer">Edit question</h3>
356 <h3 t-if="is_answer">Edit answer</h3>
357 <form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
358 <div t-if="not is_answer">
359 <input type="text" name="question_name" id="question_name" required="True"
360 t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
361 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
363 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
364 <textarea name="content" required="True" class="form-control load_editor">
365 <t t-esc="post.content"/>
367 <div t-if="not is_answer">
369 <input type="text" name="question_tag" class="form-control col-md-9 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
372 <button class="btn btn-primary btn-lg">Save</button>
374 <script type="text/javascript">
375 CKEDITOR.replace("content");
380 <!-- Moderation: close a question -->
381 <template id="close_question">
382 <t t-call="website_forum.header">
383 <h1 class="mt0">Close question</h1>
384 <p class="text-muted">
385 If you close this question, it will be hidden for most users. Only
386 users having a high karma can see closed questions to moderate
389 <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
390 <input name="post_id" t-att-value="question.id" type="hidden"/>
391 <div class="form-group">
392 <label class="col-md-3 control-label" for="reason">Question:</label>
393 <div class="col-md-8 mt8">
394 <span t-field="question.name"/>
397 <div class="form-group">
398 <label class="col-md-3 control-label" for="reason">Reason:</label>
399 <div class="col-md-8">
400 <select class="form-control" name="reason_id">
401 <t t-foreach="reasons or []" t-as="reason">
402 <option t-att-value="reason.id" t-att-selected="reason.id == question.closed_reason_id.id"><t t-esc="reason.name"/></option>
407 <div class="form-group">
408 <div class="col-md-offset-3 col-md-8">
409 <button class="btn btn-primary">Close question</button>
410 <span class="text-muted">or</span>
411 <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">back to question</a>
418 <!-- Edition: post an answer -->
419 <template id="post_answer">
420 <h3 class="mt10">Your answer</h3>
422 <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
423 <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
424 - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
425 - it really helps to select the best questions and answers!
427 <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
428 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
429 <textarea name="content" class="form-control load_editor" required="True"/>
430 <button class="btn btn-primary mt16" id="btn_ask_your_question">Post Your Answer</button>
432 <script type="text/javascript">
433 CKEDITOR.replace("content");
438 <div t-attf-class="box oe_grey">
439 <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 ''}"
440 t-attf-data-karma="#{post.user_vote == 1 and post.karma_downvote or post.karma_upvote}"
441 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
442 <span id="vote_count" t-esc="post.vote_count"/>
443 <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 ''}"
444 t-attf-data-karma="#{post.user_vote == -1 and post.karma_upvote or post.karma_downvote}"
445 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
446 <div t-if="vote_count > 1" class="subtitle">
449 <div t-if="vote_count < 2" class="subtitle">
455 <!-- Specific Post Layout -->
456 <template id="post_description_full" name="Question Navigation">
457 <t t-call="website_forum.header">
458 <div t-attf-class="row question">
459 <div class="col-md-2 hidden-xs text-center">
460 <t t-call="website_forum.vote">
461 <t t-set="post" t-value="question"/>
463 <div class="text-muted text-center">
464 <span t-field="question.views"/> Views
467 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
468 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
471 <div t-attf-class="col-md-10 #{not question.active and 'alert alert-danger' or ''}">
473 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
474 <span t-if="not question.active"><b> [Deleted]</b></span>
475 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
477 <div class="alert alert-info text-center" t-if="question.state == 'close'">
479 <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>
481 <t t-if="question.closed_uid">
482 <b>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.closed_uid.id }"
483 t-field="question.closed_uid"
484 t-field-options='{"widget": "contact", "fields": ["name"]}'
485 style="display: inline-block;"/></b>
487 <b>on <span t-field="question.closed_date"/></b>
488 <div class="mt16 mb24 text-center">
489 <t t-call="website_forum.link_button">
490 <t t-set="url" t-value="'/forum/' + slug(forum) + '/question/' + slug(question) + '/reopen'"/>
491 <t t-set="label" t-value="'Reopen'"/>
492 <t t-set="classes" t-value="'fa-arrow-right'"/>
493 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
497 <t t-raw="question.content"/>
498 <div class="mt16 clearfix">
499 <div class="pull-right">
500 <div class="text-right">
501 <t t-foreach="question.tag_ids" t-as="tag">
502 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
505 <ul class="list-inline" id="options">
507 <a style="cursor: pointer" data-toggle="collapse"
508 t-attf-class="fa fa-comment-o #{not question.can_comment and 'karma_required text-muted' or ''}"
509 t-attf-data-karma="#{not question.can_comment and question.karma_comment or 0}"
510 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
514 <li t-if="question.state != 'close'">
515 <t t-call="website_forum.link_button">
516 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/ask_for_close'"/>
517 <t t-set="label" t-value="'Close'"/>
518 <t t-set="classes" t-value="'fa-times'"/>
519 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
522 <li t-if="question.state == 'close'">
523 <t t-call="website_forum.link_button">
524 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/reopen'"/>
525 <t t-set="label" t-value="'Reopen'"/>
526 <t t-set="classes" t-value="'fa-undo'"/>
527 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
531 <t t-call="website_forum.link_button">
532 <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/edit'"/>
533 <t t-set="label" t-value="'Edit'"/>
534 <t t-set="classes" t-value="'fa-edit'"/>
535 <t t-set="karma" t-value="not question.can_edit and question.karma_edit or 0"/>
538 <li t-if="question.active">
539 <t t-call="website_forum.link_button">
540 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/delete'"/>
541 <t t-set="label" t-value="'Delete'"/>
542 <t t-set="classes" t-value="'fa-trash-o'"/>
543 <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
546 <li t-if="not question.active">
547 <t t-call="website_forum.link_button">
548 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/undelete'"/>
549 <t t-set="label" t-value="'Undelete'"/>
550 <t t-set="classes" t-value="'fa-trash-o'"/>
551 <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
557 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{question.create_uid.id}/avatar"/>
559 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
560 t-field="question.create_uid"
561 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
562 style="display: inline-block;"/>
563 <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
564 <span class="text-muted">Asked on <span t-field="question.create_date" t-field-options='{"format":"short"}'/></span>
567 <div class="visible-xs text-center">
568 <t t-call="website_forum.vote">
569 <t t-set="post" t-value="question"/>
571 <div class="text-muted text-center">
572 <span t-field="question.views"/> Views
575 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
576 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
580 <t t-call="website_forum.post_comment">
581 <t t-set="object" t-value="question"/>
587 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
588 <a t-attf-id="answer-#{str(answer.id)}"/>
589 <div t-attf-class="forum_answer row" t-attf-id="answer_#{answer.id}" >
590 <div class="col-md-2 hidden-xs text-center">
591 <t t-call="website_forum.vote">
592 <t t-set="post" t-value="answer"/>
594 <div class="text-muted mt8">
595 <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 ''}"
596 t-attf-data-karma="#{answer.karma_accept}"
597 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
600 <div class="col-md-10 clearfix">
601 <t t-raw="answer.content"/>
603 <ul class="list-inline pull-right">
605 <a t-attf-class="fa fa-comment-o #{not answer.can_comment and 'karma_required text-muted' or ''}"
606 t-attf-data-karma="#{not answer.can_comment and answer.karma_comment or 0}"
607 style="cursor: pointer" data-toggle="collapse"
608 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
612 <t t-call="website_forum.link_button">
613 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/edit'"/>
614 <t t-set="label" t-value="'Edit'"/>
615 <t t-set="classes" t-value="'fa fa-edit'"/>
616 <t t-set="karma" t-value="not answer.can_edit and answer.karma_edit or 0"/>
620 <t t-call="website_forum.link_button">
621 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/delete'"/>
622 <t t-set="label" t-value="'Delete'"/>
623 <t t-set="classes" t-value="'fa-trash-o'"/>
624 <t t-set="karma" t-value="not answer.can_unlink and answer.karma_unlink or 0"/>
628 <t t-call="website_forum.link_button">
629 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/convert_to_comment'"/>
630 <t t-set="label" t-value="'Convert as a comment'"/>
631 <t t-set="classes" t-value="'fa-magic'"/>
632 <t t-set="karma" t-value="not answer.can_comment_convert and answer.karma_comment_convert or 0"/>
636 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{answer.create_uid.id}/avatar"/>
638 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ answer.create_uid.id }"
639 t-field="answer.create_uid"
640 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
641 style="display: inline-block;"/>
642 <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
643 <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
645 <div class="visible-xs text-center">
646 <t t-call="website_forum.vote">
647 <t t-set="post" t-value="answer"/>
649 <div class="text-muted mt8">
650 <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 ''}"
651 t-attf-data-karma="#{answer.karma_accept}"
652 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
656 <t t-call="website_forum.post_comment">
657 <t t-set="object" t-value="answer"/>
662 <div t-if="not question.uid_has_answered and question.state != 'close' and question.active != False">
663 <t t-call="website_forum.post_answer"/>
665 <div t-if="question.uid_has_answered" class="mb16">
666 <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
667 <span class="text-muted">(only one answer per question is allowed)</span>
672 <!-- Utility template: Post a Comment -->
673 <template id="post_comment">
674 <div class="row clearfix">
675 <div class="col-sm-10 col-sm-offset-2">
676 <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
677 <small class="text-muted">
678 <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"/>
679 <t t-call="website_forum.link_button">
680 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/delete'"/>
681 <t t-set="label" t-value="' '"/>
682 <t t-set="karma" t-value="user.karma<required_karma and required_karma or 0"/>
683 <t t-set="classes" t-value="'close comment_delete fa-times'"/>
686 <span t-field="message.body"/>
687 <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"/>
688 <t t-if="(object.parent_id and object.parent_id.state != 'close' and object.parent_id.active != False) or (not object.parent_id and object.state != 'close' and object.active != False)">
689 <t t-set="allow_post_comment" t-value="True" />
691 <t t-if="allow_post_comment">
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'"/>
699 <a t-attf-href="/forum/#{slug(forum)}/partner/#{message.author_id.id}"
700 t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
701 style="display: inline-block;"/>
702 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
705 <div class="css_editable_mode_hidden">
706 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
707 t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
708 <input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
709 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
710 <button type="submit" class="btn btn-primary mt8">Post</button>
718 <t t-call="website_forum.header">
722 <p class="text-muted">
723 A tag is a label that categorizes your question with other,
724 similar questions. Using the right tags makes it easier for
725 others to find and answer your question.
728 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
729 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
730 <span t-field="tag.name"/>
733 X <t t-esc="tag.posts_count"/>
740 <template id="badge">
741 <t t-call="website_forum.header">
746 Besides gaining reputation with your questions and answers,
747 you receive badges for being especially helpful. Badges
748 appear on your profile page, and your posts.
750 <table class="table mt32 mb64">
751 <tr t-foreach="badges" t-as="badge">
753 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
754 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
755 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
756 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
757 <span t-field="badge.name"/>
760 <b t-esc="badge.stat_count_distinct"/>
761 <i class="text-muted">awarded users</i>
763 <span t-field="badge.description"/>
770 <template id="badge_user">
771 <t t-call="website_forum.header">
772 <h3 class="mt32 mb32">
773 <b>Badge "<span t-field="badge.name"/>"</b>
776 <div class="pull-left badge">
777 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
778 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
779 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
780 <span t-field="badge.name"/>
782 <span t-field="badge.description" style="margin-left:20px"/>
785 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
786 <span t-if="badge.stat_count_distinct>1">users</span>
787 <span t-if="badge.stat_count_distinct<=1">user</span>
791 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
792 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
794 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
801 <template id="users">
802 <t t-call="website_forum.header">
803 <div t-foreach="users" t-as="row_users" class="row mt16">
804 <div t-foreach="row_users" t-as="user" class="col-sm-4">
805 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
807 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
808 <t t-if="user.country_id">
809 <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
811 <b><t t-esc="user.karma"/></b>
812 <t t-raw="separator"/>
815 <span class="fa fa-circle badge-gold"/>
816 <t t-esc="user.gold_badge"/>
817 <span class="fa fa-circle badge-silver"/>
818 <t t-esc="user.silver_badge"/>
819 <span class="fa fa-circle badge-bronze"/>
820 <t t-esc="user.bronze_badge"/>
826 <div class="pull-left">
827 <t t-call="website.pager"/>
832 <!--Private profile-->
833 <template id="private_profile">
834 <t t-call="website_forum.header">
835 <h1 class="mt32">This profile is private!</h1>
837 <a t-attf-href="/forum/#{slug(forum)}">Return to the question list.</a>
842 <template id="edit_profile">
843 <t t-call="website_forum.header">
844 <h3>Edit Profile</h3>
846 <div class="col-md-2">
847 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
849 <div class="col-md-10">
850 <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
851 <input name="user_id" t-att-value="user.id" type="hidden"/>
852 <div class="form-group">
853 <label class="col-md-2 control-label mb16" for="user_name">Real name</label>
854 <div class="col-md-8 mb16">
855 <input type="text" class="form-control" name="name" id="user_name" required="True" t-attf-value="#{user.name}"/>
858 <div class="form-group">
859 <label class="col-md-2 control-label mb16" for="user_website_published" t-if="user.id == uid">Public profile</label>
860 <div class="col-md-8 mb16" t-if="user.id == uid">
861 <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" t-if="not user.website_published"/>
862 <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" checked="checked" t-if="user.website_published"/>
865 <div class="form-group">
866 <label class="col-md-2 control-label mb16" for="user_website">Website</label>
867 <div class="col-md-8 mb16">
868 <input type="text" class="form-control" name="website" id="user_website" t-attf-value="#{user.partner_id.website or ''}"/>
871 <div class="form-group">
872 <div t-if="email_required" class="alert alert-danger alert-dismissable oe_forum_email_required">
873 <button type="button" class="close" data-dismiss="alert">x</button>
874 <p>Please enter a valid email address in order to receive notifications from answers or comments.</p>
876 <label class="col-md-2 control-label mb16" for="user_email">Email</label>
877 <div class="col-md-8 mb16">
878 <input type="text" class="form-control" name="email" id="user_email" required="True" t-attf-value="#{user.partner_id.email}"/>
881 <div class="form-group">
882 <label class="col-md-2 control-label mb16" for="user_city">City</label>
883 <div class="col-md-8 mb16">
884 <input type="text" class="form-control" name="city" id="user_city" t-attf-value="#{user.partner_id.city or ''}"/>
887 <div class="form-group">
888 <label class="col-md-2 control-label mb16">Country</label>
889 <div class="col-md-8 mb16">
890 <select class="form-control" name="country">
891 <option value="">Country...</option>
892 <t t-foreach="countries or []" t-as="country">
893 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country_id.id"><t t-esc="country.name"/></option>
898 <!--Note: using website_description fiels instead of using commnt firld of partner-->
899 <div class="form-group">
900 <label class="col-md-2 control-label mb16" for="description">Biography</label>
901 <div class="col-md-8 mb16">
902 <textarea name="description" id="description" style="min-height: 120px" required="True"
903 class="form-control load_editor"><t t-esc="user.partner_id.website_description"/></textarea>
906 <div class="col-sm-offset-2 col-md-2 mb16">
907 <button class="btn btn-primary btn-lg">Update</button>
912 <script type="text/javascript">
913 CKEDITOR.replace("description");
918 <template id="user_detail_full">
919 <t t-call="website_forum.header">
920 <h1 class="mt0 page-header">
921 <span t-field="user.name"/>
922 <small>profile</small>
923 <t t-call="website.publish_management" groups="base.group_website_publisher">
924 <t t-set="object" t-value="user"/>
928 <div class="col-sm-2">
929 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
931 <div class="col-sm-10">
932 <table class="table table-condensed">
934 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
935 <td>member since</td>
936 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
938 <td>last connection</td>
939 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
942 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
945 <a t-att-href="user.website" t-if="user.website">
946 <span t-field="user.website"/>
952 <span t-field="user.city"/>
953 <span t-if="user.city and user.country_id">, </span>
954 <span t-field="user.country_id"/>
955 <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
960 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
962 <td><span t-field="user.karma"/></td>
966 <span class="fa fa-thumbs-up"/>
967 <span t-esc="up_votes"/>
968 <span class="fa fa-thumbs-down"/>
969 <span t-esc="down_votes"/>
973 <div class="well well-sm">
974 <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
975 <t t-if="uid == user.id">
976 <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
982 <ul class="nav nav-tabs">
984 <a href="#questions" data-toggle="tab"><t t-esc="count_questions"/> Questions</a>
987 <a href="#answers" data-toggle="tab"><t t-esc="count_answers"/> Answers</a>
989 <li t-if="uid == user.id">
990 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
992 <li t-if="uid == user.id">
993 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
995 <li t-if="uid == user.id">
996 <a href="#activity" data-toggle="tab">Activity</a>
999 <a href="#badges" data-toggle="tab">Badges</a>
1001 <li t-if="uid == user.id">
1002 <a href="#votes" data-toggle="tab">Votes</a>
1005 <div class="tab-content mt16">
1006 <div class="tab-pane active" id="questions">
1007 <div class="mb16" t-foreach="questions" t-as="question">
1008 <t t-call="website_forum.display_post"/>
1010 </div><div class="tab-pane" id="answers">
1011 <div t-foreach="answers" t-as="answer">
1012 <t t-call="website_forum.display_post_answer"/>
1015 <div class="tab-pane" id="karma">
1018 <div class="tab-pane" id="badges">
1019 <t t-call="website_forum.user_badges"/>
1021 <div class="tab-pane" id="favourite_question" t-if="uid == user.id">
1022 <div t-foreach="favourite" t-as="question">
1023 <t t-call="website_forum.display_post"/>
1026 <div class="tab-pane" id="followed_question" t-if="uid == user.id">
1027 <div t-foreach="followed" t-as="question" class="mb16">
1028 <t t-call="website_forum.display_post"/>
1031 <div class="tab-pane" id="votes" t-if="uid == user.id">
1032 <t t-call="website_forum.user_votes"/>
1034 <div class="tab-pane" id="activity" t-if="uid == user.id">
1035 <ul class="list-unstyled">
1036 <li t-foreach="activities" t-as="activity">
1037 <span t-field="activity.date" t-field-options='{"format": "short"}'/>
1038 <span t-esc="activity.subtype_id.name" class="label label-info"/>
1039 <t t-set="post" t-value="posts[activity.res_id]"/>
1040 <span t-if="post[1]">
1041 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
1042 <span t-esc="post[0].name"/>
1045 <span t-if="not post[1]">
1046 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
1047 <span t-esc="post[0].name"/>
1057 <template id="user_badges">
1058 <table class="table mt32 mb64">
1059 <tr t-foreach="user.badge_ids" t-as="badge">
1061 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
1062 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
1063 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
1064 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
1065 <span t-field="badge.badge_id.name"/>
1068 <b t-esc="badge.badge_id.stat_count_distinct"/>
1069 <i class="text-muted">awarded users</i>
1071 <span t-field="badge.badge_id.description"/>
1075 <div class="mb16" t-if="not user.badge_ids">
1076 <b>No badge yet!</b><br/>
1077 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
1081 <template id="user_votes">
1082 <div t-foreach="vote_post" t-as="vote">
1083 <t t-esc="vote.post_id.create_date"/>
1084 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
1085 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
1086 <t t-if="vote.post_id.parent_id">
1087 <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"/>
1089 <t t-if="not vote.post_id.parent_id">
1090 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
1093 <div class="mb16" t-if="not vote_post">
1094 <b>No vote given by you yet!</b>
1098 <!-- User Navbar -->
1099 <template id="content_new_forum" inherit_id="website.user_navbar" groups="base.group_user">
1100 <xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
1101 <li><a href="#" data-action="new_forum">New Forum</a></li>