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="/web/static/lib/jquery.textext/jquery.textext.js"/>
27 <script type="text/javascript" src="/web/static/lib/select2/select2.js"></script>
28 <link rel="stylesheet" href="/web/static/lib/select2/select2.css"/>
29 <link rel="stylesheet" href="/website/static/lib/select2-bootstrap-css/select2-bootstrap.css"/>
30 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
34 <template id="assets_editor" inherit_id="website.assets_editor" name="Forum Editor" groups="base.group_user">
35 <xpath expr="." position="inside">
36 <script type="text/javascript" src="/website_forum/static/src/js/website.tour.forum.js"/>
37 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.editor.js"/>
42 <template id="header" name="Forum Index">
43 <t t-call="website.layout">
45 <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
46 <script type="text/javascript">
47 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
48 ,['Outdent','Indent','Link','Unlink','Image'],] ;
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>
102 <div t-if="not validation_email_sent and not is_public_user and user.karma == 0" class="alert alert-danger alert-dismissable">
103 <button type="button" class="close validation_email_close" data-dismiss="alert" aria-hidden="true">&times;</button>
106 It appears your email has not been verified.
107 <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>
111 <div t-if="validation_email_done" class="alert alert-success alert-dismissable">
112 <button type="button" class="close validated_email_close" data-dismiss="alert" aria-hidden="true">&times;</button>
114 <p>Congratulations! Your email has just been validated. You may now participate to our forums.</p>
119 <div class="col-sm-3" id="right-column">
120 <a t-if="not header.get('ask_hide')"
121 t-attf-class="btn btn-primary btn-lg btn-block mb16 #{(user.karma < forum.karma_ask) and 'karma_required' or ''}"
122 t-attf-href="/forum/#{slug(forum)}/ask"
123 t-attf-data-karma="#{forum.karma_ask}">Ask a Question</a>
124 <div class="panel panel-default">
125 <div class="panel-heading">
126 <h3 class="panel-title">Keep Informed</h3>
128 <div class="panel-body">
129 <t t-call="website_mail.follow">
130 <t t-set="email" t-value="user.email"/>
131 <t t-set="object" t-value="forum"/>
135 <div class="panel panel-default" id="about_forum">
136 <div class="panel-heading">
137 <h3 class="panel-title">About This Forum</h3>
139 <div class="panel-body">
140 <t t-raw="forum.description"/>
141 <a t-if="not header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
142 <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>
145 <div t-if="header.get('question_data')">
146 <div class="panel panel-default">
147 <div class="panel-heading text-center">
148 <h3 class="panel-title">Question tools</h3>
150 <div class="panel-body text-center">
151 <t t-call="website_mail.follow"><t t-set="object" t-value="question"/></t>
153 <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower(s)
156 <div class="panel-heading text-center">
157 <h3 class="panel-title ">Stats</h3>
159 <div class="panel-body">
160 <table class="table">
161 <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
162 <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
163 <span t-if="question.views>1">times</span>
164 <span t-if="question.views<=1">time</span>
166 <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
174 <div class="oe_structure"/>
178 <!-- Display a post -->
179 <template id="display_post">
180 <div class="question row">
181 <div class="col-md-2 hidden-xs text-center">
182 <div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
183 <span t-esc="question.child_count"/>
184 <div t-if="question.child_count>1" class="subtitle">Answers</div>
185 <div t-if="question.child_count<=1" class="subtitle">Answer</div>
188 <div class="col-md-10 clearfix">
189 <div class="question-name">
190 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
191 <span t-if="not question.active"><b> [Deleted]</b></span>
192 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
194 <t t-foreach="question.tag_ids" t-as="question_tag">
195 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{slug(question_tag)}/questions">
196 <span t-attf-class="pull-right badge #{tag and tag.name == question_tag.name and 'badge-active' ''}" t-field="question_tag.name"
197 style="margin-right: 4px;"/>
200 <div class="text-muted">
201 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
202 t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
203 style="display: inline-block;"/>
204 on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
205 <span class="visible-xs">
206 <b t-esc="question.child_count or 0"/>
207 <t t-if="question.child_count>1">answers</t>
208 <t t-if="question.child_count==1">answers</t>
210 with <b t-field="question.views"/> views
211 <span t-if="question.vote_count>0"> and
212 <b t-esc="question.vote_count or 0"/>
213 <t t-if="question.vote_count>1">votes</t>
214 <t t-if="question.vote_count==1">vote</t>
221 <!-- Display a post as an answer -->
222 <template id="display_post_answer">
223 <div class="clearfix">
224 <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
225 <div t-esc="len(answer.vote_ids)"/>
227 <div class="question-name" style="margin-left: 32px;">
228 <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"/>
229 <t t-if="len(answer.website_message_ids)>0">
230 (<t t-esc="len(answer.website_message_ids)"/>
231 <t t-if="len(answer.website_message_ids)>1">Comments</t>
232 <t t-if="len(answer.website_message_ids)<=1">Comment</t>)
240 <t t-call="website_forum.header">
241 <div t-field="forum.faq"/>
245 <!-- All Forums Layout -->
246 <template id="forum_all">
247 <t t-call="website.layout">
248 <div class="container">
249 <h1 class="mb32">Our forums</h1>
251 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
252 <a t-attf-href="/forum/#{ slug(forum) }">
253 <div class="fa fa-5x fa-comment mb16"/>
254 <div t-field="forum.name"/>
262 <!-- Specific Forum Layout -->
263 <template id="forum_index" name="Forum">
264 <t t-call="website_forum.header">
265 <h1 class="page-header mt0">
266 <t t-esc="question_count"/> <span>Questions</span>
268 <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
269 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
270 <t t-if="filters == 'all'">All</t>
271 <t t-if="filters == 'unanswered'">Unanswered</t>
272 <t t-if="filters == 'followed'">Followed</t>
273 <t t-if="tag"><span t-field="tag.name"/></t>
274 <t t-if="sorting == 'date'"> by activity date</t>
275 <t t-if="sorting == 'creation'"> by creation date</t>
276 <t t-if="sorting == 'answered'"> by most answered</t>
277 <t t-if="sorting == 'vote'"> by most voted</t>
280 <ul class="dropdown-menu">
281 <li class="dropdown-header">Filter on</li>
282 <li t-att-class="filters == 'all' and 'active' or '' ">
283 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
285 <li t-att-class="filters == 'unanswered' and 'active' or '' ">
286 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
288 <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
289 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
291 <li class="dropdown-header">Tags</li>
292 <li t-if="tag" t-att-class="tag and 'active' or '' ">
293 <a href=""><t t-esc="tag.name"/></a>
295 <li class="dropdown-header">Sort by</li>
296 <li t-att-class="sorting == 'date' and 'active' or '' ">
297 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
299 <li t-att-class="sorting == 'creation' and 'active' or '' ">
300 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='creation')">Newest</a>
302 <li t-att-class="sorting == 'answered' and 'active' or '' ">
303 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
305 <li t-att-class="sorting == 'vote' and 'active' or '' ">
306 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
311 <div t-foreach="question_ids" t-as="question" class="mb16">
312 <t t-call="website_forum.display_post"/>
314 <t t-call="website.pager"/>
319 <t t-call="website_forum.header">
320 <div class="oe_structure oe_empty"/>
321 <h1 class="mt32">Question not found!</h1>
322 <p>Sorry, this question is not available anymore.</p>
324 <a t-attf-href="/forum">Return to the question list.</a>
329 <!-- Edition: ask your question -->
330 <template id="ask_question">
331 <t t-call="website_forum.header">
332 <h1 class="mt0">Ask your Question</h1>
334 <li> please, try to make your question interesting to others </li>
335 <li> provide enough details and, if possible, give an example </li>
336 <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
338 <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
339 <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
340 class="form-control" placeholder="Enter your Question"/>
341 <h5 class="mt20">Please enter a descriptive question (should finish with a '?')</h5>
342 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
343 <input type="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/>
344 <textarea name="content" required="True" class="form-control load_editor">
345 <t t-esc="question_content"/>
348 <input type="hidden" name="tag_type" value="select2"/>
349 <input type="hidden" name="question_tags" placeholder="Tags" class="form-control js_select2"/>
351 <button t-attf-class="btn btn-primary #{(user.karma < forum.karma_ask) and 'karma_required' or ''}"
352 id="btn_ask_your_question" t-att-data-karma="forum.karma_ask">Post Your Question</button>
354 <script type="text/javascript">
355 CKEDITOR.replace("content");
360 <!-- Edition: edit a post -->
361 <template id="edit_post">
362 <t t-call="website_forum.header">
363 <h3 t-if="not is_answer">Edit question</h3>
364 <h3 t-if="is_answer">Edit answer</h3>
365 <form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
366 <div t-if="not is_answer">
367 <input type="text" name="question_name" id="question_name" required="True"
368 t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
369 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
371 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
372 <input type="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/>
373 <textarea name="content" required="True" class="form-control load_editor">
374 <t t-esc="post.content"/>
376 <div t-if="not is_answer">
378 <input type="hidden" name="tag_type" value="select2"/>
379 <input type="hidden" name="question_tag" class="form-control col-md-9 js_select2" placeholder="Tags" value="see data init value" t-attf-data-init-value="#{tags}"/>
382 <button class="btn btn-primary btn-lg">Save</button>
384 <script type="text/javascript">
385 CKEDITOR.replace("content");
390 <!-- Moderation: close a question -->
391 <template id="close_question">
392 <t t-call="website_forum.header">
393 <h1 class="mt0">Close question</h1>
394 <p class="text-muted">
395 If you close this question, it will be hidden for most users. Only
396 users having a high karma can see closed questions to moderate
399 <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
400 <input name="post_id" t-att-value="question.id" type="hidden"/>
401 <div class="form-group">
402 <label class="col-md-3 control-label" for="reason">Question:</label>
403 <div class="col-md-8 mt8">
404 <span t-field="question.name"/>
407 <div class="form-group">
408 <label class="col-md-3 control-label" for="reason">Reason:</label>
409 <div class="col-md-8">
410 <select class="form-control" name="reason_id">
411 <t t-foreach="reasons or []" t-as="reason">
412 <option t-att-value="reason.id" t-att-selected="reason.id == question.closed_reason_id.id"><t t-esc="reason.name"/></option>
417 <div class="form-group">
418 <div class="col-md-offset-3 col-md-8">
419 <button class="btn btn-primary">Close question</button>
420 <span class="text-muted">or</span>
421 <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">back to question</a>
428 <!-- Edition: post an answer -->
429 <template id="post_answer">
430 <h3 class="mt10">Your answer</h3>
432 <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
433 <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
434 - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
435 - it really helps to select the best questions and answers!
437 <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
438 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
439 <textarea name="content" class="form-control load_editor" required="True"/>
440 <button t-attf-class="btn btn-primary mt16 #{not question.can_answer and 'karma_required' or ''}"
441 id="btn_ask_your_question" t-att-data-karma="question.karma_answer">Post Your Answer</button>
443 <script type="text/javascript">
444 CKEDITOR.replace("content");
449 <div t-attf-class="box oe_grey">
450 <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 ''}"
451 t-attf-data-karma="#{post.user_vote == 1 and post.karma_downvote or post.karma_upvote}"
452 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
453 <span id="vote_count" t-esc="post.vote_count"/>
454 <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 ''}"
455 t-attf-data-karma="#{post.user_vote == -1 and post.karma_upvote or post.karma_downvote}"
456 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
457 <div t-if="vote_count > 1" class="subtitle">
460 <div t-if="vote_count < 2" class="subtitle">
466 <!-- Specific Post Layout -->
467 <template id="post_description_full" name="Question Navigation">
468 <t t-call="website_forum.header">
469 <div t-attf-class="row question #{not question.active and 'alert alert-danger' or ''}">
470 <div class="col-md-2 hidden-xs text-center">
471 <t t-call="website_forum.vote">
472 <t t-set="post" t-value="question"/>
474 <div class="text-muted text-center">
475 <span t-field="question.views"/> Views
478 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
479 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
482 <div class="col-md-10">
484 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
485 <span t-if="not question.active"><b> [Deleted]</b></span>
486 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
488 <div class="alert alert-info text-center" t-if="question.state == 'close'">
490 <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>
492 <t t-if="question.closed_uid">
493 <b>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.closed_uid.id }"
494 t-field="question.closed_uid"
495 t-field-options='{"widget": "contact", "fields": ["name"]}'
496 style="display: inline-block;"/></b>
498 <b>on <span t-field="question.closed_date"/></b>
499 <div class="mt16 mb24 text-center">
500 <t t-call="website_forum.link_button">
501 <t t-set="url" t-value="'/forum/' + slug(forum) + '/question/' + slug(question) + '/reopen'"/>
502 <t t-set="label" t-value="'Reopen'"/>
503 <t t-set="classes" t-value="'fa-arrow-right'"/>
504 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
508 <t t-raw="question.content"/>
509 <div class="mt16 clearfix">
510 <div class="pull-right">
511 <div class="text-right">
512 <t t-foreach="question.tag_ids" t-as="tag">
513 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
516 <ul class="list-inline" id="options">
518 <a style="cursor: pointer" t-att-data-toggle="question.can_comment and 'collapse' or ''"
519 t-attf-class="fa fa-comment-o #{not question.can_comment and 'karma_required text-muted' or ''}"
520 t-attf-data-karma="#{not question.can_comment and question.karma_comment or 0}"
521 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
525 <li t-if="question.state != 'close'">
526 <t t-call="website_forum.link_button">
527 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/ask_for_close'"/>
528 <t t-set="label" t-value="'Close'"/>
529 <t t-set="classes" t-value="'fa-times'"/>
530 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
533 <li t-if="question.state == 'close'">
534 <t t-call="website_forum.link_button">
535 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/reopen'"/>
536 <t t-set="label" t-value="'Reopen'"/>
537 <t t-set="classes" t-value="'fa-undo'"/>
538 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
542 <t t-call="website_forum.link_button">
543 <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/edition'"/>
544 <t t-set="label" t-value="'Edit'"/>
545 <t t-set="classes" t-value="'fa-edit'"/>
546 <t t-set="karma" t-value="not question.can_edit and question.karma_edit or 0"/>
549 <li t-if="question.active">
550 <t t-call="website_forum.link_button">
551 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/delete'"/>
552 <t t-set="label" t-value="'Delete'"/>
553 <t t-set="classes" t-value="'fa-trash-o'"/>
554 <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
557 <li t-if="not question.active">
558 <t t-call="website_forum.link_button">
559 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/undelete'"/>
560 <t t-set="label" t-value="'Undelete'"/>
561 <t t-set="classes" t-value="'fa-trash-o'"/>
562 <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
568 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{question.create_uid.id}/avatar"/>
570 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
571 t-field="question.create_uid"
572 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
573 style="display: inline-block;"/>
574 <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
575 <span class="text-muted">Asked on <span t-field="question.create_date" t-field-options='{"format":"short"}'/></span>
578 <div class="visible-xs text-center">
579 <t t-call="website_forum.vote">
580 <t t-set="post" t-value="question"/>
582 <div class="text-muted text-center">
583 <span t-field="question.views"/> Views
586 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
587 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
591 <t t-call="website_forum.post_comment">
592 <t t-set="object" t-value="question"/>
598 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
599 <a t-attf-id="answer-#{str(answer.id)}"/>
600 <div t-attf-class="forum_answer row" t-attf-id="answer_#{answer.id}" >
601 <div class="col-md-2 hidden-xs text-center">
602 <t t-call="website_forum.vote">
603 <t t-set="post" t-value="answer"/>
605 <div class="text-muted mt8">
606 <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 ''}"
607 t-attf-data-karma="#{answer.karma_accept}"
608 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
611 <div class="col-md-10 clearfix">
612 <t t-raw="answer.content"/>
614 <ul class="list-inline pull-right">
616 <a t-attf-class="fa fa-comment-o #{not answer.can_comment and 'karma_required text-muted' or ''}"
617 t-attf-data-karma="#{not answer.can_comment and answer.karma_comment or 0}"
618 style="cursor: pointer" t-att-data-toggle="answer.can_comment and 'collapse' or ''"
619 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
623 <t t-call="website_forum.link_button">
624 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/edit'"/>
625 <t t-set="label" t-value="'Edit'"/>
626 <t t-set="classes" t-value="'fa fa-edit'"/>
627 <t t-set="karma" t-value="not answer.can_edit and answer.karma_edit or 0"/>
631 <t t-call="website_forum.link_button">
632 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/delete'"/>
633 <t t-set="label" t-value="'Delete'"/>
634 <t t-set="classes" t-value="'fa-trash-o'"/>
635 <t t-set="karma" t-value="not answer.can_unlink and answer.karma_unlink or 0"/>
639 <t t-call="website_forum.link_button">
640 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/convert_to_comment'"/>
641 <t t-set="label" t-value="'Convert as a comment'"/>
642 <t t-set="classes" t-value="'fa-magic'"/>
643 <t t-set="karma" t-value="not answer.can_comment_convert and answer.karma_comment_convert or 0"/>
647 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{answer.create_uid.id}/avatar"/>
649 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ answer.create_uid.id }"
650 t-field="answer.create_uid"
651 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
652 style="display: inline-block;"/>
653 <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
654 <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
656 <div class="visible-xs text-center">
657 <t t-call="website_forum.vote">
658 <t t-set="post" t-value="answer"/>
660 <div class="text-muted mt8">
661 <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 ''}"
662 t-attf-data-karma="#{answer.karma_accept}"
663 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
667 <t t-call="website_forum.post_comment">
668 <t t-set="object" t-value="answer"/>
673 <div t-if="not question.uid_has_answered">
674 <t t-call="website_forum.post_answer"/>
676 <div t-if="question.uid_has_answered" class="mb16">
677 <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
678 <span class="text-muted">(only one answer per question is allowed)</span>
683 <!-- Utility template: Post a Comment -->
684 <template id="post_comment">
685 <div class="row clearfix">
686 <div class="col-sm-10 col-sm-offset-2">
687 <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
688 <small class="text-muted">
689 <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"/>
690 <t t-call="website_forum.link_button">
691 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/delete'"/>
692 <t t-set="label" t-value="' '"/>
693 <t t-set="karma" t-value="user.karma<required_karma and required_karma or 0"/>
694 <t t-set="classes" t-value="'close comment_delete fa-times'"/>
697 <span t-field="message.body"/>
698 <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"/>
699 <t t-call="website_forum.link_button">
700 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/convert_to_answer'"/>
701 <t t-set="label" t-value="'Convert as an answer'"/>
702 <t t-set="karma" t-value="user.karma<required_karma and required_karma or 0"/>
703 <t t-set="classes" t-value="'fa-magic pull-right'"/>
705 <a t-attf-href="/forum/#{slug(forum)}/partner/#{message.author_id.id}"
706 t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
707 style="display: inline-block;"/>
708 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
711 <div class="css_editable_mode_hidden">
712 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
713 t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
714 <input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
715 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
716 <button type="submit" class="btn btn-primary mt8">Post</button>
724 <t t-call="website_forum.header">
728 <p class="text-muted">
729 A tag is a label that categorizes your question with other,
730 similar questions. Using the right tags makes it easier for
731 others to find and answer your question.
734 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
735 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
736 <span t-field="tag.name"/>
739 X <t t-esc="tag.posts_count"/>
746 <template id="badge">
747 <t t-call="website_forum.header">
752 Besides gaining reputation with your questions and answers,
753 you receive badges for being especially helpful. Badges
754 appear on your profile page, and your posts.
756 <table class="table mt32 mb64">
757 <tr t-foreach="badges" t-as="badge">
759 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
760 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
761 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
762 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
763 <span t-field="badge.name"/>
766 <b t-esc="badge.stat_count_distinct"/>
767 <i class="text-muted">awarded users</i>
769 <span t-field="badge.description"/>
776 <template id="badge_user">
777 <t t-call="website_forum.header">
778 <h3 class="mt32 mb32">
779 <b>Badge "<span t-field="badge.name"/>"</b>
782 <div class="pull-left badge">
783 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
784 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
785 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
786 <span t-field="badge.name"/>
788 <span t-field="badge.description" style="margin-left:20px"/>
791 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
792 <span t-if="badge.stat_count_distinct>1">users</span>
793 <span t-if="badge.stat_count_distinct<=1">user</span>
797 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
798 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
800 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
807 <template id="users">
808 <t t-call="website_forum.header">
809 <div t-foreach="users" t-as="row_users" class="row mt16">
810 <div t-foreach="row_users" t-as="user" class="col-sm-4">
811 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
813 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
814 <t t-if="user.country_id">
815 <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
817 <b><t t-esc="user.karma"/></b>
818 <t t-raw="separator"/>
821 <span class="fa fa-circle badge-gold"/>
822 <t t-esc="user.gold_badge"/>
823 <span class="fa fa-circle badge-silver"/>
824 <t t-esc="user.silver_badge"/>
825 <span class="fa fa-circle badge-bronze"/>
826 <t t-esc="user.bronze_badge"/>
832 <div class="pull-left">
833 <t t-call="website.pager"/>
838 <!--Private profile-->
839 <template id="private_profile">
840 <t t-call="website_forum.header">
841 <h1 class="mt32">This profile is private!</h1>
843 <a t-attf-href="/forum/#{slug(forum)}">Return to the question list.</a>
848 <template id="edit_profile">
849 <t t-call="website_forum.header">
850 <h3>Edit Profile</h3>
852 <div class="col-md-2">
853 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
855 <div class="col-md-10">
856 <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
857 <input name="user_id" t-att-value="user.id" type="hidden"/>
858 <div class="form-group">
859 <label class="col-md-2 control-label mb16" for="user_name">Real name</label>
860 <div class="col-md-8 mb16">
861 <input type="text" class="form-control" name="name" id="user_name" required="True" t-attf-value="#{user.name}"/>
864 <div class="form-group">
865 <label class="col-md-2 control-label mb16" for="user_website_published" t-if="user.id == uid">Public profile</label>
866 <div class="col-md-8 mb16" t-if="user.id == uid">
867 <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" t-if="not user.website_published"/>
868 <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" checked="checked" t-if="user.website_published"/>
871 <div class="form-group">
872 <label class="col-md-2 control-label mb16" for="user_website">Website</label>
873 <div class="col-md-8 mb16">
874 <input type="text" class="form-control" name="website" id="user_website" t-attf-value="#{user.partner_id.website or ''}"/>
877 <div class="form-group">
878 <div t-if="email_required" class="alert alert-danger alert-dismissable oe_forum_email_required">
879 <button type="button" class="close" data-dismiss="alert">x</button>
880 <p>Please enter a valid email address in order to receive notifications from answers or comments.</p>
882 <label class="col-md-2 control-label mb16" for="user_email">Email</label>
883 <div class="col-md-8 mb16">
884 <input type="text" class="form-control" name="email" id="user_email" required="True" t-attf-value="#{user.partner_id.email}"/>
887 <div class="form-group">
888 <label class="col-md-2 control-label mb16" for="user_city">City</label>
889 <div class="col-md-8 mb16">
890 <input type="text" class="form-control" name="city" id="user_city" t-attf-value="#{user.partner_id.city or ''}"/>
893 <div class="form-group">
894 <label class="col-md-2 control-label mb16">Country</label>
895 <div class="col-md-8 mb16">
896 <select class="form-control" name="country">
897 <option value="">Country...</option>
898 <t t-foreach="countries or []" t-as="country">
899 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country_id.id"><t t-esc="country.name"/></option>
904 <!--Note: using website_description fiels instead of using commnt firld of partner-->
905 <div class="form-group">
906 <label class="col-md-2 control-label mb16" for="description">Biography</label>
907 <div class="col-md-8 mb16">
908 <textarea name="description" id="description" style="min-height: 120px" required="True"
909 class="form-control load_editor"><t t-esc="user.partner_id.website_description"/></textarea>
912 <div class="col-sm-offset-2 col-md-2 mb16">
913 <button class="btn btn-primary btn-lg">Update</button>
918 <script type="text/javascript">
919 CKEDITOR.replace("description");
924 <template id="user_detail_full">
925 <t t-call="website_forum.header">
926 <h1 class="mt0 page-header">
927 <span t-field="user.name"/>
928 <small>profile</small>
929 <t t-call="website.publish_management" groups="base.group_website_publisher">
930 <t t-set="object" t-value="user"/>
934 <div class="col-sm-2">
935 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
937 <div class="col-sm-10">
938 <table class="table table-condensed">
940 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
941 <td>member since</td>
942 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
944 <td>last connection</td>
945 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
948 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
951 <a t-att-href="user.website" t-if="user.website">
952 <span t-field="user.website"/>
958 <span t-field="user.city"/>
959 <span t-if="user.city and user.country_id">, </span>
960 <span t-field="user.country_id"/>
961 <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
966 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
968 <td><span t-field="user.karma"/></td>
972 <span class="fa fa-thumbs-up"/>
973 <span t-esc="up_votes"/>
974 <span class="fa fa-thumbs-down"/>
975 <span t-esc="down_votes"/>
979 <div class="well well-sm">
980 <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
981 <t t-if="uid == user.id">
982 <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
988 <ul class="nav nav-tabs">
990 <a href="#questions" data-toggle="tab"><t t-esc="count_questions"/> Questions</a>
993 <a href="#answers" data-toggle="tab"><t t-esc="count_answers"/> Answers</a>
995 <li t-if="uid == user.id">
996 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
998 <li t-if="uid == user.id">
999 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
1001 <li t-if="uid == user.id">
1002 <a href="#activity" data-toggle="tab">Activity</a>
1005 <a href="#badges" data-toggle="tab">Badges</a>
1007 <li t-if="uid == user.id">
1008 <a href="#votes" data-toggle="tab">Votes</a>
1011 <div class="tab-content mt16">
1012 <div class="tab-pane active" id="questions">
1013 <div class="mb16" t-foreach="questions" t-as="question">
1014 <t t-call="website_forum.display_post"/>
1016 </div><div class="tab-pane" id="answers">
1017 <div t-foreach="answers" t-as="answer">
1018 <t t-call="website_forum.display_post_answer"/>
1021 <div class="tab-pane" id="karma">
1024 <div class="tab-pane" id="badges">
1025 <t t-call="website_forum.user_badges"/>
1027 <div class="tab-pane" id="favourite_question" t-if="uid == user.id">
1028 <div t-foreach="favourite" t-as="question">
1029 <t t-call="website_forum.display_post"/>
1032 <div class="tab-pane" id="followed_question" t-if="uid == user.id">
1033 <div t-foreach="followed" t-as="question" class="mb16">
1034 <t t-call="website_forum.display_post"/>
1037 <div class="tab-pane" id="votes" t-if="uid == user.id">
1038 <t t-call="website_forum.user_votes"/>
1040 <div class="tab-pane" id="activity" t-if="uid == user.id">
1041 <ul class="list-unstyled">
1042 <li t-foreach="activities" t-as="activity">
1043 <span t-field="activity.date" t-field-options='{"format": "short"}'/>
1044 <span t-esc="activity.subtype_id.name" class="label label-info"/>
1045 <t t-set="post" t-value="posts[activity.res_id]"/>
1046 <span t-if="post[1]">
1047 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
1048 <span t-esc="post[0].name"/>
1051 <span t-if="not post[1]">
1052 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
1053 <span t-esc="post[0].name"/>
1063 <template id="user_badges">
1064 <table class="table mt32 mb64">
1065 <tr t-foreach="user.badge_ids" t-as="badge">
1067 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
1068 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
1069 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
1070 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
1071 <span t-field="badge.badge_id.name"/>
1074 <b t-esc="badge.badge_id.stat_count_distinct"/>
1075 <i class="text-muted">awarded users</i>
1077 <span t-field="badge.badge_id.description"/>
1081 <div class="mb16" t-if="not user.badge_ids">
1082 <b>No badge yet!</b><br/>
1083 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
1087 <template id="user_votes">
1088 <div t-foreach="vote_post" t-as="vote">
1089 <t t-esc="vote.post_id.create_date"/>
1090 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
1091 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
1092 <t t-if="vote.post_id.parent_id">
1093 <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"/>
1095 <t t-if="not vote.post_id.parent_id">
1096 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
1099 <div class="mb16" t-if="not vote_post">
1100 <b>No vote given by you yet!</b>
1104 <!-- User Navbar -->
1105 <template id="content_new_forum" inherit_id="website.user_navbar" groups="base.group_user">
1106 <xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
1107 <li><a href="#" data-action="new_forum">New Forum</a></li>