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="header" name="Forum Index">
27 <t t-call="website.layout">
29 <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
30 <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
31 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
32 <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
33 <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
34 <script type="text/javascript">
35 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
36 ,['Outdent','Indent','Link','Unlink','Image'],] ;
39 <div class="container mt16">
40 <div class="navbar navbar-default">
41 <div class="navbar-header">
42 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
43 <span class="sr-only">Toggle navigation</span>
44 <span class="icon-bar"></span>
45 <!-- <span class="icon-bar"></span> -->
46 <span class="icon-bar"></span>
48 <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
49 <span t-field="forum.name"/>
52 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
53 <ul class="nav navbar-nav">
54 <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
55 <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
57 <li t-att-class="searches.get('users') and 'active' or '' ">
58 <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
60 <li t-att-class="searches.get('tags') and 'active' or '' ">
61 <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
63 <li t-att-class="searches.get('badges') and 'active' or '' ">
64 <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
67 <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
68 <div class="form-group">
69 <input type="search" class="form-control"
70 name="search" placeholder="Search a question..."
71 t-att-value="search or ''"/>
72 <button type="submit" class="btn btn-default">Search</button>
79 <div id="wrap" class="container">
81 <div class="col-sm-9">
82 <div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable">
83 <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
84 <div t-field="notification.body"/>
85 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }#badges" class="fa fa-arrow-right">View Your Badges</a>
89 <div class="col-sm-3" id="right-column">
90 <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>
91 <div class="panel panel-default" id="about_forum">
92 <div class="panel-heading">
93 <h3 class="panel-title">About This Forum</h3>
95 <div class="panel-body">
96 <t t-raw="forum.description"/><br/>
97 <a t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
100 <div t-if="header.get('question_data')">
101 <div class="panel panel-default">
102 <div class="panel-heading text-center">
103 <h3 class="panel-title">Question tools</h3>
105 <div class="panel-body text-center">
106 <t t-call="website_mail.follow"><t t-set="object" t-value="question"/></t>
108 <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower(s)
111 <div class="panel-heading text-center">
112 <h3 class="panel-title ">Stats</h3>
114 <div class="panel-body">
115 <table class="table">
116 <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
117 <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
118 <span t-if="question.views>1">times</span>
119 <span t-if="question.views<=1">time</span>
121 <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
129 <div class="oe_structure"/>
133 <!-- Display a post -->
134 <template id="display_post">
135 <div class="question clearfix">
136 <div class="pull-left text-center">
137 <div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
138 <span t-esc="question.child_count"/>
139 <div t-if="question.child_count>1" class="subtitle">Answers</div>
140 <div t-if="question.child_count<=1" class="subtitle">Answer</div>
143 <div style="margin-left: 95px; margin-top:-8px;">
144 <div class="question-name">
145 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
146 <span t-if="not question.active"><b> [Deleted]</b></span>
147 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
149 <t t-foreach="question.tag_ids" t-as="tag">
150 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge pull-right" t-field="tag.name"/>
152 <div class="text-muted">
153 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
154 t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
155 style="display: inline-block;"/>
156 on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
157 with <b t-field="question.views"/> views
158 <span t-if="question.vote_count>0"> and
159 <b t-esc="question.vote_count or 0"/>
160 <t t-if="question.vote_count>1">votes</t>
161 <t t-if="question.vote_count==1">vote</t>
168 <!-- Display a post as an answer -->
169 <template id="display_post_answer">
170 <div class="clearfix">
171 <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
172 <div t-esc="len(answer.vote_ids)"/>
174 <div class="question-name" style="margin-left: 32px;">
175 <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"/>
176 <t t-if="len(answer.website_message_ids)>0">
177 (<t t-esc="len(answer.website_message_ids)"/>
178 <t t-if="len(answer.website_message_ids)>1">Comments</t>
179 <t t-if="len(answer.website_message_ids)<=1">Comment</t>)
187 <t t-call="website_forum.header">
188 <div t-field="forum.faq"/>
192 <!-- All Forums Layout -->
193 <template id="forum_all">
194 <t t-call="website.layout">
195 <div class="container">
196 <h1 class="mb32">Our forums</h1>
198 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
199 <a t-attf-href="/forum/#{ slug(forum) }">
200 <div class="fa fa-5x fa-comment mb16"/>
201 <div t-field="forum.name"/>
209 <!-- Specific Forum Layout -->
210 <template id="forum_index" name="Forum">
211 <t t-call="website_forum.header">
212 <h1 class="page-header mt0">
213 <t t-esc="len(question_ids)"/> <span>Questions</span>
215 <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
216 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
217 <t t-if="filters == 'all'">All</t>
218 <t t-if="filters == 'unanswered'">Unanswered</t>
219 <t t-if="filters == 'followed'">Followed</t>
220 <t t-if="filters == 'tag'">Tag</t>
221 <t t-if="sorting == 'date'"> by activity date</t>
222 <t t-if="sorting == 'answered'"> by most answered</t>
223 <t t-if="sorting == 'vote'"> by most voted</t>
226 <ul class="dropdown-menu">
227 <li class="dropdown-header">Filter on</li>
228 <li t-att-class="filters == 'all' and 'active' or '' ">
229 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
231 <li t-att-class="filters == 'unanswered' and 'active' or '' ">
232 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
234 <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
235 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
237 <li class="dropdown-header">Tags</li>
238 <li t-if="tag" t-att-class="tag and 'active' or '' ">
239 <a href=""><t t-esc="tag.name"/></a>
241 <li class="dropdown-header">Sort by</li>
242 <li t-att-class="sorting == 'date' and 'active' or '' ">
243 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
245 <li t-att-class="sorting == 'answered' and 'active' or '' ">
246 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
248 <li t-att-class="sorting == 'vote' and 'active' or '' ">
249 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
254 <div t-foreach="question_ids" t-as="question" class="mb16">
255 <t t-call="website_forum.display_post"/>
257 <t t-call="website.pager"/>
262 <t t-call="website_forum.header">
263 <div class="oe_structure oe_empty"/>
264 <h1 class="mt32">Question not found!</h1>
265 <p>Sorry, this question is not available anymore.</p>
267 <a t-attf-href="/forum">Return to the question list.</a>
272 <!-- Edition: ask your question -->
273 <template id="ask_question">
274 <t t-call="website_forum.header">
275 <h1 class="mt0">Ask your Question</h1>
277 <li> please, try to make your question interesting to others </li>
278 <li> provide enough details and, if possible, give an example </li>
279 <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
281 <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
282 <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
283 class="form-control" placeholder="Enter your Question"/>
284 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
285 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
286 <textarea name="content" required="True" class="form-control load_editor">
287 <t t-esc="question_content"/>
290 <input type="text" name="question_tags" placeholder="Tags" class="form-control load_tags"/>
292 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Question</button>
294 <script type="text/javascript">
295 CKEDITOR.replace("content");
300 <!-- Edition: edit a post -->
301 <template id="edit_post">
302 <t t-call="website_forum.header">
303 <h3 t-if="not is_answer">Edit question</h3>
304 <h3 t-if="is_answer">Edit answer</h3>
305 <form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
306 <div t-if="not is_answer">
307 <input type="text" name="question_name" id="question_name" required="True"
308 t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
309 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
311 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
312 <textarea name="content" required="True" class="form-control load_editor">
313 <t t-esc="post.content"/>
315 <div t-if="not is_answer">
317 <input type="text" name="question_tag" class="form-control col-md-9 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
320 <button class="btn btn-primary btn-lg">Save</button>
322 <script type="text/javascript">
323 CKEDITOR.replace("content");
328 <!-- Moderation: close a question -->
329 <template id="close_question">
330 <t t-call="website_forum.header">
331 <h1 class="mt0">Close question</h1>
332 <p class="text-muted">
333 If you close this question, it will be hidden for most users. Only
334 users having a high karma can see closed questions to moderate
337 <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(post)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
338 <input name="post_id" t-att-value="question.id" type="hidden"/>
339 <div class="form-group">
340 <label class="col-md-3 control-label" for="reason">Question:</label>
341 <div class="col-md-8 mt8">
342 <span t-field="post.name"/>
345 <div class="form-group">
346 <label class="col-md-3 control-label" for="reason">Reason:</label>
347 <div class="col-md-8">
348 <select class="form-control" name="reason_id">
349 <t t-foreach="reasons or []" t-as="reason">
350 <option t-att-value="reason.id" t-att-selected="reason.id == question.closed_reason_id.id"><t t-esc="reason.name"/></option>
355 <div class="form-group">
356 <div class="col-md-offset-3 col-md-8">
357 <button class="btn btn-primary">Close question</button>
358 <span class="text-muted">or</span>
359 <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post) }">back to question</a>
366 <!-- Edition: post an answer -->
367 <template id="post_answer">
368 <h3 class="mt10">Your answer</h3>
370 <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
371 <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
372 - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
373 - it really helps to select the best questions and answers!
375 <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
376 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
377 <textarea name="content" class="form-control load_editor" required="True"/>
378 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Answer</button>
380 <script type="text/javascript">
381 CKEDITOR.replace("content");
386 <div t-attf-class="box oe_grey">
387 <a t-attf-class="vote_up fa fa-thumbs-up no-decoration #{post.user_vote == 1 and 'text-success' or ''}"
388 t-attf-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
389 <span id="vote_count" t-esc="post.vote_count"/>
390 <a t-attf-class="vote_down fa fa-thumbs-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''}"
391 t-attf-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
392 <div t-if="vote_count > 1" class="subtitle">
395 <div t-if="vote_count < 2" class="subtitle">
401 <!-- Specific Post Layout -->
402 <template id="post_description_full" name="Question Navigation">
403 <t t-call="website_forum.header">
404 <div t-attf-class="question #{not question.active and 'alert alert-danger' or ''}">
405 <div class="text-center pull-left">
406 <t t-call="website_forum.vote">
407 <t t-set="post" t-value="question"/>
409 <div class="text-muted text-center">
410 <span t-field="question.views"/> Views
413 <a t-attf-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
414 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
417 <div style="margin-left: 95px;">
419 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
420 <span t-if="not question.active"><b> [Deleted]</b></span>
421 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
423 <div class="alert alert-info" t-if="question.state == 'close'">
424 <p class="mt32 mb16 text-center">
425 <b>The question has been closed for reason: <i t-esc="question.closed_reason_id.name"/>
427 <t t-if="question.closed_uid">
428 <i>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(question.closed_uid) }" t-field="question.closed_uid"/> </i>
430 on <span t-field="question.closed_date"/></b>
432 <div t-if="question.state == 'close' and user.karma>=500" class="mb24 text-center">
433 <a class="fa fa-arrow-right" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/reopen"> Reopen</a>
436 <t t-raw="question.content"/>
438 <div class="mt16 clearfix">
439 <div class="pull-right">
440 <div class="text-right">
441 <t t-foreach="question.tag_ids" t-as="tag">
442 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
445 <ul class="list-inline" id="options">
446 <li t-if="user.id == question.create_uid.id or user.karma>=50">
447 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
448 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
452 <li t-if="question.state != 'close' and ((user.id == question.create_uid.id and can_close_own) or can_close_all)">
453 <a class="text-muted fa fa-times" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/ask_for_close"> Close</a>
455 <li t-if="question.state == 'close' and ((user.id == question.create_uid.id and can_close_own) or can_close_all)">
456 <a class="text-muted fa fa-undo" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)/reopen"> Reopen</a>
458 <li t-if="(user.id == question.create_uid.id and can_edit_own) or can_edit_all">
459 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{ slug(forum) }/post/#{slug(question)}/edit"> Edit</a>
461 <li t-if="question.active and ((user.id == question.create_uid.id and can_unlink_own) or can_unlink_all)">
462 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/delete"> Delete</a>
464 <li t-if="not question.active and ((user.id == question.create_uid.id and can_unlink_own) or can_unlink_all)">
465 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/undelete"> Undelete</a>
470 <span t-field="question.create_uid.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
472 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }"
473 t-field="question.create_uid"
474 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
475 style="display: inline-block;"/>
476 <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
480 <t t-call="website_forum.post_comment">
481 <t t-set="object" t-value="question"/>
487 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
488 <a t-attf-id="answer-#{str(answer.id)}"/>
489 <div t-attf-class="forum_answer" t-attf-id="answer_#{answer.id}" >
490 <div class="text-center pull-left">
491 <t t-call="website_forum.vote">
492 <t t-set="post" t-value="answer"/>
494 <div class="text-muted mt8">
495 <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'}"
496 t-attf-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
499 <div style="margin-left: 95px;" class="clearfix">
500 <t t-raw="answer.content"/>
502 <ul class="list-inline pull-right">
503 <li t-if="user.id == answer.create_uid.id or user.karma>=50">
504 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
505 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
508 <li t-if="(user.id == answer.create_uid.id and can_edit_own) or can_edit_all">
509 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/edit"> Edit</a>
511 <li t-if="(user.id == answer.create_uid.id and can_unlink_own) or can_unlink_all">
512 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/delete"> Delete</a>
514 <li t-if="user.id == answer.create_uid.id">
515 <a class="text-muted fa fa-magic" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/convert_to_comment"> Convert as a comment</a>
518 <span t-field="answer.create_uid.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
520 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ answer.create_uid.id }"
521 t-field="answer.create_uid"
522 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
523 style="display: inline-block;"/>
524 <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
525 <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
528 <t t-call="website_forum.post_comment">
529 <t t-set="object" t-value="answer"/>
534 <div t-if="not question.uid_has_answered">
535 <t t-call="website_forum.post_answer"/>
537 <div t-if="question.uid_has_answered" class="mb16">
538 <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
539 <span class="text-muted">(only one answer per question is allowed)</span>
544 <!-- Utility template: Post a Comment -->
545 <template id="post_comment">
546 <div class="row clearfix">
547 <div class="col-sm-10 col-sm-offset-2">
548 <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
549 <small class="text-muted">
550 <button type="button" t-if="user.partner_id.id == message.author_id.id and user.karma>=750"
551 t-attf-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/delete"
552 class="close comment_delete">&times;</button>
553 <span t-field="message.body"/>
554 <a t-attf-href="/forum/#{slug(forum)}/partner/#{message.author_id.id}"
555 t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
556 style="display: inline-block;"/>
557 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
558 <a class="fa fa-magic text-muted pull-right"
559 t-attf-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/convert_to_answer">Convert as an answer</a>
562 <div class="css_editable_mode_hidden">
563 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
564 t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
565 <input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
566 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
567 <button type="submit" class="btn btn-primary mt8">Post</button>
575 <t t-call="website_forum.header">
579 <p class="text-muted">
580 A tag is a label that categorizes your question with other,
581 similar questions. Using the right tags makes it easier for
582 others to find and answer your question.
585 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
586 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
587 <span t-field="tag.name"/>
590 X <t t-esc="tag.posts_count"/>
597 <template id="badge">
598 <t t-call="website_forum.header">
603 Besides gaining reputation with your questions and answers,
604 you receive badges for being especially helpful. Badges
605 appear on your profile page, and your posts.
607 <table class="table mt32 mb64">
608 <tr t-foreach="badges" t-as="badge">
610 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
611 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
612 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
613 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
614 <span t-field="badge.name"/>
617 <b t-esc="badge.stat_count_distinct"/>
618 <i class="text-muted">awarded users</i>
620 <span t-field="badge.description"/>
627 <template id="badge_user">
628 <t t-call="website_forum.header">
629 <h3 class="mt32 mb32">
630 <b>Badge "<span t-field="badge.name"/>"</b>
633 <div class="pull-left badge">
634 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
635 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
636 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
637 <span t-field="badge.name"/>
639 <span t-field="badge.description" style="margin-left:20px"/>
642 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
643 <span t-if="badge.stat_count_distinct>1">users</span>
644 <span t-if="badge.stat_count_distinct<=1">user</span>
648 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
649 <span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
651 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
658 <template id="users">
659 <t t-call="website_forum.header">
661 <div t-foreach="users" t-as="user" class="col-sm-4">
662 <span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
664 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
665 <t t-if="user.country_id">
666 <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
668 <b><t t-esc="user.karma"/></b>
669 <t t-raw="separator"/>
672 <span class="fa fa-circle badge-gold"/>
673 <t t-esc="user.gold_badge"/>
674 <span class="fa fa-circle badge-silver"/>
675 <t t-esc="user.silver_badge"/>
676 <span class="fa fa-circle badge-bronze"/>
677 <t t-esc="user.bronze_badge"/>
683 <div class="pull-left">
684 <t t-call="website.pager"/>
689 <template id="edit_profile">
690 <t t-call="website_forum.header">
691 <h3>Edit Profile </h3>
692 <div class="col-md-2">
693 <span t-field="user.image" t-field-options='{"widget": "image", "class": "img img-responsive img-circle"}'/>
695 <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
696 <input name="user_id" t-att-value="user.id" type="hidden"/>
697 <label class="col-md-2 control-label mb16" for="user.name">Real name</label>
698 <div class="col-md-7 mb16">
699 <input type="text" class="col-md-7 mb16 form-control" name="name" required="True" t-attf-value="#{user.name}"/>
701 <label class="col-md-2 control-label mb16" for="user.partner_id.website">Website</label>
702 <div class="col-md-7 mb16">
703 <input type="text" class="form-control" name="website" t-attf-value="#{user.partner_id.website or ''}"/>
705 <label class="col-md-4 control-label mb16" for="user.partner_id.email">Email</label>
706 <div class="col-md-7 mb16">
707 <input type="text" class="form-control" name="email" required="True" t-attf-value="#{user.partner_id.email}"/>
709 <label class="col-md-4 control-label mb16" for="user.partner_id.city">City</label>
710 <div class="col-md-7 mb16">
711 <input type="text" class="form-control" name="city" t-attf-value="#{user.partner_id.city or ''}"/>
713 <label class="col-md-4 control-label mb16" for="contact_name">Country</label>
714 <div class="col-md-7 mb16">
715 <select class="form-control" name="country">
716 <option value="">Country...</option>
717 <t t-foreach="countries or []" t-as="country">
718 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country.id"><t t-esc="country.name"/></option>
722 <!--Note: using website_description fiels instead of using commnt firld of partner-->
723 <label class="col-md-4 control-label mb16" for="user.partner_id.website_description">Biography</label>
724 <div class="col-md-7 mb16">
725 <textarea name="description" style="min-height: 120px" required="True"
726 class="form-control"><t t-esc="user.partner_id.website_description"/></textarea>
728 <div class="col-sm-offset-4 col-md-4 mb16">
729 <button class="btn btn-primary btn-lg">Update</button>
735 <template id="user_detail_full">
736 <t t-call="website_forum.header">
737 <h1 class="mt0 page-header">
738 <span t-field="user.name"/>
739 <small>profile</small>
742 <div class="col-sm-2">
743 <span t-field="user.image"
744 t-field-options='{"widget": "image", "class": "img img-responsive img-circle"}'/>
746 <div class="col-sm-10">
747 <table class="table table-condensed">
749 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
750 <td>member since</td>
751 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
753 <td>last connection</td>
754 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
757 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
760 <a t-att-href="user.website" t-if="user.website">
761 <span t-field="user.website"/>
767 <span t-field="user.city"/>
768 <span t-if="user.city and user.country_id">, </span>
769 <span t-field="user.country_id"/>
770 <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
775 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
777 <td><span t-field="user.karma"/></td>
781 <span class="fa fa-thumbs-up"/>
782 <span t-esc="up_votes"/>
783 <span class="fa fa-thumbs-down"/>
784 <span t-esc="down_votes"/>
788 <div class="well well-sm">
789 <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
790 <t t-if="uid == user.id">
791 <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
797 <ul class="nav nav-tabs">
799 <a href="#questions" data-toggle="tab"><t t-esc="len(questions)"/> Questions</a>
802 <a href="#answers" data-toggle="tab"><t t-esc="len(answers)"/> Answers</a>
804 <li t-if="uid == user.id">
805 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
807 <li t-if="uid == user.id">
808 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
810 <li t-if="uid == user.id">
811 <a href="#activity" data-toggle="tab">Activity</a>
814 <a href="#badges" data-toggle="tab">Badges</a>
816 <li t-if="uid == user.id">
817 <a href="#votes" data-toggle="tab">Votes</a>
820 <div class="tab-content mt16">
821 <div class="tab-pane active" id="questions">
822 <div class="mb16" t-foreach="questions" t-as="question">
823 <t t-call="website_forum.display_post"/>
825 </div><div class="tab-pane" id="answers">
826 <div t-foreach="answers" t-as="answer">
827 <t t-call="website_forum.display_post_answer"/>
830 <div class="tab-pane" id="karma">
833 <div class="tab-pane" id="badges">
834 <t t-call="website_forum.user_badges"/>
836 <div class="tab-pane" id="favourite_question">
837 <div t-foreach="favourite" t-as="question">
838 <t t-call="website_forum.display_post"/>
841 <div class="tab-pane" id="followed_question">
842 <div t-foreach="followed" t-as="question" class="mb16">
843 <t t-call="website_forum.display_post"/>
846 <div class="tab-pane" id="votes">
847 <t t-call="website_forum.user_votes"/>
849 <div class="tab-pane" id="activity">
850 <ul class="list-unstyled">
851 <li t-foreach="activities" t-as="activity">
852 <span t-field="activity.date" t-field-options='{"format": "short"}'/>
853 <span t-esc="activity.subtype_id.name" class="label label-info"/>
854 <t t-set="post" t-value="posts[activity.res_id]"/>
855 <span t-if="post[1]">
856 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
857 <span t-esc="post[0].name"/>
860 <span t-if="not post[1]">
861 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
862 <span t-esc="post[0].name"/>
872 <template id="user_badges">
873 <table class="table mt32 mb64">
874 <tr t-foreach="user.badge_ids" t-as="badge">
876 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
877 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
878 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
879 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
880 <span t-field="badge.badge_id.name"/>
883 <b t-esc="badge.badge_id.stat_count_distinct"/>
884 <i class="text-muted">awarded users</i>
886 <span t-field="badge.badge_id.description"/>
890 <div class="mb16" t-if="not user.badge_ids">
891 <b>No badge yet!</b><br/>
892 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
896 <template id="user_votes">
897 <div t-foreach="vote_post" t-as="vote">
898 <t t-esc="vote.post_id.create_date"/>
899 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
900 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
901 <t t-if="vote.post_id.parent_id">
902 <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"/>
904 <t t-if="not vote.post_id.parent_id">
905 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
908 <div class="mb16" t-if="not vote_post">
909 <b>No vote given by you yet!</b>