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">
378 <div t-attf-class="question #{not question.active and 'alert alert-danger' or ''}">
379 <div class="text-center pull-left">
380 <t t-call="website_forum.vote">
381 <t t-set="post" t-value="question"/>
383 <div class="text-muted text-center">
384 <span t-field="question.views"/> Views
387 <a t-attf-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
388 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
391 <div style="margin-left: 95px;">
393 <span t-field="question.name"/>
394 <span t-if="not question.active"><b> [Deleted]</b></span>
395 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
397 <div class="alert alert-info" t-if="question.state == 'close'">
398 <p class="mt32 mb16 text-center">
399 <b>The question has been closed for reason: <i t-esc="question.closed_reason_id.name"/>
401 <t t-if="question.closed_uid">
402 <i>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(question.closed_uid) }" t-field="question.closed_uid"/> </i>
404 on <span t-field="question.closed_date"/></b>
406 <div t-if="question.state == 'close' and user.karma>=500" class="mb24 text-center">
407 <a class="fa fa-arrow-right" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/reopen"> Reopen</a>
410 <t t-raw="question.content"/>
412 <div class="mt16 clearfix">
413 <div class="pull-right">
414 <div class="text-right">
415 <t t-foreach="question.tag_ids" t-as="tag">
416 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
419 <ul class="list-inline" id="options">
420 <li t-if="user.id == question.create_uid.id or user.karma>=50">
421 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
422 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
426 <li t-if="question.state != 'close' and (user.id == question.create_uid.id or user.karma>=100)">
427 <a class="text-muted fa fa-times" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/ask_for_close"> Close</a>
429 <li t-if="user.id == question.create_uid.id or user.karma>=300">
430 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{ slug(forum) }/post/#{slug(question)}/edit"> Edit</a>
432 <li t-if="question.active and user.id == question.create_uid.id or user.karma>=1000">
433 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/delete"> Delete</a>
435 <li t-if="uid == question.create_uid.id and not question.active">
436 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/undelete"> Undelete</a>
441 <span t-field="question.create_uid.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
443 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }"
444 t-field="question.create_uid"
445 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
446 style="display: inline-block;"/>
447 <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
451 <t t-call="website_forum.post_comment">
452 <t t-set="object" t-value="question"/>
458 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
459 <a t-attf-id="answer-#{str(answer.id)}"/>
460 <div t-attf-class="forum_answer" t-attf-id="answer_#{answer.id}" >
461 <div class="text-center pull-left">
462 <t t-call="website_forum.vote">
463 <t t-set="post" t-value="answer"/>
465 <div class="text-muted mt8">
466 <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'}"
467 t-attf-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
470 <div style="margin-left: 95px;" class="clearfix">
471 <t t-raw="answer.content"/>
473 <ul class="list-inline pull-right">
474 <li t-if="user.id == answer.create_uid.id or user.karma>=50">
475 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
476 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
479 <li t-if="user.id == answer.create_uid.id or user.karma>=300">
480 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/edit"> Edit</a>
482 <li t-if="user.id == answer.create_uid.id or user.karma>=1000">
483 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/delete"> Delete</a>
485 <li t-if="user.id == answer.create_uid.id">
486 <a class="text-muted fa fa-magic" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/convert_to_comment"> Convert as a comment</a>
489 <span t-field="answer.create_uid.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
491 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }"
492 t-field="answer.create_uid"
493 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
494 style="display: inline-block;"/>
495 <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
496 <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
499 <t t-call="website_forum.post_comment">
500 <t t-set="object" t-value="answer"/>
505 <div t-if="not question.uid_has_answered">
506 <t t-call="website_forum.post_answer"/>
508 <div t-if="question.uid_has_answered" class="mb16">
509 <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
510 <span class="text-muted">(only one answer per question is allowed)</span>
515 <!-- Utility template: Post a Comment -->
516 <template id="post_comment">
517 <div class="row clearfix">
518 <div class="col-sm-10 col-sm-offset-2">
519 <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
520 <small class="text-muted">
521 <button type="button" t-if="user.partner_id.id == message.author_id.id and user.karma>=750"
522 t-attf-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/delete"
523 class="close comment_delete">&times;</button>
524 <span t-field="message.body"/>
525 <a t-attf-href="/forum/#{slug(forum)}/user/#{message.id}"
526 t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
527 style="display: inline-block;"/>
528 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
529 <a class="fa fa-magic text-muted pull-right"
530 t-attf-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/convert_to_answer">Convert as an answer</a>
533 <div class="css_editable_mode_hidden">
534 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
535 t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
536 <input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
537 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
538 <button type="submit" class="btn btn-primary mt8">Post</button>
546 <t t-call="website_forum.header">
550 <p class="text-muted">
551 A tag is a label that categorizes your question with other,
552 similar questions. Using the right tags makes it easier for
553 others to find and answer your question.
556 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
557 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
558 <span t-field="tag.name"/>
561 X <t t-esc="tag.posts_count"/>
568 <template id="badge">
569 <t t-call="website_forum.header">
574 Besides gaining reputation with your questions and answers,
575 you receive badges for being especially helpful. Badges
576 appear on your profile page, and your posts.
578 <table class="table mt32 mb64">
579 <tr t-foreach="badges" t-as="badge">
581 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
582 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
583 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
584 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
585 <span t-field="badge.name"/>
588 <b t-esc="badge.stat_count_distinct"/>
589 <i class="text-muted">awarded users</i>
591 <span t-field="badge.description"/>
598 <template id="badge_user">
599 <t t-call="website_forum.header">
600 <h3 class="mt32 mb32">
601 <b>Badge "<span t-field="badge.name"/>"</b>
604 <div class="pull-left badge">
605 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
606 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
607 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
608 <span t-field="badge.name"/>
610 <span t-field="badge.description" style="margin-left:20px"/>
613 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
614 <span t-if="badge.stat_count_distinct>1">users</span>
615 <span t-if="badge.stat_count_distinct<=1">user</span>
619 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
620 <span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
622 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
629 <template id="users">
630 <t t-call="website_forum.header">
632 <div t-foreach="users" t-as="user" class="col-sm-4">
633 <span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
635 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
636 <t t-if="user.country_id">
637 <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
639 <b><t t-esc="user.karma"/></b>
640 <t t-raw="separator"/>
643 <span class="fa fa-circle badge-gold"/>
644 <t t-esc="user.gold_badge"/>
645 <span class="fa fa-circle badge-silver"/>
646 <t t-esc="user.silver_badge"/>
647 <span class="fa fa-circle badge-bronze"/>
648 <t t-esc="user.bronze_badge"/>
654 <div class="pull-left">
655 <t t-call="website.pager"/>
660 <template id="edit_profile">
661 <t t-call="website_forum.header">
662 <h3>Edit Profile </h3>
663 <div class="col-md-2">
664 <span t-field="user.image" t-field-options='{"widget": "image", "class": "img img-responsive img-circle"}'/>
666 <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
667 <input name="user_id" t-att-value="user.id" type="hidden"/>
668 <label class="col-md-2 control-label mb16" for="user.name">Real name</label>
669 <div class="col-md-7 mb16">
670 <input type="text" class="col-md-7 mb16 form-control" name="name" required="True" t-attf-value="#{user.name}"/>
672 <label class="col-md-2 control-label mb16" for="user.partner_id.website">Website</label>
673 <div class="col-md-7 mb16">
674 <input type="text" class="form-control" name="website" t-attf-value="#{user.partner_id.website or ''}"/>
676 <label class="col-md-4 control-label mb16" for="user.partner_id.email">Email</label>
677 <div class="col-md-7 mb16">
678 <input type="text" class="form-control" name="email" required="True" t-attf-value="#{user.partner_id.email}"/>
680 <label class="col-md-4 control-label mb16" for="user.partner_id.city">City</label>
681 <div class="col-md-7 mb16">
682 <input type="text" class="form-control" name="city" t-attf-value="#{user.partner_id.city or ''}"/>
684 <label class="col-md-4 control-label mb16" for="contact_name">Country</label>
685 <div class="col-md-7 mb16">
686 <select class="form-control" name="country">
687 <option value="">Country...</option>
688 <t t-foreach="countries or []" t-as="country">
689 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country.id"><t t-esc="country.name"/></option>
693 <!--Note: using website_description fiels instead of using commnt firld of partner-->
694 <label class="col-md-4 control-label mb16" for="user.partner_id.website_description">Biography</label>
695 <div class="col-md-7 mb16">
696 <textarea name="description" style="min-height: 120px" required="True"
697 class="form-control"><t t-esc="user.partner_id.website_description"/></textarea>
699 <div class="col-sm-offset-4 col-md-4 mb16">
700 <button class="btn btn-primary btn-lg">Update</button>
706 <template id="user_detail_full">
707 <t t-call="website_forum.header">
708 <h1 class="mt0 page-header">
709 <span t-field="user.name"/>
710 <small>profile</small>
713 <div class="col-sm-2">
714 <span t-field="user.image"
715 t-field-options='{"widget": "image", "class": "img img-responsive img-circle"}'/>
717 <div class="col-sm-10">
718 <table class="table table-condensed">
720 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
721 <td>member since</td>
722 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
724 <td>last connection</td>
725 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
728 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
731 <a t-att-href="user.website" t-if="user.website">
732 <span t-field="user.website"/>
738 <span t-field="user.city"/>
739 <span t-if="user.city and user.country_id">, </span>
740 <span t-field="user.country_id"/>
741 <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
746 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
748 <td><span t-field="user.karma"/></td>
752 <span class="fa fa-thumbs-up"/>
753 <span t-esc="up_votes"/>
754 <span class="fa fa-thumbs-down"/>
755 <span t-esc="down_votes"/>
759 <div class="well well-sm">
760 <span t-field="user.partner_id.website_description" class="oe_no_empty"/>
761 <t t-if="uid == user.id">
762 <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
768 <ul class="nav nav-tabs">
770 <a href="#questions" data-toggle="tab"><t t-esc="len(questions)"/> Questions</a>
773 <a href="#answers" data-toggle="tab"><t t-esc="len(answers)"/> Answers</a>
775 <li t-if="uid == user.id">
776 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
778 <li t-if="uid == user.id">
779 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
781 <li t-if="uid == user.id">
782 <a href="#activity" data-toggle="tab">Activity</a>
785 <a href="#badges" data-toggle="tab">Badges</a>
787 <li t-if="uid == user.id">
788 <a href="#votes" data-toggle="tab">Votes</a>
791 <div class="tab-content mt16">
792 <div class="tab-pane active" id="questions">
793 <div class="mb16" t-foreach="questions" t-as="question">
794 <t t-call="website_forum.display_post"/>
796 </div><div class="tab-pane" id="answers">
797 <div t-foreach="answers" t-as="answer">
798 <t t-call="website_forum.display_post_answer"/>
801 <div class="tab-pane" id="karma">
804 <div class="tab-pane" id="badges">
805 <t t-call="website_forum.user_badges"/>
807 <div class="tab-pane" id="favourite_question">
808 <div t-foreach="favourite" t-as="question">
809 <t t-call="website_forum.display_post"/>
812 <div class="tab-pane" id="followed_question">
813 <div t-foreach="followed" t-as="question" class="mb16">
814 <t t-call="website_forum.display_post"/>
817 <div class="tab-pane" id="votes">
818 <t t-call="website_forum.user_votes"/>
820 <div class="tab-pane" id="activity">
821 <ul class="list-unstyled">
822 <li t-foreach="activities" t-as="activity">
823 <span t-field="activity.date" t-field-options='{"format": "short"}'/>
824 <span t-esc="activity.subtype_id.name" class="label label-info"/>
825 <t t-set="post" t-value="posts[activity.res_id]"/>
826 <span t-if="post[1]">
827 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
828 <span t-esc="post[0].name"/>
831 <span t-if="not post[1]">
832 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
833 <span t-esc="post[0].name"/>
843 <template id="user_badges">
844 <table class="table mt32 mb64">
845 <tr t-foreach="user.badge_ids" t-as="badge">
847 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
848 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
849 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
850 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
851 <span t-field="badge.badge_id.name"/>
854 <b t-esc="badge.badge_id.stat_count_distinct"/>
855 <i class="text-muted">awarded users</i>
857 <span t-field="badge.badge_id.description"/>
861 <div class="mb16" t-if="not user.badge_ids">
862 <b>No badge yet!</b><br/>
863 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
867 <template id="user_votes">
868 <div t-foreach="vote_post" t-as="vote">
869 <t t-esc="vote.post_id.create_date"/>
870 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
871 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
872 <t t-if="vote.post_id.parent_id">
873 <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"/>
875 <t t-if="not vote.post_id.parent_id">
876 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
879 <div class="mb16" t-if="not vote_post">
880 <b>No vote given by you yet!</b>