1 <?xml version="1.0" encoding="utf-8"?>
6 <template id="editor_head" inherit_id="website.editor_head"
8 <xpath expr="." position="inside">
9 <link rel='stylesheet' href="/website_forum/static/src/css/website_forum.css"/>
11 <script type="text/javascript" src="/website_forum/static/src/js/website.tour.forum.js"/>
12 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.editor.js"/>
16 <!-- Layout add nav and footer -->
17 <template id="header_footer_custom" inherit_id="website.layout"
18 name="Footer Questions Link">
19 <xpath expr="//footer//ul[@name='products']" position="inside">
20 <li><a t-attf-href="/forum/%(website_forum.forum_help)d">Q&A</a></li>
21 <li><a href="/forum">Forums</a></li>
26 <template id="link_button">
27 <form method="POST" t-att-action="url">
28 <button t-attf-class="fa btn-link #{classes}">
29 <t t-esc="label"/></button>
34 <template id="header" name="Forum Index">
35 <t t-call="website.layout">
37 <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
38 <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
39 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
40 <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
41 <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
42 <script type="text/javascript">
43 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
44 ,['Outdent','Indent','Link','Unlink','Image'],] ;
47 <div class="container mt16">
48 <div class="navbar navbar-default">
49 <div class="navbar-header">
50 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
51 <span class="sr-only">Toggle navigation</span>
52 <span class="icon-bar"></span>
53 <!-- <span class="icon-bar"></span> -->
54 <span class="icon-bar"></span>
56 <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
57 <span t-field="forum.name"/>
60 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
61 <ul class="nav navbar-nav">
62 <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
63 <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
65 <li t-att-class="searches.get('users') and 'active' or '' ">
66 <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
68 <li t-att-class="searches.get('tags') and 'active' or '' ">
69 <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
71 <li t-att-class="searches.get('badges') and 'active' or '' ">
72 <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
74 <li t-if="not is_public_user" t-att-class="searches.get('my_profile') and 'active' or '' ">
75 <a t-attf-href="/forum/#{ slug(forum) }/user/#{user.id}">My Profile</a>
78 <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
79 <div class="form-group">
80 <input type="search" class="form-control"
81 name="search" placeholder="Search a question..."
82 t-att-value="search or ''"/>
83 <button type="submit" class="btn btn-default">Search</button>
90 <div id="wrap" class="container">
92 <div class="col-sm-9">
93 <div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable">
94 <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
95 <div t-field="notification.body"/>
96 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }#badges" class="fa fa-arrow-right">View Your Badges</a>
100 <div class="col-sm-3" id="right-column">
101 <a t-if="not header.get('ask_hide')" class="btn btn-primary btn-lg btn-block mb16" t-attf-href="/forum/#{slug(forum)}/ask">Ask a Question</a>
102 <div class="panel panel-default">
103 <div class="panel-heading">
104 <h3 class="panel-title">Keep Informed</h3>
106 <div class="panel-body">
107 <t t-call="website_mail.follow">
108 <t t-set="email" t-value="user.email"/>
109 <t t-set="object" t-value="forum"/>
113 <div class="panel panel-default" id="about_forum">
114 <div class="panel-heading">
115 <h3 class="panel-title">About This Forum</h3>
117 <div class="panel-body">
118 <t t-raw="forum.description"/>
119 <a t-if="not header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
120 <a t-if="header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}" class="fa fa-arrow-right"> Back to <span t-field="forum.name"/></a>
123 <div t-if="header.get('question_data')">
124 <div class="panel panel-default">
125 <div class="panel-heading text-center">
126 <h3 class="panel-title">Question tools</h3>
128 <div class="panel-body text-center">
129 <t t-call="website_mail.follow"><t t-set="object" t-value="question"/></t>
131 <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower(s)
134 <div class="panel-heading text-center">
135 <h3 class="panel-title ">Stats</h3>
137 <div class="panel-body">
138 <table class="table">
139 <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
140 <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
141 <span t-if="question.views>1">times</span>
142 <span t-if="question.views<=1">time</span>
144 <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
152 <div class="oe_structure"/>
156 <!-- Display a post -->
157 <template id="display_post">
158 <div class="question clearfix">
159 <div class="col-md-2 hidden-xs text-center">
160 <div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
161 <span t-esc="question.child_count"/>
162 <div t-if="question.child_count>1" class="subtitle">Answers</div>
163 <div t-if="question.child_count<=1" class="subtitle">Answer</div>
166 <div class="col-md-10">
167 <div class="question-name">
168 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
169 <span t-if="not question.active"><b> [Deleted]</b></span>
170 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
172 <t t-foreach="question.tag_ids" t-as="question_tag">
173 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{slug(question_tag)}/questions">
174 <span t-attf-class="pull-right badge #{tag and tag.name == question_tag.name and 'badge-active' ''}" t-field="question_tag.name"
175 style="margin-right: 4px;"/>
178 <div class="text-muted">
179 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
180 t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
181 style="display: inline-block;"/>
182 on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
183 <span class="visible-xs">
184 <b t-esc="question.child_count or 0"/>
185 <t t-if="question.child_count>1">answers</t>
186 <t t-if="question.child_count==1">answers</t>
188 with <b t-field="question.views"/> views
189 <span t-if="question.vote_count>0"> and
190 <b t-esc="question.vote_count or 0"/>
191 <t t-if="question.vote_count>1">votes</t>
192 <t t-if="question.vote_count==1">vote</t>
199 <!-- Display a post as an answer -->
200 <template id="display_post_answer">
201 <div class="clearfix">
202 <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
203 <div t-esc="len(answer.vote_ids)"/>
205 <div class="question-name" style="margin-left: 32px;">
206 <a style="font-size: 15px;" t-attf-href="/forum/#{ slug(forum) }/question/#{ answer.parent_id.id }/#answer-#{ answer.id }" t-esc="answer.parent_id.name"/>
207 <t t-if="len(answer.website_message_ids)>0">
208 (<t t-esc="len(answer.website_message_ids)"/>
209 <t t-if="len(answer.website_message_ids)>1">Comments</t>
210 <t t-if="len(answer.website_message_ids)<=1">Comment</t>)
218 <t t-call="website_forum.header">
219 <div t-field="forum.faq"/>
223 <!-- All Forums Layout -->
224 <template id="forum_all">
225 <t t-call="website.layout">
226 <div class="container">
227 <h1 class="mb32">Our forums</h1>
229 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
230 <a t-attf-href="/forum/#{ slug(forum) }">
231 <div class="fa fa-5x fa-comment mb16"/>
232 <div t-field="forum.name"/>
240 <!-- Specific Forum Layout -->
241 <template id="forum_index" name="Forum">
242 <t t-call="website_forum.header">
243 <h1 class="page-header mt0">
244 <t t-esc="question_count"/> <span>Questions</span>
246 <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
247 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
248 <t t-if="filters == 'all'">All</t>
249 <t t-if="filters == 'unanswered'">Unanswered</t>
250 <t t-if="filters == 'followed'">Followed</t>
251 <t t-if="tag"><span t-field="tag.name"/></t>
252 <t t-if="sorting == 'date'"> by activity date</t>
253 <t t-if="sorting == 'creation'"> by creation date</t>
254 <t t-if="sorting == 'answered'"> by most answered</t>
255 <t t-if="sorting == 'vote'"> by most voted</t>
258 <ul class="dropdown-menu">
259 <li class="dropdown-header">Filter on</li>
260 <li t-att-class="filters == 'all' and 'active' or '' ">
261 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
263 <li t-att-class="filters == 'unanswered' and 'active' or '' ">
264 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
266 <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
267 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
269 <li class="dropdown-header">Tags</li>
270 <li t-if="tag" t-att-class="tag and 'active' or '' ">
271 <a href=""><t t-esc="tag.name"/></a>
273 <li class="dropdown-header">Sort by</li>
274 <li t-att-class="sorting == 'date' and 'active' or '' ">
275 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
277 <li t-att-class="sorting == 'creation' and 'active' or '' ">
278 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='creation')">Newest</a>
280 <li t-att-class="sorting == 'answered' and 'active' or '' ">
281 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
283 <li t-att-class="sorting == 'vote' and 'active' or '' ">
284 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
289 <div t-foreach="question_ids" t-as="question" class="mb16">
290 <t t-call="website_forum.display_post"/>
292 <t t-call="website.pager"/>
297 <t t-call="website_forum.header">
298 <div class="oe_structure oe_empty"/>
299 <h1 class="mt32">Question not found!</h1>
300 <p>Sorry, this question is not available anymore.</p>
302 <a t-attf-href="/forum">Return to the question list.</a>
307 <!-- Edition: ask your question -->
308 <template id="ask_question">
309 <t t-call="website_forum.header">
310 <h1 class="mt0">Ask your Question</h1>
312 <li> please, try to make your question interesting to others </li>
313 <li> provide enough details and, if possible, give an example </li>
314 <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
316 <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
317 <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
318 class="form-control" placeholder="Enter your Question"/>
319 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
320 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
321 <textarea name="content" required="True" class="form-control load_editor">
322 <t t-esc="question_content"/>
325 <input type="text" name="question_tags" placeholder="Tags" class="form-control load_tags"/>
327 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Question</button>
329 <script type="text/javascript">
330 CKEDITOR.replace("content");
335 <!-- Edition: edit a post -->
336 <template id="edit_post">
337 <t t-call="website_forum.header">
338 <h3 t-if="not is_answer">Edit question</h3>
339 <h3 t-if="is_answer">Edit answer</h3>
340 <form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
341 <div t-if="not is_answer">
342 <input type="text" name="question_name" id="question_name" required="True"
343 t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
344 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
346 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
347 <textarea name="content" required="True" class="form-control load_editor">
348 <t t-esc="post.content"/>
350 <div t-if="not is_answer">
352 <input type="text" name="question_tag" class="form-control col-md-9 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
355 <button class="btn btn-primary btn-lg">Save</button>
357 <script type="text/javascript">
358 CKEDITOR.replace("content");
363 <!-- Moderation: close a question -->
364 <template id="close_question">
365 <t t-call="website_forum.header">
366 <h1 class="mt0">Close question</h1>
367 <p class="text-muted">
368 If you close this question, it will be hidden for most users. Only
369 users having a high karma can see closed questions to moderate
372 <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
373 <input name="post_id" t-att-value="question.id" type="hidden"/>
374 <div class="form-group">
375 <label class="col-md-3 control-label" for="reason">Question:</label>
376 <div class="col-md-8 mt8">
377 <span t-field="question.name"/>
380 <div class="form-group">
381 <label class="col-md-3 control-label" for="reason">Reason:</label>
382 <div class="col-md-8">
383 <select class="form-control" name="reason_id">
384 <t t-foreach="reasons or []" t-as="reason">
385 <option t-att-value="reason.id" t-att-selected="reason.id == question.closed_reason_id.id"><t t-esc="reason.name"/></option>
390 <div class="form-group">
391 <div class="col-md-offset-3 col-md-8">
392 <button class="btn btn-primary">Close question</button>
393 <span class="text-muted">or</span>
394 <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">back to question</a>
401 <!-- Edition: post an answer -->
402 <template id="post_answer">
403 <h3 class="mt10">Your answer</h3>
405 <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
406 <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
407 - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
408 - it really helps to select the best questions and answers!
410 <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
411 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
412 <textarea name="content" class="form-control load_editor" required="True"/>
413 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Answer</button>
415 <script type="text/javascript">
416 CKEDITOR.replace("content");
421 <div t-attf-class="box oe_grey">
422 <a t-attf-class="vote_up fa fa-thumbs-up no-decoration #{post.user_vote == 1 and 'text-success' or ''}"
423 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
424 <span id="vote_count" t-esc="post.vote_count"/>
425 <a t-attf-class="vote_down fa fa-thumbs-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''}"
426 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
427 <div t-if="vote_count > 1" class="subtitle">
430 <div t-if="vote_count < 2" class="subtitle">
436 <!-- Specific Post Layout -->
437 <template id="post_description_full" name="Question Navigation">
438 <t t-call="website_forum.header">
439 <div t-attf-class="question #{not question.active and 'alert alert-danger' or ''}">
440 <div class="col-md-2 hidden-xs text-center">
441 <t t-call="website_forum.vote">
442 <t t-set="post" t-value="question"/>
444 <div class="text-muted text-center">
445 <span t-field="question.views"/> Views
448 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
449 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
452 <div style="col-md-10">
454 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
455 <span t-if="not question.active"><b> [Deleted]</b></span>
456 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
458 <div class="alert alert-info text-center" t-if="question.state == 'close'">
460 <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>
462 <t t-if="question.closed_uid">
463 <b>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.closed_uid.id }"
464 t-field="question.closed_uid"
465 t-field-options='{"widget": "contact", "fields": ["name"]}'
466 style="display: inline-block;"/></b>
468 <b>on <span t-field="question.closed_date"/></b>
469 <div t-if="question.state == 'close' and user.karma>=500" class="mt16 mb24 text-center">
470 <t t-call="website_forum.link_button">
471 <t t-set="url" t-value="'/forum/' + slug(forum) + '/question/' + slug(question) + '/reopen'"/>
472 <t t-set="label" t-value="'Reopen'"/>
473 <t t-set="classes" t-value="'fa-arrow-right'"/>
477 <t t-raw="question.content"/>
478 <div class="mt16 clearfix">
479 <div class="pull-right">
480 <div class="text-right">
481 <t t-foreach="question.tag_ids" t-as="tag">
482 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
485 <ul class="list-inline" id="options">
486 <li t-if="user.id == question.create_uid.id or user.karma>=50">
487 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
488 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
492 <li t-if="question.state != 'close' and ((user.id == question.create_uid.id and can_close_own) or can_close_all)">
493 <t t-call="website_forum.link_button">
494 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/ask_for_close'"/>
495 <t t-set="label" t-value="'Close'"/>
496 <t t-set="classes" t-vaoue="'text-muted fa-times'"/>
499 <li t-if="question.state == 'close' and ((user.id == question.create_uid.id and can_close_own) or can_close_all)">
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="'text-muted fa-undo'"/>
506 <li t-if="(user.id == question.create_uid.id and can_edit_own) or can_edit_all">
507 <t t-call="website_forum.link_button">
508 <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/edit'"/>
509 <t t-set="label" t-value="'Edit'"/>
510 <t t-set="classes" t-value="'text-muted fa-edit'"/>
513 <li t-if="question.active and ((user.id == question.create_uid.id and can_unlink_own) or can_unlink_all)">
514 <t t-call="website_forum.link_button">
515 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/delete'"/>
516 <t t-set="label" t-value="'Delete'"/>
517 <t t-set="classes" t-value="'text-muted fa-trash-o'"/>
520 <li t-if="not question.active and ((user.id == question.create_uid.id and can_unlink_own) or can_unlink_all)">
521 <t t-call="website_forum.link_button">
522 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/undelete'"/>
523 <t t-set="label" t-value="'Undelete'"/>
524 <t t-set="classes" t-value="'text-muted fa-trash-o'"/>
530 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{question.create_uid.id}/avatar"/>
532 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
533 t-field="question.create_uid"
534 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
535 style="display: inline-block;"/>
536 <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
537 <span class="text-muted">Asked on <span t-field="question.create_date" t-field-options='{"format":"short"}'/></span>
540 <div class="visible-xs text-center">
541 <t t-call="website_forum.vote">
542 <t t-set="post" t-value="question"/>
544 <div class="text-muted text-center">
545 <span t-field="question.views"/> Views
548 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
549 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
553 <t t-call="website_forum.post_comment">
554 <t t-set="object" t-value="question"/>
560 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
561 <a t-attf-id="answer-#{str(answer.id)}"/>
562 <div t-attf-class="forum_answer" t-attf-id="answer_#{answer.id}" >
563 <div class="col-md-2 hidden-xs text-center">
564 <t t-call="website_forum.vote">
565 <t t-set="post" t-value="answer"/>
567 <div class="text-muted mt8">
568 <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'}"
569 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
572 <div class="col-md-10 clearfix">
573 <t t-raw="answer.content"/>
575 <ul class="list-inline pull-right">
576 <li t-if="user.id == answer.create_uid.id or user.karma>=50">
577 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
578 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
581 <li t-if="(user.id == answer.create_uid.id and can_edit_own) or can_edit_all">
582 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/edit"> Edit</a>
584 <li t-if="(user.id == answer.create_uid.id and can_unlink_own) or can_unlink_all">
585 <t t-call="website_forum.link_button">
586 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/delete'"/>
587 <t t-set="label" t-value="'Delete'"/>
588 <t t-set="classes" t-value="'text-muted fa-trash-o'"/>
591 <li t-if="user.id == answer.create_uid.id">
592 <t t-call="website_forum.link_button">
593 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/convert_to_comment'"/>
594 <t t-set="label" t-value="'Convert as a comment'"/>
595 <t t-set="classes" t-value="'text-muted fa-magic'"/>
599 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{answer.create_uid.id}/avatar"/>
601 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ answer.create_uid.id }"
602 t-field="answer.create_uid"
603 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
604 style="display: inline-block;"/>
605 <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
606 <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
608 <div class="visible-xs text-center">
609 <t t-call="website_forum.vote">
610 <t t-set="post" t-value="answer"/>
612 <div class="text-muted mt8">
613 <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'}"
614 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
618 <t t-call="website_forum.post_comment">
619 <t t-set="object" t-value="answer"/>
624 <div t-if="not question.uid_has_answered">
625 <t t-call="website_forum.post_answer"/>
627 <div t-if="question.uid_has_answered" class="mb16">
628 <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
629 <span class="text-muted">(only one answer per question is allowed)</span>
634 <!-- Utility template: Post a Comment -->
635 <template id="post_comment">
636 <div class="row clearfix">
637 <div class="col-sm-10 col-sm-offset-2">
638 <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
639 <small class="text-muted">
640 <button type="button" t-if="user.partner_id.id == message.author_id.id and user.karma>=750"
641 t-attf-data-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/delete"
642 class="close comment_delete">&times;</button>
643 <span t-field="message.body"/>
644 <t t-call="website_forum.link_button">
645 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/convert_to_answer'"/>
646 <t t-set="label" t-value="'Convert as an answer'"/>
647 <t t-set="classes" t-value="'text-muted fa-magic pull-right'"/>
649 <a t-attf-href="/forum/#{slug(forum)}/partner/#{message.author_id.id}"
650 t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
651 style="display: inline-block;"/>
652 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
655 <div class="css_editable_mode_hidden">
656 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
657 t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
658 <input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
659 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
660 <button type="submit" class="btn btn-primary mt8">Post</button>
668 <t t-call="website_forum.header">
672 <p class="text-muted">
673 A tag is a label that categorizes your question with other,
674 similar questions. Using the right tags makes it easier for
675 others to find and answer your question.
678 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
679 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
680 <span t-field="tag.name"/>
683 X <t t-esc="tag.posts_count"/>
690 <template id="badge">
691 <t t-call="website_forum.header">
696 Besides gaining reputation with your questions and answers,
697 you receive badges for being especially helpful. Badges
698 appear on your profile page, and your posts.
700 <table class="table mt32 mb64">
701 <tr t-foreach="badges" t-as="badge">
703 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
704 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
705 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
706 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
707 <span t-field="badge.name"/>
710 <b t-esc="badge.stat_count_distinct"/>
711 <i class="text-muted">awarded users</i>
713 <span t-field="badge.description"/>
720 <template id="badge_user">
721 <t t-call="website_forum.header">
722 <h3 class="mt32 mb32">
723 <b>Badge "<span t-field="badge.name"/>"</b>
726 <div class="pull-left badge">
727 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
728 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
729 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
730 <span t-field="badge.name"/>
732 <span t-field="badge.description" style="margin-left:20px"/>
735 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
736 <span t-if="badge.stat_count_distinct>1">users</span>
737 <span t-if="badge.stat_count_distinct<=1">user</span>
741 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
742 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
744 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
751 <template id="users">
752 <t t-call="website_forum.header">
753 <div t-foreach="users" t-as="row_users" class="row mt16">
754 <div t-foreach="row_users" t-as="user" class="col-sm-4">
755 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
757 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
758 <t t-if="user.country_id">
759 <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
761 <b><t t-esc="user.karma"/></b>
762 <t t-raw="separator"/>
765 <span class="fa fa-circle badge-gold"/>
766 <t t-esc="user.gold_badge"/>
767 <span class="fa fa-circle badge-silver"/>
768 <t t-esc="user.silver_badge"/>
769 <span class="fa fa-circle badge-bronze"/>
770 <t t-esc="user.bronze_badge"/>
776 <div class="pull-left">
777 <t t-call="website.pager"/>
782 <template id="edit_profile">
783 <t t-call="website_forum.header">
784 <h3>Edit Profile </h3>
785 <div class="col-md-2">
786 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
788 <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
789 <input name="user_id" t-att-value="user.id" type="hidden"/>
790 <label class="col-md-2 control-label mb16" for="user.name">Real name</label>
791 <div class="col-md-7 mb16">
792 <input type="text" class="col-md-7 mb16 form-control" name="name" required="True" t-attf-value="#{user.name}"/>
794 <label class="col-md-2 control-label mb16" for="user.partner_id.website">Website</label>
795 <div class="col-md-7 mb16">
796 <input type="text" class="form-control" name="website" t-attf-value="#{user.partner_id.website or ''}"/>
798 <label class="col-md-4 control-label mb16" for="user.partner_id.email">Email</label>
799 <div class="col-md-7 mb16">
800 <input type="text" class="form-control" name="email" required="True" t-attf-value="#{user.partner_id.email}"/>
802 <label class="col-md-4 control-label mb16" for="user.partner_id.city">City</label>
803 <div class="col-md-7 mb16">
804 <input type="text" class="form-control" name="city" t-attf-value="#{user.partner_id.city or ''}"/>
806 <label class="col-md-4 control-label mb16" for="contact_name">Country</label>
807 <div class="col-md-7 mb16">
808 <select class="form-control" name="country">
809 <option value="">Country...</option>
810 <t t-foreach="countries or []" t-as="country">
811 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country_id.id"><t t-esc="country.name"/></option>
815 <!--Note: using website_description fiels instead of using commnt firld of partner-->
816 <label class="col-md-4 control-label mb16" for="user.partner_id.website_description">Biography</label>
817 <div class="col-md-7 mb16">
818 <textarea name="description" style="min-height: 120px" required="True"
819 class="form-control"><t t-esc="user.partner_id.website_description"/></textarea>
821 <div class="col-sm-offset-4 col-md-4 mb16">
822 <button class="btn btn-primary btn-lg">Update</button>
828 <template id="user_detail_full">
829 <t t-call="website_forum.header">
830 <h1 class="mt0 page-header">
831 <span t-field="user.name"/>
832 <small>profile</small>
835 <div class="col-sm-2">
836 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
838 <div class="col-sm-10">
839 <table class="table table-condensed">
841 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
842 <td>member since</td>
843 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
845 <td>last connection</td>
846 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
849 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
852 <a t-att-href="user.website" t-if="user.website">
853 <span t-field="user.website"/>
859 <span t-field="user.city"/>
860 <span t-if="user.city and user.country_id">, </span>
861 <span t-field="user.country_id"/>
862 <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
867 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
869 <td><span t-field="user.karma"/></td>
873 <span class="fa fa-thumbs-up"/>
874 <span t-esc="up_votes"/>
875 <span class="fa fa-thumbs-down"/>
876 <span t-esc="down_votes"/>
880 <div class="well well-sm">
881 <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
882 <t t-if="uid == user.id">
883 <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
889 <ul class="nav nav-tabs">
891 <a href="#questions" data-toggle="tab"><t t-esc="len(questions)"/> Questions</a>
894 <a href="#answers" data-toggle="tab"><t t-esc="len(answers)"/> Answers</a>
896 <li t-if="uid == user.id">
897 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
899 <li t-if="uid == user.id">
900 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
902 <li t-if="uid == user.id">
903 <a href="#activity" data-toggle="tab">Activity</a>
906 <a href="#badges" data-toggle="tab">Badges</a>
908 <li t-if="uid == user.id">
909 <a href="#votes" data-toggle="tab">Votes</a>
912 <div class="tab-content mt16">
913 <div class="tab-pane active" id="questions">
914 <div class="mb16" t-foreach="questions" t-as="question">
915 <t t-call="website_forum.display_post"/>
917 </div><div class="tab-pane" id="answers">
918 <div t-foreach="answers" t-as="answer">
919 <t t-call="website_forum.display_post_answer"/>
922 <div class="tab-pane" id="karma">
925 <div class="tab-pane" id="badges">
926 <t t-call="website_forum.user_badges"/>
928 <div class="tab-pane" id="favourite_question">
929 <div t-foreach="favourite" t-as="question">
930 <t t-call="website_forum.display_post"/>
933 <div class="tab-pane" id="followed_question">
934 <div t-foreach="followed" t-as="question" class="mb16">
935 <t t-call="website_forum.display_post"/>
938 <div class="tab-pane" id="votes">
939 <t t-call="website_forum.user_votes"/>
941 <div class="tab-pane" id="activity">
942 <ul class="list-unstyled">
943 <li t-foreach="activities" t-as="activity">
944 <span t-field="activity.date" t-field-options='{"format": "short"}'/>
945 <span t-esc="activity.subtype_id.name" class="label label-info"/>
946 <t t-set="post" t-value="posts[activity.res_id]"/>
947 <span t-if="post[1]">
948 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
949 <span t-esc="post[0].name"/>
952 <span t-if="not post[1]">
953 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
954 <span t-esc="post[0].name"/>
964 <template id="user_badges">
965 <table class="table mt32 mb64">
966 <tr t-foreach="user.badge_ids" t-as="badge">
968 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
969 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
970 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
971 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
972 <span t-field="badge.badge_id.name"/>
975 <b t-esc="badge.badge_id.stat_count_distinct"/>
976 <i class="text-muted">awarded users</i>
978 <span t-field="badge.badge_id.description"/>
982 <div class="mb16" t-if="not user.badge_ids">
983 <b>No badge yet!</b><br/>
984 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
988 <template id="user_votes">
989 <div t-foreach="vote_post" t-as="vote">
990 <t t-esc="vote.post_id.create_date"/>
991 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
992 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
993 <t t-if="vote.post_id.parent_id">
994 <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"/>
996 <t t-if="not vote.post_id.parent_id">
997 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
1000 <div class="mb16" t-if="not vote_post">
1001 <b>No vote given by you yet!</b>