1 <?xml version="1.0" encoding="utf-8"?>
6 <template id="editor_head" inherit_id="website.editor_head"
8 <xpath expr="//script[@id='website_tour_js']" position="after">
9 <script type="text/javascript" src="/website_forum/static/src/js/website.tour.forum.js"/>
10 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.editor.js"/>
14 <!-- Layout add nav and footer -->
15 <template id="header_footer_custom" inherit_id="website.layout"
16 name="Footer Questions Link">
17 <xpath expr="//footer//ul[@name='products']" position="inside">
18 <li><a t-attf-href="/forum/%(website_forum.forum_help)d">Q&A</a></li>
19 <li><a href="/forum">Forums</a></li>
24 <template id="header" name="Forum Index">
25 <t t-call="website.layout">
27 <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
28 <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
29 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
30 <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
31 <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
32 <script type="text/javascript">
33 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
34 ,['Outdent','Indent','Link','Unlink','Image'],] ;
37 <div class="container mt16">
38 <div class="navbar navbar-default">
39 <div class="navbar-header">
40 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
41 <span class="sr-only">Toggle navigation</span>
42 <span class="icon-bar"></span>
43 <!-- <span class="icon-bar"></span> -->
44 <span class="icon-bar"></span>
46 <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
47 <span t-field="forum.name"/>
50 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
51 <ul class="nav navbar-nav">
52 <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
53 <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
55 <li t-att-class="searches.get('users') and 'active' or '' ">
56 <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
58 <li t-att-class="searches.get('tags') and 'active' or '' ">
59 <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
61 <li t-att-class="searches.get('badges') and 'active' or '' ">
62 <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
65 <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
66 <div class="form-group">
67 <input type="search" class="form-control"
68 name="search" placeholder="Search a question..."
69 t-att-value="search or ''"/>
70 <button type="submit" class="btn btn-default">Search</button>
77 <div id="wrap" class="container">
79 <div class="col-sm-9">
80 <div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable">
81 <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
82 <div t-field="notification.body"/>
83 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(user) }#badges" class="fa fa-arrow-right">View Your Badges</a>
87 <div class="col-sm-3" id="right-column">
88 <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>
89 <div class="panel panel-default" id="about_forum">
90 <div class="panel-heading">
91 <h3 class="panel-title">About This Forum</h3>
93 <div class="panel-body">
94 <div t-raw="forum.description"/>
95 <a t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
98 <div t-if="header.get('question_data')">
103 <div class="oe_structure"/>
107 <!-- Display a post -->
108 <template id="display_post">
109 <div class="question clearfix">
110 <div class="pull-left text-center">
111 <div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
112 <span t-esc="question.child_count"/>
113 <div t-if="question.child_count>1" class="subtitle">Answers</div>
114 <div t-if="question.child_count<=1" class="subtitle">Answer</div>
117 <div style="margin-left: 95px; margin-top:-8px;">
118 <div class="question-name">
119 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
120 <span t-if="not question.active"><b> [Deleted]</b></span>
121 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
123 <t t-foreach="question.tag_ids" t-as="tag">
124 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge pull-right" t-field="tag.name"/>
126 <div class="text-muted">
127 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
128 t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
129 style="display: inline-block;"/>
130 on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
131 with <b t-field="question.views"/> views
132 <span t-if="question.vote_count>0"> and
133 <b t-esc="question.vote_count or 0"/>
134 <t t-if="question.vote_count>1">votes</t>
135 <t t-if="question.vote_count==1">vote</t>
142 <!-- Display a post as an answer -->
143 <template id="display_post_answer">
144 <div class="clearfix">
145 <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
146 <div t-esc="len(answer.vote_ids)"/>
148 <div class="question-name" style="margin-left: 32px;">
149 <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"/>
150 <t t-if="len(answer.website_message_ids)>0">
151 (<t t-esc="len(answer.website_message_ids)"/>
152 <t t-if="len(answer.website_message_ids)>1">Comments</t>
153 <t t-if="len(answer.website_message_ids)<=1">Comment</t>)
161 <t t-call="website_forum.header">
162 <div t-field="forum.faq"/>
166 <!-- All Forums Layout -->
167 <template id="forum_all">
168 <t t-call="website.layout">
169 <div class="container">
170 <h1 class="mb32">Our forums</h1>
172 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
173 <a t-attf-href="/forum/#{ slug(forum) }">
174 <div class="fa fa-5x fa-comment mb16"/>
175 <div t-field="forum.name"/>
183 <!-- Specific Forum Layout -->
184 <template id="forum_index" name="Forum">
185 <t t-call="website_forum.header">
186 <h1 class="page-header mt0">
187 <t t-esc="len(question_ids)"/> <span>Questions</span>
189 <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
190 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
191 <t t-if="filters == 'all'">All</t>
192 <t t-if="filters == 'unanswered'">Unanswered</t>
193 <t t-if="filters == 'followed'">Followed</t>
194 <t t-if="filters == 'tag'">Tag</t>
195 <t t-if="sorting == 'date'"> by activity date</t>
196 <t t-if="sorting == 'answered'"> by most answered</t>
197 <t t-if="sorting == 'vote'"> by most voted</t>
200 <ul class="dropdown-menu">
201 <li class="dropdown-header">Filter on</li>
202 <li t-att-class="filters == 'all' and 'active' or '' ">
203 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
205 <li t-att-class="filters == 'unanswered' and 'active' or '' ">
206 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
208 <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
209 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
211 <li class="dropdown-header">Tags</li>
212 <li t-if="tag" t-att-class="tag and 'active' or '' ">
213 <a href=""><t t-esc="tag.name"/></a>
215 <li class="dropdown-header">Sort by</li>
216 <li t-att-class="sorting == 'date' and 'active' or '' ">
217 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
219 <li t-att-class="sorting == 'answered' and 'active' or '' ">
220 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
222 <li t-att-class="sorting == 'vote' and 'active' or '' ">
223 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
228 <div t-foreach="question_ids" t-as="question" class="mb16">
229 <t t-call="website_forum.display_post"/>
231 <t t-call="website.pager"/>
236 <t t-call="website_forum.header">
237 <div class="oe_structure oe_empty"/>
238 <h1 class="mt32">Question not found!</h1>
239 <p>Sorry, this question is not available anymore.</p>
241 <a t-attf-href="/forum">Return to the question list.</a>
246 <!-- Edition: ask your question -->
247 <template id="ask_question">
248 <t t-call="website_forum.header">
249 <h1 class="mt0">Ask your Question</h1>
251 <li> please, try to make your question interesting to others </li>
252 <li> provide enough details and, if possible, give an example </li>
253 <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
255 <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
256 <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
257 class="form-control" placeholder="Enter your Question"/>
258 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
259 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
260 <textarea name="content" required="True" class="form-control load_editor">
261 <t t-esc="question_content"/>
264 <input type="text" name="question_tags" placeholder="Tags" class="form-control load_tags"/>
266 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Question</button>
268 <script type="text/javascript">
269 CKEDITOR.replace("content");
274 <!-- Edition: edit a post -->
275 <template id="edit_post">
276 <t t-call="website_forum.header">
277 <h3 t-if="not is_answer">Edit question</h3>
278 <h3 t-if="is_answer">Edit answer</h3>
279 <form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
280 <div t-if="not is_answer">
281 <input type="text" name="question_name" id="question_name" required="True"
282 t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
283 <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="post.content"/>
289 <div t-if="not is_answer">
291 <input type="text" name="question_tag" class="form-control col-md-9 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
294 <button class="btn btn-primary btn-lg">Save</button>
296 <script type="text/javascript">
297 CKEDITOR.replace("content");
302 <!-- Moderation: close a question -->
303 <template id="close_question">
304 <t t-call="website_forum.header">
305 <h1 class="mt0">Close question</h1>
306 <p class="text-muted">
307 If you close this question, it will be hidden for most users. Only
308 users having a high karma can see closed questions to moderate
311 <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(post)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
312 <input name="post_id" t-att-value="post.id" type="hidden"/>
313 <div class="form-group">
314 <label class="col-md-3 control-label" for="reason">Question:</label>
315 <div class="col-md-8 mt8">
316 <span t-field="post.name"/>
319 <div class="form-group">
320 <label class="col-md-3 control-label" for="reason">Reason:</label>
321 <div class="col-md-8">
322 <select class="form-control" name="reason_id">
323 <t t-foreach="reasons or []" t-as="reason">
324 <option t-att-value="reason.id" t-att-selected="reason.id == post.closed_reason_id.id"><t t-esc="reason.name"/></option>
329 <div class="form-group">
330 <div class="col-md-offset-3 col-md-8">
331 <button class="btn btn-primary">Close question</button>
332 <span class="text-muted">or</span>
333 <a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post) }">back to question</a>
340 <!-- Edition: post an answer -->
341 <template id="post_answer">
342 <h3 class="mt10">Your answer</h3>
344 <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
345 <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
346 - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
347 - it really helps to select the best questions and answers!
349 <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
350 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
351 <textarea name="content" class="form-control load_editor" required="True"/>
352 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Answer</button>
354 <script type="text/javascript">
355 CKEDITOR.replace("content");
360 <div t-attf-class="box oe_grey">
361 <a t-attf-class="vote_up fa fa-thumbs-up no-decoration #{post.user_vote == 1 and 'text-success' or ''}"
362 t-attf-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
363 <span id="vote_count" t-esc="post.vote_count"/>
364 <a t-attf-class="vote_down fa fa-thumbs-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''}"
365 t-attf-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
366 <div t-if="vote_count > 1" class="subtitle">
369 <div t-if="vote_count < 2" class="subtitle">
375 <!-- Specific Post Layout -->
376 <template id="post_description_full" name="Question Navigation">
377 <t t-call="website_forum.header">
379 <div t-attf-class="question #{not question.active and 'alert alert-danger' or ''}">
380 <div class="text-center pull-left">
381 <t t-call="website_forum.vote">
382 <t t-set="post" t-value="question"/>
384 <div class="text-muted text-center">
385 <span t-field="question.views"/> Views
388 <a t-attf-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
389 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
392 <div style="margin-left: 95px;">
394 <span t-field="question.name"/>
395 <span t-if="not question.active"><b> [Deleted]</b></span>
396 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
398 <div class="alert alert-info" t-if="question.state == 'close'">
399 <p class="mt32 mb16 text-center">
400 <b>The question has been closed for reason: <i t-esc="question.closed_reason_id.name"/>
402 <t t-if="question.closed_uid">
403 <i>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(question.closed_uid) }" t-field="question.closed_uid"/> </i>
405 on <span t-field="question.closed_date"/></b>
407 <div t-if="question.state == 'close' and user.karma>=500" class="mb24 text-center">
408 <a class="fa fa-arrow-right" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/reopen"> Reopen</a>
411 <t t-raw="question.content"/>
413 <div class="mt16 clearfix">
414 <div class="pull-right">
415 <div class="text-right">
416 <t t-foreach="question.tag_ids" t-as="tag">
417 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
420 <ul class="list-inline">
421 <li t-if="user.id == question.create_uid.id or user.karma>=50">
422 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
423 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
427 <li t-if="question.state != 'close' and (user.id == question.create_uid.id or user.karma>=100)">
428 <a class="text-muted fa fa-times" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/ask_for_close"> Close</a>
430 <li t-if="user.id == question.create_uid.id or user.karma>=300">
431 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{ slug(forum) }/post/#{slug(question)}/edit"> Edit</a>
433 <li t-if="question.active and user.id == question.create_uid.id or user.karma>=1000">
434 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/delete"> Delete</a>
436 <li t-if="uid == question.create_uid.id and not question.active">
437 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/undelete"> Undelete</a>
442 <span t-field="question.create_uid.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
444 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }"
445 t-field="question.create_uid"
446 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
447 style="display: inline-block;"/>
448 <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
452 <t t-call="website_forum.post_comment">
453 <t t-set="object" t-value="question"/>
459 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
460 <a t-attf-id="answer-#{str(answer.id)}"/>
461 <div t-attf-class="forum_answer" t-attf-id="answer_#{answer.id}" >
462 <div class="text-center pull-left">
463 <t t-call="website_forum.vote">
464 <t t-set="post" t-value="answer"/>
466 <div class="text-muted mt8">
467 <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'}"
468 t-attf-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
471 <div style="margin-left: 95px;" class="clearfix">
472 <t t-raw="answer.content"/>
474 <ul class="list-inline pull-right">
475 <li t-if="user.id == answer.create_uid.id or user.karma>=50">
476 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
477 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
480 <li t-if="user.id == answer.create_uid.id or user.karma>=300">
481 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/edit"> Edit</a>
483 <li t-if="user.id == answer.create_uid.id or user.karma>=1000">
484 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/delete"> Delete</a>
486 <li t-if="user.id == answer.create_uid.id">
487 <a class="text-muted fa fa-magic" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/convert_to_comment"> Convert as a comment</a>
490 <span t-field="answer.create_uid.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
492 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }"
493 t-field="answer.create_uid"
494 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
495 style="display: inline-block;"/>
496 <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
497 <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
500 <t t-call="website_forum.post_comment">
501 <t t-set="object" t-value="answer"/>
506 <div t-if="not question.uid_has_answered">
507 <t t-call="website_forum.post_answer"/>
509 <div t-if="question.uid_has_answered" class="mb16">
510 <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
511 <span class="text-muted">(only one answer per question is allowed)</span>
516 <!-- Utility template: Post a Comment -->
517 <template id="post_comment">
518 <div class="row clearfix">
519 <div class="col-sm-10 col-sm-offset-2">
520 <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
521 <small class="text-muted">
522 <button type="button" t-if="user.partner_id.id == message.author_id.id and user.karma>=750"
523 t-attf-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/delete"
524 class="close comment_delete">&times;</button>
525 <span t-field="message.body"/>
526 <a t-attf-href="/forum/#{slug(forum)}/user/#{message.id}"
527 t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
528 style="display: inline-block;"/>
529 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
530 <a class="fa fa-magic text-muted pull-right"
531 t-attf-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/convert_to_answer">Convert as an answer</a>
534 <div class="css_editable_mode_hidden">
535 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
536 t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
537 <input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
538 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
539 <button type="submit" class="btn btn-primary mt8">Post</button>
547 <t t-call="website_forum.header">
551 <p class="text-muted">
552 A tag is a label that categorizes your question with other,
553 similar questions. Using the right tags makes it easier for
554 others to find and answer your question.
557 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
558 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
559 <span t-field="tag.name"/>
562 X <t t-esc="tag.posts_count"/>
569 <template id="badge">
570 <t t-call="website_forum.header">
575 Besides gaining reputation with your questions and answers,
576 you receive badges for being especially helpful. Badges
577 appear on your profile page, and your posts.
579 <table class="table mt32 mb64">
580 <tr t-foreach="badges" t-as="badge">
582 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
583 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
584 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
585 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
586 <span t-field="badge.name"/>
589 <b t-esc="badge.stat_count_distinct"/>
590 <i class="text-muted">awarded users</i>
592 <span t-field="badge.description"/>
599 <template id="badge_user">
600 <t t-call="website_forum.header">
601 <h3 class="mt32 mb32">
602 <b>Badge "<span t-field="badge.name"/>"</b>
605 <div class="pull-left badge">
606 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
607 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
608 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
609 <span t-field="badge.name"/>
611 <span t-field="badge.description" style="margin-left:20px"/>
614 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
615 <span t-if="badge.stat_count_distinct>1">users</span>
616 <span t-if="badge.stat_count_distinct<=1">user</span>
620 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
621 <span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
623 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
630 <template id="users">
631 <t t-call="website_forum.header">
633 <div t-foreach="users" t-as="user" class="col-sm-4">
634 <span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
636 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
637 <t t-if="user.country_id">
638 <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
640 <b><t t-esc="user.karma"/></b>
641 <t t-raw="separator"/>
644 <span class="fa fa-circle badge-gold"/>
645 <t t-esc="user.gold_badge"/>
646 <span class="fa fa-circle badge-silver"/>
647 <t t-esc="user.silver_badge"/>
648 <span class="fa fa-circle badge-bronze"/>
649 <t t-esc="user.bronze_badge"/>
655 <div class="pull-left">
656 <t t-call="website.pager"/>
661 <template id="edit_profile">
662 <t t-call="website_forum.header">
663 <h3>Edit Profile </h3>
664 <div class="col-md-2">
665 <span t-field="user.image" t-field-options='{"widget": "image", "class": "img img-responsive img-circle"}'/>
667 <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
668 <input name="user_id" t-att-value="user.id" type="hidden"/>
669 <label class="col-md-2 control-label mb16" for="user.name">Real name</label>
670 <div class="col-md-7 mb16">
671 <input type="text" class="col-md-7 mb16 form-control" name="name" required="True" t-attf-value="#{user.name}"/>
673 <label class="col-md-2 control-label mb16" for="user.partner_id.website">Website</label>
674 <div class="col-md-7 mb16">
675 <input type="text" class="form-control" name="website" t-attf-value="#{user.partner_id.website or ''}"/>
677 <label class="col-md-4 control-label mb16" for="user.partner_id.email">Email</label>
678 <div class="col-md-7 mb16">
679 <input type="text" class="form-control" name="email" required="True" t-attf-value="#{user.partner_id.email}"/>
681 <label class="col-md-4 control-label mb16" for="user.partner_id.city">City</label>
682 <div class="col-md-7 mb16">
683 <input type="text" class="form-control" name="city" t-attf-value="#{user.partner_id.city or ''}"/>
685 <label class="col-md-4 control-label mb16" for="contact_name">Country</label>
686 <div class="col-md-7 mb16">
687 <select class="form-control" name="country">
688 <option value="">Country...</option>
689 <t t-foreach="countries or []" t-as="country">
690 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country.id"><t t-esc="country.name"/></option>
694 <!--Note: using website_description fiels instead of using commnt firld of partner-->
695 <label class="col-md-4 control-label mb16" for="user.partner_id.website_description">Biography</label>
696 <div class="col-md-7 mb16">
697 <textarea name="description" style="min-height: 120px" required="True"
698 class="form-control"><t t-esc="user.partner_id.website_description"/></textarea>
700 <div class="col-sm-offset-4 col-md-4 mb16">
701 <button class="btn btn-primary btn-lg">Update</button>
707 <template id="user_detail_full">
708 <t t-call="website_forum.header">
709 <h1 class="mt0 page-header">
710 <span t-field="user.name"/>
711 <small>profile</small>
714 <div class="col-sm-2">
715 <span t-field="user.image"
716 t-field-options='{"widget": "image", "class": "img img-responsive img-circle"}'/>
718 <div class="col-sm-10">
719 <table class="table table-condensed">
721 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
722 <td>member since</td>
723 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
725 <td>last connection</td>
726 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
729 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
732 <a t-att-href="user.website" t-if="user.website">
733 <span t-field="user.website"/>
739 <span t-field="user.city"/>
740 <span t-if="user.city and user.country_id">, </span>
741 <span t-field="user.country_id"/>
742 <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
747 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
749 <td><span t-field="user.karma"/></td>
753 <span class="fa fa-thumbs-up"/>
754 <span t-esc="up_votes"/>
755 <span class="fa fa-thumbs-down"/>
756 <span t-esc="down_votes"/>
760 <div class="well well-sm">
761 <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
762 <t t-if="uid == user.id">
763 <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
769 <ul class="nav nav-tabs">
771 <a href="#questions" data-toggle="tab"><t t-esc="len(questions)"/> Questions</a>
774 <a href="#answers" data-toggle="tab"><t t-esc="len(answers)"/> Answers</a>
776 <li t-if="uid == user.id">
777 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
779 <li t-if="uid == user.id">
780 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
782 <li t-if="uid == user.id">
783 <a href="#activity" data-toggle="tab">Activity</a>
786 <a href="#badges" data-toggle="tab">Badges</a>
788 <li t-if="uid == user.id">
789 <a href="#votes" data-toggle="tab">Votes</a>
792 <div class="tab-content mt16">
793 <div class="tab-pane active" id="questions">
794 <div class="mb16" t-foreach="questions" t-as="question">
795 <t t-call="website_forum.display_post"/>
797 </div><div class="tab-pane" id="answers">
798 <div t-foreach="answers" t-as="answer">
799 <t t-call="website_forum.display_post_answer"/>
802 <div class="tab-pane" id="karma">
805 <div class="tab-pane" id="badges">
806 <t t-call="website_forum.user_badges"/>
808 <div class="tab-pane" id="favourite_question">
809 <div t-foreach="favourite" t-as="question">
810 <t t-call="website_forum.display_post"/>
813 <div class="tab-pane" id="followed_question">
814 <div t-foreach="followed" t-as="question" class="mb16">
815 <t t-call="website_forum.display_post"/>
818 <div class="tab-pane" id="votes">
819 <t t-call="website_forum.user_votes"/>
821 <div class="tab-pane" id="activity">
822 <ul class="list-unstyled">
823 <li t-foreach="activities" t-as="activity">
824 <span t-field="activity.date" t-field-options='{"format": "short"}'/>
825 <span t-esc="activity.subtype_id.name" class="label label-info"/>
826 <t t-set="post" t-value="posts[activity.res_id]"/>
827 <span t-if="post[1]">
828 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
829 <span t-esc="post[0].name"/>
832 <span t-if="not post[1]">
833 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
834 <span t-esc="post[0].name"/>
844 <template id="user_badges">
845 <table class="table mt32 mb64">
846 <tr t-foreach="user.badge_ids" t-as="badge">
848 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
849 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
850 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
851 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
852 <span t-field="badge.badge_id.name"/>
855 <b t-esc="badge.badge_id.stat_count_distinct"/>
856 <i class="text-muted">awarded users</i>
858 <span t-field="badge.badge_id.description"/>
862 <div class="mb16" t-if="not user.badge_ids">
863 <b>No badge yet!</b><br/>
864 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
868 <template id="user_votes">
869 <div t-foreach="vote_post" t-as="vote">
870 <t t-esc="vote.post_id.create_date"/>
871 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
872 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
873 <t t-if="vote.post_id.parent_id">
874 <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"/>
876 <t t-if="not vote.post_id.parent_id">
877 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
880 <div class="mb16" t-if="not vote_post">
881 <b>No vote given by you yet!</b>