1 <?xml version="1.0" encoding="utf-8"?>
5 <!-- Layout add nav and footer -->
6 <template id="header_footer_custom" inherit_id="website.footer_default"
7 name="Footer Questions Link">
8 <xpath expr="//ul[@id='products']" position="inside">
9 <li><a t-attf-href="/forum/%(website_forum.forum_help)d">Q&A</a></li>
10 <li><a href="/forum">Forums</a></li>
15 <template id="link_button">
16 <form method="POST" t-att-action="url">
17 <button t-attf-class="fa btn-link #{classes} #{karma and 'karma_required text-muted' or ''}" t-attf-data-karma="#{karma}">
18 <t t-esc="label"/></button>
22 <template id="assets_frontend" inherit_id="website.assets_frontend" name="website_forum assets">
23 <xpath expr="." position="inside">
24 <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
25 <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
26 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
27 <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
28 <!-- TODO in master - add select2 in asset front_end from website and remove from asset_editor. -->
29 <script type="text/javascript" src="/web/static/lib/select2/select2.js"></script>
30 <link rel="stylesheet" href="/web/static/lib/select2/select2.css"/>
31 <link rel="stylesheet" href="/website/static/lib/select2-bootstrap-css/select2-bootstrap.css"/>
35 <template id="assets_editor" inherit_id="website.assets_editor" name="Forum Editor" groups="base.group_user">
36 <xpath expr="." position="inside">
37 <script type="text/javascript" src="/website_forum/static/src/js/website.tour.forum.js"/>
38 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.editor.js"/>
43 <template id="header" name="Forum Index">
44 <t t-call="website.layout">
46 <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
47 <script type="text/javascript">
48 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
49 ,['Outdent','Indent','Link','Unlink','Image'],] ;
52 <div class="container mt16 website_forum">
53 <div class="navbar navbar-default">
54 <div class="navbar-header">
55 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
56 <span class="sr-only">Toggle navigation</span>
57 <span class="icon-bar"></span>
58 <!-- <span class="icon-bar"></span> -->
59 <span class="icon-bar"></span>
61 <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
62 <span t-field="forum.name"/>
65 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
66 <ul class="nav navbar-nav">
67 <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
68 <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
70 <li t-att-class="searches.get('users') and 'active' or '' ">
71 <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
73 <li t-att-class="searches.get('tags') and 'active' or '' ">
74 <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
76 <li t-att-class="searches.get('badges') and 'active' or '' ">
77 <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
79 <li t-if="not is_public_user" t-att-class="searches.get('my_profile') and 'active' or '' ">
80 <a t-attf-href="/forum/#{ slug(forum) }/user/#{uid}">My Profile</a>
83 <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
84 <div class="form-group">
85 <input type="search" class="form-control"
86 name="search" placeholder="Search a question..."
87 t-att-value="search or ''"/>
88 <button type="submit" class="btn btn-default">Search</button>
95 <div id="wrap" class="container">
97 <div class="col-sm-9">
98 <div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable">
99 <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
100 <div t-field="notification.body"/>
101 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }#badges" class="fa fa-arrow-right">View Your Badges</a>
103 <div t-if="not validation_email_sent and not is_public_user and user.karma == 0" class="alert alert-danger alert-dismissable">
104 <button type="button" class="close validation_email_close" data-dismiss="alert" aria-hidden="true">&times;</button>
107 It appears your email has not been verified.
108 <a class="send_validation_email" href="#" t-att-forum-id="forum.id">Click here to send a verification email allowing you to participate to the forum.</a>
112 <div t-if="validation_email_done" class="alert alert-success alert-dismissable">
113 <button type="button" class="close validated_email_close" data-dismiss="alert" aria-hidden="true">&times;</button>
115 <p>Congratulations! Your email has just been validated. You may now participate to our forums.</p>
120 <div class="col-sm-3" id="right-column">
121 <a t-if="not header.get('ask_hide')"
122 t-attf-class="btn btn-primary btn-lg btn-block mb16 #{(user.karma < forum.karma_ask) and 'karma_required' or ''}"
123 t-attf-href="/forum/#{slug(forum)}/ask"
124 t-attf-data-karma="#{forum.karma_ask}">Ask a Question</a>
125 <div class="panel panel-default">
126 <div class="panel-heading">
127 <h3 class="panel-title">Keep Informed</h3>
129 <div class="panel-body">
130 <t t-call="website_mail.follow">
131 <t t-set="email" t-value="user.email"/>
132 <t t-set="object" t-value="forum"/>
136 <div class="panel panel-default" id="about_forum">
137 <div class="panel-heading">
138 <h3 class="panel-title">About This Forum</h3>
140 <div class="panel-body">
141 <t t-raw="forum.description"/>
142 <a t-if="not header.get('is_guidelines')" t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
143 <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>
146 <div t-if="header.get('question_data')">
147 <div class="panel panel-default">
148 <div class="panel-heading text-center">
149 <h3 class="panel-title">Question tools</h3>
151 <div class="panel-body text-center">
152 <t t-call="website_mail.follow"><t t-set="object" t-value="question"/></t>
154 <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower(s)
157 <div class="panel-heading text-center">
158 <h3 class="panel-title ">Stats</h3>
160 <div class="panel-body">
161 <table class="table">
162 <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
163 <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
164 <span t-if="question.views>1">times</span>
165 <span t-if="question.views<=1">time</span>
167 <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
175 <div class="oe_structure"/>
179 <!-- Display a post -->
180 <template id="display_post">
181 <div class="question row">
182 <div class="col-md-2 hidden-xs text-center">
183 <div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
184 <span t-esc="question.child_count"/>
185 <div t-if="question.child_count>1" class="subtitle">Answers</div>
186 <div t-if="question.child_count<=1" class="subtitle">Answer</div>
189 <div class="col-md-10 clearfix">
190 <div class="question-name">
191 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
192 <span t-if="not question.active"><b> [Deleted]</b></span>
193 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
195 <t t-foreach="question.tag_ids" t-as="question_tag">
196 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{slug(question_tag)}/questions">
197 <span t-attf-class="pull-right badge #{tag and tag.name == question_tag.name and 'badge-active' ''}" t-field="question_tag.name"
198 style="margin-right: 4px;"/>
201 <div class="text-muted">
202 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
203 t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
204 style="display: inline-block;"/>
205 on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
206 <span class="visible-xs">
207 <b t-esc="question.child_count or 0"/>
208 <t t-if="question.child_count>1">answers</t>
209 <t t-if="question.child_count==1">answers</t>
211 with <b t-field="question.views"/> views
212 <span t-if="question.vote_count>0"> and
213 <b t-esc="question.vote_count or 0"/>
214 <t t-if="question.vote_count>1">votes</t>
215 <t t-if="question.vote_count==1">vote</t>
222 <!-- Display a post as an answer -->
223 <template id="display_post_answer">
224 <div class="clearfix">
225 <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
226 <div t-esc="len(answer.vote_ids)"/>
228 <div class="question-name" style="margin-left: 32px;">
229 <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"/>
230 <t t-if="len(answer.website_message_ids)>0">
231 (<t t-esc="len(answer.website_message_ids)"/>
232 <t t-if="len(answer.website_message_ids)>1">Comments</t>
233 <t t-if="len(answer.website_message_ids)<=1">Comment</t>)
241 <t t-call="website_forum.header">
242 <div t-field="forum.faq"/>
246 <!-- All Forums Layout -->
247 <template id="forum_all">
248 <t t-call="website.layout">
249 <div class="container">
250 <h1 class="mb32">Our forums</h1>
252 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
253 <a t-attf-href="/forum/#{ slug(forum) }">
254 <div class="fa fa-5x fa-comment mb16"/>
255 <div t-field="forum.name"/>
263 <!-- Specific Forum Layout -->
264 <template id="forum_index" name="Forum">
265 <t t-call="website_forum.header">
266 <h1 class="page-header mt0">
267 <t t-esc="question_count"/> <span>Questions</span>
269 <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
270 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
271 <t t-if="filters == 'all'">All</t>
272 <t t-if="filters == 'unanswered'">Unanswered</t>
273 <t t-if="filters == 'followed'">Followed</t>
274 <t t-if="tag"><span t-field="tag.name"/></t>
275 <t t-if="sorting == 'date'"> by activity date</t>
276 <t t-if="sorting == 'creation'"> by creation date</t>
277 <t t-if="sorting == 'answered'"> by most answered</t>
278 <t t-if="sorting == 'vote'"> by most voted</t>
281 <ul class="dropdown-menu">
282 <li class="dropdown-header">Filter on</li>
283 <li t-att-class="filters == 'all' and 'active' or '' ">
284 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
286 <li t-att-class="filters == 'unanswered' and 'active' or '' ">
287 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
289 <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
290 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
292 <li class="dropdown-header">Tags</li>
293 <li t-if="tag" t-att-class="tag and 'active' or '' ">
294 <a href=""><t t-esc="tag.name"/></a>
296 <li class="dropdown-header">Sort by</li>
297 <li t-att-class="sorting == 'date' and 'active' or '' ">
298 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
300 <li t-att-class="sorting == 'creation' and 'active' or '' ">
301 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='creation')">Newest</a>
303 <li t-att-class="sorting == 'answered' and 'active' or '' ">
304 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
306 <li t-att-class="sorting == 'vote' and 'active' or '' ">
307 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
312 <div t-foreach="question_ids" t-as="question" class="mb16">
313 <t t-call="website_forum.display_post"/>
315 <t t-call="website.pager"/>
320 <t t-call="website_forum.header">
321 <div class="oe_structure oe_empty"/>
322 <h1 class="mt32">Question not found!</h1>
323 <p>Sorry, this question is not available anymore.</p>
325 <a t-attf-href="/forum">Return to the question list.</a>
330 <!-- Edition: ask your question -->
331 <template id="ask_question">
332 <t t-call="website_forum.header">
333 <h1 class="mt0">Ask your Question</h1>
335 <li> please, try to make your question interesting to others </li>
336 <li> provide enough details and, if possible, give an example </li>
337 <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
339 <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
340 <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
341 class="form-control" placeholder="Enter your Question"/>
342 <h5 class="mt20">Please enter a descriptive question (should finish with a '?')</h5>
343 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
344 <input type="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/>
345 <textarea name="content" required="True" class="form-control load_editor">
346 <t t-esc="question_content"/>
349 <input type="hidden" name="tag_type" value="select2"/>
350 <input type="hidden" name="question_tags" placeholder="Tags" class="form-control js_select2"/>
352 <button t-attf-class="btn btn-primary #{(user.karma < forum.karma_ask) and 'karma_required' or ''}"
353 id="btn_ask_your_question" t-att-data-karma="forum.karma_ask">Post Your Question</button>
355 <script type="text/javascript">
356 CKEDITOR.replace("content");
361 <!-- Edition: edit a post -->
362 <template id="edit_post">
363 <t t-call="website_forum.header">
364 <h3 t-if="not is_answer">Edit question</h3>
365 <h3 t-if="is_answer">Edit answer</h3>
366 <form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
367 <div t-if="not is_answer">
368 <input type="text" name="question_name" id="question_name" required="True"
369 t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
370 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
372 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
373 <input type="hidden" name="karma_retag" t-attf-value="#{forum.karma_retag}" id="karma_retag"/>
374 <textarea name="content" required="True" class="form-control load_editor">
375 <t t-esc="post.content"/>
377 <div t-if="not is_answer">
379 <input type="hidden" name="tag_type" value="select2"/>
380 <input type="hidden" name="question_tag" class="form-control col-md-9 js_select2" placeholder="Tags" t-attf-value="#{tags}"/>
383 <button class="btn btn-primary btn-lg">Save</button>
385 <script type="text/javascript">
386 CKEDITOR.replace("content");
391 <!-- Moderation: close a question -->
392 <template id="close_question">
393 <t t-call="website_forum.header">
394 <h1 class="mt0">Close question</h1>
395 <p class="text-muted">
396 If you close this question, it will be hidden for most users. Only
397 users having a high karma can see closed questions to moderate
400 <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
401 <input name="post_id" t-att-value="question.id" type="hidden"/>
402 <div class="form-group">
403 <label class="col-md-3 control-label" for="reason">Question:</label>
404 <div class="col-md-8 mt8">
405 <span t-field="question.name"/>
408 <div class="form-group">
409 <label class="col-md-3 control-label" for="reason">Reason:</label>
410 <div class="col-md-8">
411 <select class="form-control" name="reason_id">
412 <t t-foreach="reasons or []" t-as="reason">
413 <option t-att-value="reason.id" t-att-selected="reason.id == question.closed_reason_id.id"><t t-esc="reason.name"/></option>
418 <div class="form-group">
419 <div class="col-md-offset-3 col-md-8">
420 <button class="btn btn-primary">Close question</button>
421 <span class="text-muted">or</span>
422 <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }">back to question</a>
429 <!-- Edition: post an answer -->
430 <template id="post_answer">
431 <h3 class="mt10">Your answer</h3>
433 <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
434 <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
435 - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
436 - it really helps to select the best questions and answers!
438 <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
439 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
440 <textarea name="content" class="form-control load_editor" required="True"/>
441 <button t-attf-class="btn btn-primary mt16 #{not question.can_answer and 'karma_required' or ''}"
442 id="btn_ask_your_question" t-att-data-karma="question.karma_answer">Post Your Answer</button>
444 <script type="text/javascript">
445 CKEDITOR.replace("content");
450 <div t-attf-class="box oe_grey">
451 <a t-attf-class="vote_up fa fa-thumbs-up no-decoration #{post.user_vote == 1 and 'text-success' or ''} #{((post.user_vote == 1 and not post.can_downvote) or not post.can_upvote) and 'karma_required' or ''}"
452 t-attf-data-karma="#{post.user_vote == 1 and post.karma_downvote or post.karma_upvote}"
453 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
454 <span id="vote_count" t-esc="post.vote_count"/>
455 <a t-attf-class="vote_down fa fa-thumbs-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''} #{((post.user_vote == -1 and not post.can_upvote) or not post.can_downvote) and 'karma_required' or ''}"
456 t-attf-data-karma="#{post.user_vote == -1 and post.karma_upvote or post.karma_downvote}"
457 t-attf-data-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
458 <div t-if="vote_count > 1" class="subtitle">
461 <div t-if="vote_count < 2" class="subtitle">
467 <!-- Specific Post Layout -->
468 <template id="post_description_full" name="Question Navigation">
469 <t t-call="website_forum.header">
470 <div t-attf-class="row question #{not question.active and 'alert alert-danger' or ''}">
471 <div class="col-md-2 hidden-xs text-center">
472 <t t-call="website_forum.vote">
473 <t t-set="post" t-value="question"/>
475 <div class="text-muted text-center">
476 <span t-field="question.views"/> Views
479 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
480 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
483 <div class="col-md-10">
485 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
486 <span t-if="not question.active"><b> [Deleted]</b></span>
487 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
489 <div class="alert alert-info text-center" t-if="question.state == 'close'">
491 <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>
493 <t t-if="question.closed_uid">
494 <b>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.closed_uid.id }"
495 t-field="question.closed_uid"
496 t-field-options='{"widget": "contact", "fields": ["name"]}'
497 style="display: inline-block;"/></b>
499 <b>on <span t-field="question.closed_date"/></b>
500 <div class="mt16 mb24 text-center">
501 <t t-call="website_forum.link_button">
502 <t t-set="url" t-value="'/forum/' + slug(forum) + '/question/' + slug(question) + '/reopen'"/>
503 <t t-set="label" t-value="'Reopen'"/>
504 <t t-set="classes" t-value="'fa-arrow-right'"/>
505 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
509 <t t-raw="question.content"/>
510 <div class="mt16 clearfix">
511 <div class="pull-right">
512 <div class="text-right">
513 <t t-foreach="question.tag_ids" t-as="tag">
514 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
517 <ul class="list-inline" id="options">
519 <a style="cursor: pointer" t-att-data-toggle="question.can_comment and 'collapse' or ''"
520 t-attf-class="fa fa-comment-o #{not question.can_comment and 'karma_required text-muted' or ''}"
521 t-attf-data-karma="#{not question.can_comment and question.karma_comment or 0}"
522 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
526 <li t-if="question.state != 'close'">
527 <t t-call="website_forum.link_button">
528 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/ask_for_close'"/>
529 <t t-set="label" t-value="'Close'"/>
530 <t t-set="classes" t-value="'fa-times'"/>
531 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
534 <li t-if="question.state == 'close'">
535 <t t-call="website_forum.link_button">
536 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/reopen'"/>
537 <t t-set="label" t-value="'Reopen'"/>
538 <t t-set="classes" t-value="'fa-undo'"/>
539 <t t-set="karma" t-value="not question.can_close and question.karma_close or 0"/>
543 <t t-call="website_forum.link_button">
544 <t t-set="url" t-value="'/forum/' + slug(forum) +'/post/' + slug(question) + '/edition'"/>
545 <t t-set="label" t-value="'Edit'"/>
546 <t t-set="classes" t-value="'fa-edit'"/>
547 <t t-set="karma" t-value="not question.can_edit and question.karma_edit or 0"/>
550 <li t-if="question.active">
551 <t t-call="website_forum.link_button">
552 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/delete'"/>
553 <t t-set="label" t-value="'Delete'"/>
554 <t t-set="classes" t-value="'fa-trash-o'"/>
555 <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
558 <li t-if="not question.active">
559 <t t-call="website_forum.link_button">
560 <t t-set="url" t-value="'/forum/' + slug(forum) +'/question/' + slug(question) + '/undelete'"/>
561 <t t-set="label" t-value="'Undelete'"/>
562 <t t-set="classes" t-value="'fa-trash-o'"/>
563 <t t-set="karma" t-value="not question.can_unlink and question.karma_unlink or 0"/>
569 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{question.create_uid.id}/avatar"/>
571 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
572 t-field="question.create_uid"
573 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
574 style="display: inline-block;"/>
575 <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
576 <span class="text-muted">Asked on <span t-field="question.create_date" t-field-options='{"format":"short"}'/></span>
579 <div class="visible-xs text-center">
580 <t t-call="website_forum.vote">
581 <t t-set="post" t-value="question"/>
583 <div class="text-muted text-center">
584 <span t-field="question.views"/> Views
587 <a t-attf-data-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
588 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
592 <t t-call="website_forum.post_comment">
593 <t t-set="object" t-value="question"/>
599 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
600 <a t-attf-id="answer-#{str(answer.id)}"/>
601 <div t-attf-class="forum_answer row" t-attf-id="answer_#{answer.id}" >
602 <div class="col-md-2 hidden-xs text-center">
603 <t t-call="website_forum.vote">
604 <t t-set="post" t-value="answer"/>
606 <div class="text-muted mt8">
607 <a t-attf-class="accept_answer fa fa-2x fa-check-circle no-decoration #{answer.is_correct and 'oe_answer_true' or 'oe_answer_false'} #{not answer.can_accept and 'karma_required' or ''}"
608 t-attf-data-karma="#{answer.karma_accept}"
609 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
612 <div class="col-md-10 clearfix">
613 <t t-raw="answer.content"/>
615 <ul class="list-inline pull-right">
617 <a t-attf-class="fa fa-comment-o #{not answer.can_comment and 'karma_required text-muted' or ''}"
618 t-attf-data-karma="#{not answer.can_comment and answer.karma_comment or 0}"
619 style="cursor: pointer" t-att-data-toggle="answer.can_comment and 'collapse' or ''"
620 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
624 <t t-call="website_forum.link_button">
625 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/edit'"/>
626 <t t-set="label" t-value="'Edit'"/>
627 <t t-set="classes" t-value="'fa fa-edit'"/>
628 <t t-set="karma" t-value="not answer.can_edit and answer.karma_edit or 0"/>
632 <t t-call="website_forum.link_button">
633 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/delete'"/>
634 <t t-set="label" t-value="'Delete'"/>
635 <t t-set="classes" t-value="'fa-trash-o'"/>
636 <t t-set="karma" t-value="not answer.can_unlink and answer.karma_unlink or 0"/>
640 <t t-call="website_forum.link_button">
641 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(answer) + '/convert_to_comment'"/>
642 <t t-set="label" t-value="'Convert as a comment'"/>
643 <t t-set="classes" t-value="'fa-magic'"/>
644 <t t-set="karma" t-value="not answer.can_comment_convert and answer.karma_comment_convert or 0"/>
648 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{answer.create_uid.id}/avatar"/>
650 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ answer.create_uid.id }"
651 t-field="answer.create_uid"
652 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
653 style="display: inline-block;"/>
654 <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
655 <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
657 <div class="visible-xs text-center">
658 <t t-call="website_forum.vote">
659 <t t-set="post" t-value="answer"/>
661 <div class="text-muted mt8">
662 <a t-attf-class="accept_answer fa fa-2x fa-check-circle no-decoration #{answer.is_correct and 'oe_answer_true' or 'oe_answer_false'} #{not answer.can_accept and 'karma_required' or ''}"
663 t-attf-data-karma="#{answer.karma_accept}"
664 t-attf-data-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
668 <t t-call="website_forum.post_comment">
669 <t t-set="object" t-value="answer"/>
674 <div t-if="not question.uid_has_answered">
675 <t t-call="website_forum.post_answer"/>
677 <div t-if="question.uid_has_answered" class="mb16">
678 <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
679 <span class="text-muted">(only one answer per question is allowed)</span>
684 <!-- Utility template: Post a Comment -->
685 <template id="post_comment">
686 <div class="row clearfix">
687 <div class="col-sm-10 col-sm-offset-2">
688 <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
689 <small class="text-muted">
690 <t t-set="required_karma" t-value="message.author_id.id == user.partner_id.id and object.forum_id.karma_comment_unlink_own or object.forum_id.karma_comment_unlink_all"/>
691 <t t-call="website_forum.link_button">
692 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/delete'"/>
693 <t t-set="label" t-value="' '"/>
694 <t t-set="karma" t-value="user.karma<required_karma and required_karma or 0"/>
695 <t t-set="classes" t-value="'close comment_delete fa-times'"/>
698 <span t-field="message.body"/>
699 <t t-set="required_karma" t-value="message.author_id.id == user.partner_id.id and object.forum_id.karma_comment_convert_own or object.forum_id.karma_comment_convert_all"/>
700 <t t-call="website_forum.link_button">
701 <t t-set="url" t-value="'/forum/' + slug(forum) + '/post/' + slug(object) + '/comment/' + slug(message) + '/convert_to_answer'"/>
702 <t t-set="label" t-value="'Convert as an answer'"/>
703 <t t-set="karma" t-value="user.karma<required_karma and required_karma or 0"/>
704 <t t-set="classes" t-value="'fa-magic pull-right'"/>
706 <a t-attf-href="/forum/#{slug(forum)}/partner/#{message.author_id.id}"
707 t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
708 style="display: inline-block;"/>
709 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
712 <div class="css_editable_mode_hidden">
713 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
714 t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
715 <input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
716 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
717 <button type="submit" class="btn btn-primary mt8">Post</button>
725 <t t-call="website_forum.header">
729 <p class="text-muted">
730 A tag is a label that categorizes your question with other,
731 similar questions. Using the right tags makes it easier for
732 others to find and answer your question.
735 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
736 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
737 <span t-field="tag.name"/>
740 X <t t-esc="tag.posts_count"/>
747 <template id="badge">
748 <t t-call="website_forum.header">
753 Besides gaining reputation with your questions and answers,
754 you receive badges for being especially helpful. Badges
755 appear on your profile page, and your posts.
757 <table class="table mt32 mb64">
758 <tr t-foreach="badges" t-as="badge">
760 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
761 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
762 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
763 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
764 <span t-field="badge.name"/>
767 <b t-esc="badge.stat_count_distinct"/>
768 <i class="text-muted">awarded users</i>
770 <span t-field="badge.description"/>
777 <template id="badge_user">
778 <t t-call="website_forum.header">
779 <h3 class="mt32 mb32">
780 <b>Badge "<span t-field="badge.name"/>"</b>
783 <div class="pull-left badge">
784 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
785 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
786 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
787 <span t-field="badge.name"/>
789 <span t-field="badge.description" style="margin-left:20px"/>
792 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
793 <span t-if="badge.stat_count_distinct>1">users</span>
794 <span t-if="badge.stat_count_distinct<=1">user</span>
798 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
799 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
801 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
808 <template id="users">
809 <t t-call="website_forum.header">
810 <div t-foreach="users" t-as="row_users" class="row mt16">
811 <div t-foreach="row_users" t-as="user" class="col-sm-4">
812 <img class="pull-left img img-circle img-avatar" t-attf-src="/forum/user/#{user.id}/avatar"/>
814 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
815 <t t-if="user.country_id">
816 <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
818 <b><t t-esc="user.karma"/></b>
819 <t t-raw="separator"/>
822 <span class="fa fa-circle badge-gold"/>
823 <t t-esc="user.gold_badge"/>
824 <span class="fa fa-circle badge-silver"/>
825 <t t-esc="user.silver_badge"/>
826 <span class="fa fa-circle badge-bronze"/>
827 <t t-esc="user.bronze_badge"/>
833 <div class="pull-left">
834 <t t-call="website.pager"/>
839 <!--Private profile-->
840 <template id="private_profile">
841 <t t-call="website_forum.header">
842 <h1 class="mt32">This profile is private!</h1>
844 <a t-attf-href="/forum/#{slug(forum)}">Return to the question list.</a>
849 <template id="edit_profile">
850 <t t-call="website_forum.header">
851 <h3>Edit Profile</h3>
853 <div class="col-md-2">
854 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
856 <div class="col-md-10">
857 <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
858 <input name="user_id" t-att-value="user.id" type="hidden"/>
859 <div class="form-group">
860 <label class="col-md-2 control-label mb16" for="user_name">Real name</label>
861 <div class="col-md-8 mb16">
862 <input type="text" class="form-control" name="name" id="user_name" required="True" t-attf-value="#{user.name}"/>
865 <div class="form-group">
866 <label class="col-md-2 control-label mb16" for="user_website_published" t-if="user.id == uid">Public profile</label>
867 <div class="col-md-8 mb16" t-if="user.id == uid">
868 <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" t-if="not user.website_published"/>
869 <input type="checkbox" class="mt8" name="website_published" id="user_website_published" value="True" checked="checked" t-if="user.website_published"/>
872 <div class="form-group">
873 <label class="col-md-2 control-label mb16" for="user_website">Website</label>
874 <div class="col-md-8 mb16">
875 <input type="text" class="form-control" name="website" id="user_website" t-attf-value="#{user.partner_id.website or ''}"/>
878 <div class="form-group">
879 <div t-if="email_required" class="alert alert-danger alert-dismissable oe_forum_email_required">
880 <button type="button" class="close" data-dismiss="alert">x</button>
881 <p>Please enter a valid email address in order to receive notifications from answers or comments.</p>
883 <label class="col-md-2 control-label mb16" for="user_email">Email</label>
884 <div class="col-md-8 mb16">
885 <input type="text" class="form-control" name="email" id="user_email" required="True" t-attf-value="#{user.partner_id.email}"/>
888 <div class="form-group">
889 <label class="col-md-2 control-label mb16" for="user_city">City</label>
890 <div class="col-md-8 mb16">
891 <input type="text" class="form-control" name="city" id="user_city" t-attf-value="#{user.partner_id.city or ''}"/>
894 <div class="form-group">
895 <label class="col-md-2 control-label mb16">Country</label>
896 <div class="col-md-8 mb16">
897 <select class="form-control" name="country">
898 <option value="">Country...</option>
899 <t t-foreach="countries or []" t-as="country">
900 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country_id.id"><t t-esc="country.name"/></option>
905 <!--Note: using website_description fiels instead of using commnt firld of partner-->
906 <div class="form-group">
907 <label class="col-md-2 control-label mb16" for="description">Biography</label>
908 <div class="col-md-8 mb16">
909 <textarea name="description" id="description" style="min-height: 120px" required="True"
910 class="form-control load_editor"><t t-esc="user.partner_id.website_description"/></textarea>
913 <div class="col-sm-offset-2 col-md-2 mb16">
914 <button class="btn btn-primary btn-lg">Update</button>
919 <script type="text/javascript">
920 CKEDITOR.replace("description");
925 <template id="user_detail_full">
926 <t t-call="website_forum.header">
927 <h1 class="mt0 page-header">
928 <span t-field="user.name"/>
929 <small>profile</small>
930 <t t-call="website.publish_management" groups="base.group_website_publisher">
931 <t t-set="object" t-value="user"/>
935 <div class="col-sm-2">
936 <img class="img img-responsive img-circle" t-attf-src="/forum/user/#{user.id}/avatar"/>
938 <div class="col-sm-10">
939 <table class="table table-condensed">
941 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
942 <td>member since</td>
943 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
945 <td>last connection</td>
946 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
949 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
952 <a t-att-href="user.website" t-if="user.website">
953 <span t-field="user.website"/>
959 <span t-field="user.city"/>
960 <span t-if="user.city and user.country_id">, </span>
961 <span t-field="user.country_id"/>
962 <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
967 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
969 <td><span t-field="user.karma"/></td>
973 <span class="fa fa-thumbs-up"/>
974 <span t-esc="up_votes"/>
975 <span class="fa fa-thumbs-down"/>
976 <span t-esc="down_votes"/>
980 <div class="well well-sm">
981 <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
982 <t t-if="uid == user.id">
983 <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
989 <ul class="nav nav-tabs">
991 <a href="#questions" data-toggle="tab"><t t-esc="count_questions"/> Questions</a>
994 <a href="#answers" data-toggle="tab"><t t-esc="count_answers"/> Answers</a>
996 <li t-if="uid == user.id">
997 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
999 <li t-if="uid == user.id">
1000 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
1002 <li t-if="uid == user.id">
1003 <a href="#activity" data-toggle="tab">Activity</a>
1006 <a href="#badges" data-toggle="tab">Badges</a>
1008 <li t-if="uid == user.id">
1009 <a href="#votes" data-toggle="tab">Votes</a>
1012 <div class="tab-content mt16">
1013 <div class="tab-pane active" id="questions">
1014 <div class="mb16" t-foreach="questions" t-as="question">
1015 <t t-call="website_forum.display_post"/>
1017 </div><div class="tab-pane" id="answers">
1018 <div t-foreach="answers" t-as="answer">
1019 <t t-call="website_forum.display_post_answer"/>
1022 <div class="tab-pane" id="karma">
1025 <div class="tab-pane" id="badges">
1026 <t t-call="website_forum.user_badges"/>
1028 <div class="tab-pane" id="favourite_question" t-if="uid == user.id">
1029 <div t-foreach="favourite" t-as="question">
1030 <t t-call="website_forum.display_post"/>
1033 <div class="tab-pane" id="followed_question" t-if="uid == user.id">
1034 <div t-foreach="followed" t-as="question" class="mb16">
1035 <t t-call="website_forum.display_post"/>
1038 <div class="tab-pane" id="votes" t-if="uid == user.id">
1039 <t t-call="website_forum.user_votes"/>
1041 <div class="tab-pane" id="activity" t-if="uid == user.id">
1042 <ul class="list-unstyled">
1043 <li t-foreach="activities" t-as="activity">
1044 <span t-field="activity.date" t-field-options='{"format": "short"}'/>
1045 <span t-esc="activity.subtype_id.name" class="label label-info"/>
1046 <t t-set="post" t-value="posts[activity.res_id]"/>
1047 <span t-if="post[1]">
1048 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
1049 <span t-esc="post[0].name"/>
1052 <span t-if="not post[1]">
1053 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
1054 <span t-esc="post[0].name"/>
1064 <template id="user_badges">
1065 <table class="table mt32 mb64">
1066 <tr t-foreach="user.badge_ids" t-as="badge">
1068 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
1069 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
1070 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
1071 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
1072 <span t-field="badge.badge_id.name"/>
1075 <b t-esc="badge.badge_id.stat_count_distinct"/>
1076 <i class="text-muted">awarded users</i>
1078 <span t-field="badge.badge_id.description"/>
1082 <div class="mb16" t-if="not user.badge_ids">
1083 <b>No badge yet!</b><br/>
1084 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
1088 <template id="user_votes">
1089 <div t-foreach="vote_post" t-as="vote">
1090 <t t-esc="vote.post_id.create_date"/>
1091 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
1092 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
1093 <t t-if="vote.post_id.parent_id">
1094 <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"/>
1096 <t t-if="not vote.post_id.parent_id">
1097 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
1100 <div class="mb16" t-if="not vote_post">
1101 <b>No vote given by you yet!</b>
1105 <!-- User Navbar -->
1106 <template id="content_new_forum" inherit_id="website.user_navbar" groups="base.group_user">
1107 <xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
1108 <li><a href="#" data-action="new_forum">New Forum</a></li>