1 <?xml version="1.0" encoding="utf-8"?>
6 <template id="editor_head" inherit_id="website.editor_head"
8 <xpath expr="//script[@id='website_tour_js']" position="after">
9 <script type="text/javascript" src="/website_forum/static/src/js/website.tour.forum.js"/>
10 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.editor.js"/>
14 <!-- Layout add nav and footer -->
15 <template id="header_footer_custom" inherit_id="website.layout"
16 name="Footer Questions Link">
17 <xpath expr="//footer//ul[@name='products']" position="inside">
18 <li><a t-attf-href="/forum/%(website_forum.forum_help)d">Q&A</a></li>
19 <li><a href="/forum">Forums</a></li>
24 <template id="link_button">
25 <form method="POST" t-att-action="url">
26 <button t-attf-class="fa btn-link #{classes}">
27 <t t-esc="label"/></button>
32 <template id="header" name="Forum Index">
33 <t t-call="website.layout">
35 <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
36 <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
37 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
38 <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
39 <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
40 <script type="text/javascript">
41 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
42 ,['Outdent','Indent','Link','Unlink','Image'],] ;
45 <div class="container mt16">
46 <div class="navbar navbar-default">
47 <div class="navbar-header">
48 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
49 <span class="sr-only">Toggle navigation</span>
50 <span class="icon-bar"></span>
51 <!-- <span class="icon-bar"></span> -->
52 <span class="icon-bar"></span>
54 <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
55 <span t-field="forum.name"/>
58 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
59 <ul class="nav navbar-nav">
60 <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
61 <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
63 <li t-att-class="searches.get('users') and 'active' or '' ">
64 <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
66 <li t-att-class="searches.get('tags') and 'active' or '' ">
67 <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
69 <li t-att-class="searches.get('badges') and 'active' or '' ">
70 <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
73 <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
74 <div class="form-group">
75 <input type="search" class="form-control"
76 name="search" placeholder="Search a question..."
77 t-att-value="search or ''"/>
78 <button type="submit" class="btn btn-default">Search</button>
85 <div id="wrap" class="container">
87 <div class="col-sm-9">
88 <div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable">
89 <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
90 <div t-field="notification.body"/>
91 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }#badges" class="fa fa-arrow-right">View Your Badges</a>
95 <div class="col-sm-3" id="right-column">
96 <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>
97 <div class="panel panel-default" id="about_forum">
98 <div class="panel-heading">
99 <h3 class="panel-title">About This Forum</h3>
101 <div class="panel-body">
102 <t t-raw="forum.description"/><br/>
103 <a t-if="not header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
104 <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>
107 <div t-if="header.get('question_data')">
108 <div class="panel panel-default">
109 <div class="panel-heading text-center">
110 <h3 class="panel-title">Question tools</h3>
112 <div class="panel-body text-center">
113 <t t-call="website_mail.follow"><t t-set="object" t-value="question"/></t>
115 <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower(s)
118 <div class="panel-heading text-center">
119 <h3 class="panel-title ">Stats</h3>
121 <div class="panel-body">
122 <table class="table">
123 <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
124 <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
125 <span t-if="question.views>1">times</span>
126 <span t-if="question.views<=1">time</span>
128 <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
136 <div class="oe_structure"/>
140 <!-- Display a post -->
141 <template id="display_post">
142 <div class="question clearfix">
143 <div class="pull-left text-center">
144 <div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
145 <span t-esc="question.child_count"/>
146 <div t-if="question.child_count>1" class="subtitle">Answers</div>
147 <div t-if="question.child_count<=1" class="subtitle">Answer</div>
150 <div style="margin-left: 95px; margin-top:-8px;">
151 <div class="question-name">
152 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
153 <span t-if="not question.active"><b> [Deleted]</b></span>
154 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
156 <t t-foreach="question.tag_ids" t-as="question_tag">
157 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{slug(question_tag)}/questions">
158 <span t-attf-class="pull-right badge #{tag and tag.name == question_tag.name and 'badge-active' ''}" t-field="question_tag.name"
159 style="margin-right: 4px;"/>
162 <div class="text-muted">
163 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
164 t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
165 style="display: inline-block;"/>
166 on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
167 with <b t-field="question.views"/> views
168 <span t-if="question.vote_count>0"> and
169 <b t-esc="question.vote_count or 0"/>
170 <t t-if="question.vote_count>1">votes</t>
171 <t t-if="question.vote_count==1">vote</t>
178 <!-- Display a post as an answer -->
179 <template id="display_post_answer">
180 <div class="clearfix">
181 <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
182 <div t-esc="len(answer.vote_ids)"/>
184 <div class="question-name" style="margin-left: 32px;">
185 <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"/>
186 <t t-if="len(answer.website_message_ids)>0">
187 (<t t-esc="len(answer.website_message_ids)"/>
188 <t t-if="len(answer.website_message_ids)>1">Comments</t>
189 <t t-if="len(answer.website_message_ids)<=1">Comment</t>)
197 <t t-call="website_forum.header">
198 <div t-field="forum.faq"/>
202 <!-- All Forums Layout -->
203 <template id="forum_all">
204 <t t-call="website.layout">
205 <div class="container">
206 <h1 class="mb32">Our forums</h1>
208 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
209 <a t-attf-href="/forum/#{ slug(forum) }">
210 <div class="fa fa-5x fa-comment mb16"/>
211 <div t-field="forum.name"/>
219 <!-- Specific Forum Layout -->
220 <template id="forum_index" name="Forum">
221 <t t-call="website_forum.header">
222 <h1 class="page-header mt0">
223 <t t-esc="question_count"/> <span>Questions</span>
225 <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
226 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
227 <t t-if="filters == 'all'">All</t>
228 <t t-if="filters == 'unanswered'">Unanswered</t>
229 <t t-if="filters == 'followed'">Followed</t>
230 <t t-if="tag"><span t-field="tag.name"/></t>
231 <t t-if="sorting == 'date'"> by activity date</t>
232 <t t-if="sorting == 'answered'"> by most answered</t>
233 <t t-if="sorting == 'vote'"> by most voted</t>
236 <ul class="dropdown-menu">
237 <li class="dropdown-header">Filter on</li>
238 <li t-att-class="filters == 'all' and 'active' or '' ">
239 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
241 <li t-att-class="filters == 'unanswered' and 'active' or '' ">
242 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
244 <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
245 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
247 <li class="dropdown-header">Tags</li>
248 <li t-if="tag" t-att-class="tag and 'active' or '' ">
249 <a href=""><t t-esc="tag.name"/></a>
251 <li class="dropdown-header">Sort by</li>
252 <li t-att-class="sorting == 'date' and 'active' or '' ">
253 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
255 <li t-att-class="sorting == 'answered' and 'active' or '' ">
256 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
258 <li t-att-class="sorting == 'vote' and 'active' or '' ">
259 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
264 <div t-foreach="question_ids" t-as="question" class="mb16">
265 <t t-call="website_forum.display_post"/>
267 <t t-call="website.pager"/>
272 <t t-call="website_forum.header">
273 <div class="oe_structure oe_empty"/>
274 <h1 class="mt32">Question not found!</h1>
275 <p>Sorry, this question is not available anymore.</p>
277 <a t-attf-href="/forum">Return to the question list.</a>
282 <!-- Edition: ask your question -->
283 <template id="ask_question">
284 <t t-call="website_forum.header">
285 <h1 class="mt0">Ask your Question</h1>
287 <li> please, try to make your question interesting to others </li>
288 <li> provide enough details and, if possible, give an example </li>
289 <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
291 <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
292 <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
293 class="form-control" placeholder="Enter your Question"/>
294 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
295 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
296 <textarea name="content" required="True" class="form-control load_editor">
297 <t t-esc="question_content"/>
300 <input type="text" name="question_tags" placeholder="Tags" class="form-control load_tags"/>
302 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Question</button>
304 <script type="text/javascript">
305 CKEDITOR.replace("content");
310 <!-- Edition: edit a post -->
311 <template id="edit_post">
312 <t t-call="website_forum.header">
313 <h3 t-if="not is_answer">Edit question</h3>
314 <h3 t-if="is_answer">Edit answer</h3>
315 <form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
316 <div t-if="not is_answer">
317 <input type="text" name="question_name" id="question_name" required="True"
318 t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
319 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
321 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
322 <textarea name="content" required="True" class="form-control load_editor">
323 <t t-esc="post.content"/>
325 <div t-if="not is_answer">
327 <input type="text" name="question_tag" class="form-control col-md-9 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
330 <button class="btn btn-primary btn-lg">Save</button>
332 <script type="text/javascript">
333 CKEDITOR.replace("content");
338 <!-- Moderation: close a question -->
339 <template id="close_question">
340 <t t-call="website_forum.header">
341 <h1 class="mt0">Close question</h1>
342 <p class="text-muted">
343 If you close this question, it will be hidden for most users. Only
344 users having a high karma can see closed questions to moderate
347 <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
348 <input name="post_id" t-att-value="question.id" type="hidden"/>
349 <div class="form-group">
350 <label class="col-md-3 control-label" for="reason">Question:</label>
351 <div class="col-md-8 mt8">
352 <span t-field="question.name"/>
355 <div class="form-group">
356 <label class="col-md-3 control-label" for="reason">Reason:</label>
357 <div class="col-md-8">
358 <select class="form-control" name="reason_id">
359 <t t-foreach="reasons or []" t-as="reason">
360 <option t-att-value="reason.id" t-att-selected="reason.id == question.closed_reason_id.id"><t t-esc="reason.name"/></option>
365 <div class="form-group">
366 <div class="col-md-offset-3 col-md-8">
367 <button class="btn btn-primary">Close question</button>
368 <span class="text-muted">or</span>
369 <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">back to question</a>
376 <!-- Edition: post an answer -->
377 <template id="post_answer">
378 <h3 class="mt10">Your answer</h3>
380 <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
381 <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
382 - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
383 - it really helps to select the best questions and answers!
385 <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
386 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
387 <textarea name="content" class="form-control load_editor" required="True"/>
388 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Answer</button>
390 <script type="text/javascript">
391 CKEDITOR.replace("content");
396 <div t-attf-class="box oe_grey">
397 <a t-attf-class="vote_up fa fa-thumbs-up no-decoration #{post.user_vote == 1 and 'text-success' or ''}"
398 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
399 <span id="vote_count" t-esc="post.vote_count"/>
400 <a t-attf-class="vote_down fa fa-thumbs-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''}"
401 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
402 <div t-if="vote_count > 1" class="subtitle">
405 <div t-if="vote_count < 2" class="subtitle">
411 <!-- Specific Post Layout -->
412 <template id="post_description_full" name="Question Navigation">
413 <t t-call="website_forum.header">
414 <div t-attf-class="question #{not question.active and 'alert alert-danger' or ''}">
415 <div class="text-center pull-left">
416 <t t-call="website_forum.vote">
417 <t t-set="post" t-value="question"/>
419 <div class="text-muted text-center">
420 <span t-field="question.views"/> Views
423 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
424 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
427 <div style="margin-left: 95px;">
429 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
430 <span t-if="not question.active"><b> [Deleted]</b></span>
431 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
433 <div class="alert alert-info" t-if="question.state == 'close'">
434 <p class="mt32 mb16 text-center">
435 <b>The question has been closed for reason: <i t-esc="question.closed_reason_id.name"/>
437 <t t-if="question.closed_uid">
438 <i>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(question.closed_uid) }" t-field="question.closed_uid"/> </i>
440 on <span t-field="question.closed_date"/></b>
442 <div t-if="question.state == 'close' and user.karma>=500" class="mb24 text-center">
443 <t t-call="website_forum.link_button">
444 <t t-set="url"><t t-escf="/forum/#{ slug(forum) }/question/#{slug(question)}/reopen"/></t>
445 <t t-set="label"> Reopen</t>
446 <t t-set="classes">fa-arrow-right</t>
450 <t t-raw="question.content"/>
452 <div class="mt16 clearfix">
453 <div class="pull-right">
454 <div class="text-right">
455 <t t-foreach="question.tag_ids" t-as="tag">
456 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
459 <ul class="list-inline" id="options">
460 <li t-if="user.id == question.create_uid.id or user.karma>=50">
461 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
462 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
466 <li t-if="question.state != 'close' and ((user.id == question.create_uid.id and can_close_own) or can_close_all)">
467 <t t-call="website_forum.link_button">
468 <t t-set="url"><t t-escf="/forum/#{ slug(forum) }/question/#{slug(question)}/ask_for_close"/></t>
469 <t t-set="label"> Close</t>
470 <t t-set="classes">text-muted fa-times</t>
473 <li t-if="question.state == 'close' and ((user.id == question.create_uid.id and can_close_own) or can_close_all)">
474 <t t-call="website_forum.link_button">
475 <t t-set="url"><t t-escf="/forum/#{ slug(forum) }/question/#{slug(question)}/reopen"/></t>
476 <t t-set="label"> Reopen</t>
477 <t t-set="classes">text-muted fa-undo</t>
480 <li t-if="(user.id == question.create_uid.id and can_edit_own) or can_edit_all">
481 <t t-call="website_forum.link_button">
482 <t t-set="url"><t t-escf="/forum/#{ slug(forum) }/post/#{slug(question)}/edit"/></t>
483 <t t-set="label"> Edit</t>
484 <t t-set="classes">text-muted fa-edit</t>
487 <li t-if="question.active and ((user.id == question.create_uid.id and can_unlink_own) or can_unlink_all)">
488 <t t-call="website_forum.link_button">
489 <t t-set="url"><t t-escf="/forum/#{ slug(forum) }/question/#{slug(question)}/delete"/></t>
490 <t t-set="label"> Delete</t>
491 <t t-set="classes">text-muted fa-trash-o</t>
494 <li t-if="not question.active and ((user.id == question.create_uid.id and can_unlink_own) or can_unlink_all)">
495 <t t-call="website_forum.link_button">
496 <t t-set="url"><t t-escf="/forum/#{ slug(forum) }/question/#{slug(question)}/undelete"/></t>
497 <t t-set="label"> Undelete</t>
498 <t t-set="classes">text-muted fa-trash-o</t>
504 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{question.create_uid.id}/avatar"/>
506 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
507 t-field="question.create_uid"
508 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
509 style="display: inline-block;"/>
510 <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
514 <t t-call="website_forum.post_comment">
515 <t t-set="object" t-value="question"/>
521 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
522 <a t-attf-id="answer-#{str(answer.id)}"/>
523 <div t-attf-class="forum_answer" t-attf-id="answer_#{answer.id}" >
524 <div class="text-center pull-left">
525 <t t-call="website_forum.vote">
526 <t t-set="post" t-value="answer"/>
528 <div class="text-muted mt8">
529 <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'}"
530 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
533 <div style="margin-left: 95px;" class="clearfix">
534 <t t-raw="answer.content"/>
536 <ul class="list-inline pull-right">
537 <li t-if="user.id == answer.create_uid.id or user.karma>=50">
538 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
539 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
542 <li t-if="(user.id == answer.create_uid.id and can_edit_own) or can_edit_all">
543 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/edit"> Edit</a>
545 <li t-if="(user.id == answer.create_uid.id and can_unlink_own) or can_unlink_all">
546 <t t-call="website_forum.link_button">
547 <t t-set="url"><t t-escf="/forum/#{slug(forum)}/post/#{slug(answer)}/delete"/></t>
548 <t t-set="label"> Delete</t>
549 <t t-set="classes">text-muted fa-trash-o</t>
552 <li t-if="user.id == answer.create_uid.id">
553 <t t-call="website_forum.link_button">
554 <t t-set="url"><t t-escf="/forum/#{slug(forum)}/post/#{slug(answer)}/convert_to_comment"/></t>
555 <t t-set="label">Convert as a comment</t>
556 <t t-set="classes">text-muted fa-magic</t>
560 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{answer.create_uid.id}/avatar"/>
562 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ answer.create_uid.id }"
563 t-field="answer.create_uid"
564 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
565 style="display: inline-block;"/>
566 <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
567 <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
570 <t t-call="website_forum.post_comment">
571 <t t-set="object" t-value="answer"/>
576 <div t-if="not question.uid_has_answered">
577 <t t-call="website_forum.post_answer"/>
579 <div t-if="question.uid_has_answered" class="mb16">
580 <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
581 <span class="text-muted">(only one answer per question is allowed)</span>
586 <!-- Utility template: Post a Comment -->
587 <template id="post_comment">
588 <div class="row clearfix">
589 <div class="col-sm-10 col-sm-offset-2">
590 <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
591 <small class="text-muted">
592 <button type="button" t-if="user.partner_id.id == message.author_id.id and user.karma>=750"
593 t-attf-data-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/delete"
594 class="close comment_delete">&times;</button>
595 <span t-field="message.body"/>
596 <a t-attf-href="/forum/#{slug(forum)}/partner/#{message.author_id.id}"
597 t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
598 style="display: inline-block;"/>
599 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
601 <t t-call="website_forum.link_button">
602 <t t-set="url"><t t-escf="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/convert_to_answer"/></t>
603 <t t-set="label"> Convert as an answer</t>
604 <t t-set="classes">text-muted fa-magic pull-right</t>
608 <div class="css_editable_mode_hidden">
609 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
610 t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
611 <input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
612 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
613 <button type="submit" class="btn btn-primary mt8">Post</button>
621 <t t-call="website_forum.header">
625 <p class="text-muted">
626 A tag is a label that categorizes your question with other,
627 similar questions. Using the right tags makes it easier for
628 others to find and answer your question.
631 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
632 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
633 <span t-field="tag.name"/>
636 X <t t-esc="tag.posts_count"/>
643 <template id="badge">
644 <t t-call="website_forum.header">
649 Besides gaining reputation with your questions and answers,
650 you receive badges for being especially helpful. Badges
651 appear on your profile page, and your posts.
653 <table class="table mt32 mb64">
654 <tr t-foreach="badges" t-as="badge">
656 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
657 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
658 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
659 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
660 <span t-field="badge.name"/>
663 <b t-esc="badge.stat_count_distinct"/>
664 <i class="text-muted">awarded users</i>
666 <span t-field="badge.description"/>
673 <template id="badge_user">
674 <t t-call="website_forum.header">
675 <h3 class="mt32 mb32">
676 <b>Badge "<span t-field="badge.name"/>"</b>
679 <div class="pull-left badge">
680 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
681 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
682 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
683 <span t-field="badge.name"/>
685 <span t-field="badge.description" style="margin-left:20px"/>
688 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
689 <span t-if="badge.stat_count_distinct>1">users</span>
690 <span t-if="badge.stat_count_distinct<=1">user</span>
694 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
695 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
697 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
704 <template id="users">
705 <t t-call="website_forum.header">
707 <div t-foreach="users" t-as="user" class="col-sm-4">
708 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
710 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
711 <t t-if="user.country_id">
712 <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
714 <b><t t-esc="user.karma"/></b>
715 <t t-raw="separator"/>
718 <span class="fa fa-circle badge-gold"/>
719 <t t-esc="user.gold_badge"/>
720 <span class="fa fa-circle badge-silver"/>
721 <t t-esc="user.silver_badge"/>
722 <span class="fa fa-circle badge-bronze"/>
723 <t t-esc="user.bronze_badge"/>
729 <div class="pull-left">
730 <t t-call="website.pager"/>
735 <template id="edit_profile">
736 <t t-call="website_forum.header">
737 <h3>Edit Profile </h3>
738 <div class="col-md-2">
739 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
741 <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
742 <input name="user_id" t-att-value="user.id" type="hidden"/>
743 <label class="col-md-2 control-label mb16" for="user.name">Real name</label>
744 <div class="col-md-7 mb16">
745 <input type="text" class="col-md-7 mb16 form-control" name="name" required="True" t-attf-value="#{user.name}"/>
747 <label class="col-md-2 control-label mb16" for="user.partner_id.website">Website</label>
748 <div class="col-md-7 mb16">
749 <input type="text" class="form-control" name="website" t-attf-value="#{user.partner_id.website or ''}"/>
751 <label class="col-md-4 control-label mb16" for="user.partner_id.email">Email</label>
752 <div class="col-md-7 mb16">
753 <input type="text" class="form-control" name="email" required="True" t-attf-value="#{user.partner_id.email}"/>
755 <label class="col-md-4 control-label mb16" for="user.partner_id.city">City</label>
756 <div class="col-md-7 mb16">
757 <input type="text" class="form-control" name="city" t-attf-value="#{user.partner_id.city or ''}"/>
759 <label class="col-md-4 control-label mb16" for="contact_name">Country</label>
760 <div class="col-md-7 mb16">
761 <select class="form-control" name="country">
762 <option value="">Country...</option>
763 <t t-foreach="countries or []" t-as="country">
764 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country_id.id"><t t-esc="country.name"/></option>
768 <!--Note: using website_description fiels instead of using commnt firld of partner-->
769 <label class="col-md-4 control-label mb16" for="user.partner_id.website_description">Biography</label>
770 <div class="col-md-7 mb16">
771 <textarea name="description" style="min-height: 120px" required="True"
772 class="form-control"><t t-esc="user.partner_id.website_description"/></textarea>
774 <div class="col-sm-offset-4 col-md-4 mb16">
775 <button class="btn btn-primary btn-lg">Update</button>
781 <template id="user_detail_full">
782 <t t-call="website_forum.header">
783 <h1 class="mt0 page-header">
784 <span t-field="user.name"/>
785 <small>profile</small>
788 <div class="col-sm-2">
789 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
791 <div class="col-sm-10">
792 <table class="table table-condensed">
794 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
795 <td>member since</td>
796 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
798 <td>last connection</td>
799 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
802 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
805 <a t-att-href="user.website" t-if="user.website">
806 <span t-field="user.website"/>
812 <span t-field="user.city"/>
813 <span t-if="user.city and user.country_id">, </span>
814 <span t-field="user.country_id"/>
815 <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
820 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
822 <td><span t-field="user.karma"/></td>
826 <span class="fa fa-thumbs-up"/>
827 <span t-esc="up_votes"/>
828 <span class="fa fa-thumbs-down"/>
829 <span t-esc="down_votes"/>
833 <div class="well well-sm">
834 <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
835 <t t-if="uid == user.id">
836 <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
842 <ul class="nav nav-tabs">
844 <a href="#questions" data-toggle="tab"><t t-esc="len(questions)"/> Questions</a>
847 <a href="#answers" data-toggle="tab"><t t-esc="len(answers)"/> Answers</a>
849 <li t-if="uid == user.id">
850 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
852 <li t-if="uid == user.id">
853 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
855 <li t-if="uid == user.id">
856 <a href="#activity" data-toggle="tab">Activity</a>
859 <a href="#badges" data-toggle="tab">Badges</a>
861 <li t-if="uid == user.id">
862 <a href="#votes" data-toggle="tab">Votes</a>
865 <div class="tab-content mt16">
866 <div class="tab-pane active" id="questions">
867 <div class="mb16" t-foreach="questions" t-as="question">
868 <t t-call="website_forum.display_post"/>
870 </div><div class="tab-pane" id="answers">
871 <div t-foreach="answers" t-as="answer">
872 <t t-call="website_forum.display_post_answer"/>
875 <div class="tab-pane" id="karma">
878 <div class="tab-pane" id="badges">
879 <t t-call="website_forum.user_badges"/>
881 <div class="tab-pane" id="favourite_question">
882 <div t-foreach="favourite" t-as="question">
883 <t t-call="website_forum.display_post"/>
886 <div class="tab-pane" id="followed_question">
887 <div t-foreach="followed" t-as="question" class="mb16">
888 <t t-call="website_forum.display_post"/>
891 <div class="tab-pane" id="votes">
892 <t t-call="website_forum.user_votes"/>
894 <div class="tab-pane" id="activity">
895 <ul class="list-unstyled">
896 <li t-foreach="activities" t-as="activity">
897 <span t-field="activity.date" t-field-options='{"format": "short"}'/>
898 <span t-esc="activity.subtype_id.name" class="label label-info"/>
899 <t t-set="post" t-value="posts[activity.res_id]"/>
900 <span t-if="post[1]">
901 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
902 <span t-esc="post[0].name"/>
905 <span t-if="not post[1]">
906 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
907 <span t-esc="post[0].name"/>
917 <template id="user_badges">
918 <table class="table mt32 mb64">
919 <tr t-foreach="user.badge_ids" t-as="badge">
921 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
922 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
923 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
924 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
925 <span t-field="badge.badge_id.name"/>
928 <b t-esc="badge.badge_id.stat_count_distinct"/>
929 <i class="text-muted">awarded users</i>
931 <span t-field="badge.badge_id.description"/>
935 <div class="mb16" t-if="not user.badge_ids">
936 <b>No badge yet!</b><br/>
937 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
941 <template id="user_votes">
942 <div t-foreach="vote_post" t-as="vote">
943 <t t-esc="vote.post_id.create_date"/>
944 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
945 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
946 <t t-if="vote.post_id.parent_id">
947 <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"/>
949 <t t-if="not vote.post_id.parent_id">
950 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
953 <div class="mb16" t-if="not vote_post">
954 <b>No vote given by you yet!</b>