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'/>
30 FP Note: Why do we need this ? Can we remove this code?
31 The problem is that you add your script for every page, not only for the forum
33 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
34 <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
35 <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
36 <script type="text/javascript">
37 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
38 ,['Outdent','Indent','Link','Unlink','Image'],] ;
41 <div class="container mt16">
42 <div class="navbar navbar-default">
43 <div class="navbar-header">
44 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
45 <span class="sr-only">Toggle navigation</span>
46 <span class="icon-bar"></span>
47 <!-- <span class="icon-bar"></span> -->
48 <span class="icon-bar"></span>
50 <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
51 <span t-field="forum.name"/>
54 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
55 <ul class="nav navbar-nav">
56 <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
57 <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
59 <li t-att-class="searches.get('users') and 'active' or '' ">
60 <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
62 <li t-att-class="searches.get('tags') and 'active' or '' ">
63 <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
65 <li t-att-class="searches.get('badges') and 'active' or '' ">
66 <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
69 <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
70 <div class="form-group">
71 <input type="search" class="form-control"
72 name="search" placeholder="Search a question..."
73 t-att-value="search or ''"/>
74 <button type="submit" class="btn btn-default">Search</button>
81 <div id="wrap" class="container">
83 <div class="col-sm-9">
84 <div t-foreach="notifications or []" t-as="notification" class="alert alert-success alert-dismissable">
85 <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
86 <div t-field="notification.body"/>
87 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(user) }#badges" class="fa fa-arrow-right">View Your Badges</a>
91 <div class="col-sm-3" id="right-column">
92 <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>
93 <div class="panel panel-default" id="about_forum">
94 <div class="panel-heading">
95 <h3 class="panel-title">About This Forum</h3>
97 <div class="panel-body">
98 <t t-raw="forum.description"/><br/>
99 <a t-attf-href="/forum/#{slug(forum)}/faq" class="fa fa-arrow-right"> Read Guidelines</a>
102 <div t-if="header.get('question_data')">
107 <div class="oe_structure"/>
111 <!-- Display a post -->
112 <template id="display_post">
113 <div class="question clearfix">
114 <div class="pull-left text-center">
115 <div t-attf-class="box #{question.child_count and 'oe_green' or 'oe_grey'}">
116 <span t-esc="question.child_count"/>
117 <span t-if="question.is_correct" class="fa fa-2x fa-check-circle"/>
118 <div t-if="question.child_count>1">Answers</div>
119 <div t-if="question.child_count<=1">Answer</div>
121 <div class="text-muted text-center">
122 <span t-field="question.views"/> Views
125 <div class="pull-right text-center">
126 <div class="box oe_grey">
127 <span t-esc="question.vote_count or 0"/>
128 <div t-if="question.vote_count>1">Votes</div>
129 <div t-if="question.vote_count<=1">Vote</div>
132 <div style="margin-left: 95px;">
133 <div class="question-name">
134 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
135 <span t-if="not question.active"><b> [Deleted]</b></span>
136 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
138 <div class="text-muted">
139 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
140 t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
141 style="display: inline-block;"/>
142 on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
144 <t t-foreach="question.tag_ids" t-as="tag">
145 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
151 <!-- Display a post as an answer -->
152 <template id="display_post_answer">
153 <div class="clearfix">
154 <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
155 <div t-esc="len(answer.vote_ids)"/>
157 <div class="question-name" style="margin-left: 32px;">
158 <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"/>
159 <t t-if="len(answer.website_message_ids)>0">
160 (<t t-esc="len(answer.website_message_ids)"/>
161 <t t-if="len(answer.website_message_ids)>1">Comments</t>
162 <t t-if="len(answer.website_message_ids)<=1">Comment</t>)
170 <t t-call="website_forum.header">
171 <div t-field="forum.faq"/>
175 <!-- All Forums Layout -->
176 <template id="forum_all">
177 <t t-call="website.layout">
178 <div class="container">
179 <h1 class="mb32">Our forums</h1>
181 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
182 <a t-attf-href="/forum/#{ slug(forum) }">
183 <div class="fa fa-5x fa-comment mb16"/>
184 <div t-field="forum.name"/>
192 <!-- Specific Forum Layout -->
193 <template id="forum_index" name="Forum">
194 <t t-call="website_forum.header">
195 <h1 class="page-header mt0">
196 <t t-esc="len(question_ids)"/> <span>Questions</span>
198 <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
199 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
200 <t t-if="filters == 'all'">All</t>
201 <t t-if="filters == 'unanswered'">Unanswered</t>
202 <t t-if="filters == 'followed'">Followed</t>
203 <t t-if="filters == 'tag'">Tag</t>
204 <t t-if="sorting == 'date'"> by activity date</t>
205 <t t-if="sorting == 'answered'"> by most answered</t>
206 <t t-if="sorting == 'vote'"> by most voted</t>
209 <ul class="dropdown-menu">
210 <li class="dropdown-header">Filter on</li>
211 <li t-att-class="filters == 'all' and 'active' or '' ">
212 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='all')">All</a>
214 <li t-att-class="filters == 'unanswered' and 'active' or '' ">
215 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='unanswered')">Unanswered</a>
217 <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
218 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'sorting', filters='followed')">Followed</a>
220 <li class="dropdown-header">Tags</li>
221 <li t-if="tag" t-att-class="tag and 'active' or '' ">
222 <a href=""><t t-esc="tag.name"/></a>
224 <li class="dropdown-header">Sort by</li>
225 <li t-att-class="sorting == 'date' and 'active' or '' ">
226 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='date')">Last activity date</a>
228 <li t-att-class="sorting == 'answered' and 'active' or '' ">
229 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='answered')">Most answered</a>
231 <li t-att-class="sorting == 'vote' and 'active' or '' ">
232 <a t-att-href="url_for('') + '?' + keep_query( 'search', 'filters', sorting='vote')">Most voted</a>
237 <div t-foreach="question_ids" t-as="question" class="mb16">
238 <t t-call="website_forum.display_post"/>
240 <t t-call="website.pager"/>
245 <t t-call="website_forum.header">
246 <div class="oe_structure oe_empty"/>
247 <h1 class="mt32">Question not found!</h1>
248 <p>Sorry, this question is not available anymore.</p>
250 <a t-attf-href="/forum">Return to the question list.</a>
255 <!-- Edition: ask your question -->
256 <template id="ask_question">
257 <t t-call="website_forum.header">
258 <h1 class="mt0">Ask your Question</h1>
260 <li> please, try to make your question interesting to others </li>
261 <li> provide enough details and, if possible, give an example </li>
262 <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
264 <form t-attf-action="/forum/#{ slug(forum) }/question/new" method="post" role="form" class="tag_text">
265 <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
266 class="form-control" placeholder="Enter your Question"/>
267 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
268 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
269 <textarea name="content" required="True" class="form-control load_editor">
270 <t t-esc="question_content"/>
273 <input type="text" name="question_tags" placeholder="Tags" class="form-control load_tags"/>
275 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Question</button>
277 <script type="text/javascript">
278 CKEDITOR.replace("content");
283 <!-- Edition: edit a post -->
284 <template id="edit_post">
285 <t t-call="website_forum.header">
286 <h3 t-if="not is_answer">Edit question</h3>
287 <h3 t-if="is_answer">Edit answer</h3>
288 <form t-attf-action="/forum/#{slug(forum)}/post/#{slug(post)}/save" method="post" role="form" class="tag_text">
289 <div t-if="not is_answer">
290 <input type="text" name="question_name" id="question_name" required="True"
291 t-attf-value="#{post.name}" class="form-control" placeholder="Edit your Question"/>
292 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
294 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
295 <textarea name="content" required="True" class="form-control load_editor">
296 <t t-esc="post.content"/>
298 <div t-if="not is_answer">
300 <input type="text" name="question_tag" class="form-control col-md-9 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
303 <button class="btn btn-primary btn-lg">Save</button>
305 <script type="text/javascript">
306 CKEDITOR.replace("content");
311 <!-- Moderation: close a question -->
312 <template id="close_question">
313 <t t-call="website_forum.header">
314 <h3 class=""><b>Close question</b></h3><br/>
315 <form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form">
316 <input name="post_id" t-att-value="post.id" type="hidden"/>
317 <span class="pull-left">Close the question:</span>
318 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post) }" t-field="post.name"/>
320 <label class="col-md-2 control-label mb16" for="reason">Reasons:</label>
321 <div class="col-md-9 mb16">
322 <select class="form-control" name="reason">
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>
330 <button class="btn btn-primary btn-lg">Close</button>
336 <!-- Edition: post an answer -->
337 <template id="post_answer">
338 <h3 class="mt10">Your answer</h3>
340 <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
341 <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
342 - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
343 - it really helps to select the best questions and answers!
345 <form t-attf-action="/forum/#{ slug(forum) }/post/#{slug(question)}/new" method="post" role="form">
346 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
347 <textarea name="content" class="form-control load_editor" required="True"/>
348 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Answer</button>
350 <script type="text/javascript">
351 CKEDITOR.replace("content");
356 <div t-attf-class="box oe_grey">
357 <a t-attf-class="vote_up fa fa-thumbs-up no-decoration #{post.user_vote == 1 and 'text-success' or ''}"
358 t-attf-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/upvote"/>
359 <span id="vote_count" t-esc="post.vote_count"/>
360 <a t-attf-class="vote_down fa fa-thumbs-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''}"
361 t-attf-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
368 <!-- Specific Post Layout -->
369 <template id="post_description_full" name="Question Navigation">
370 <t t-call="website_forum.header">
372 <div t-attf-class="question #{not question.active and 'alert alert-danger' or ''}">
373 <div class="text-center pull-left">
374 <t t-call="website_forum.vote">
375 <t t-set="post" t-value="question"/>
377 <div class="text-muted">
378 <span t-esc="question.child_count"/>
379 <span t-if="question.child_count>1">Answers</span>
380 <span t-if="question.child_count<=1">Answer</span>
383 <a t-attf-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
384 t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
387 <div style="margin-left: 95px;">
389 <span t-field="question.name"/>
390 <span t-if="not question.active"><b> [Deleted]</b></span>
391 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
393 <t t-raw="question.content"/>
395 <div class="mt16 clearfix">
396 <div class="pull-right">
397 <div class="text-right">
398 <t t-foreach="question.tag_ids" t-as="tag">
399 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
402 <ul class="list-inline">
403 <li t-if="user.id == question.create_uid.id or user.karma>=50">
404 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
405 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
409 <li t-if="question.state != 'close' and (user.id == question.create_uid.id or user.karma>=100)">
410 <a class="text-muted fa fa-times" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/ask_for_close">close</a>
412 <li t-if="question.state == 'close' and user.karma>=500">
413 <a class="text-muted fa fa-undo" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)/reopen">reopen</a>
415 <li t-if="user.id == question.create_uid.id or user.karma>=300">
416 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{ slug(forum) }/post/#{slug(question)}/edit">edit</a>
418 <li t-if="question.active and user.id == question.create_uid.id or user.karma>=1000">
419 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/delete">delete</a>
421 <li t-if="uid == question.create_uid.id and not question.active">
422 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/undelete">undelete</a>
424 <li><a class="text-muted fa fa-share" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}">share</a></li>
428 <span t-field="question.create_uid.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
430 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }"
431 t-field="question.create_uid"
432 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
433 style="display: inline-block;"/>
434 <div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
437 <div class="alert alert-info" t-if="question.state == 'close'">
438 <p class="mt32 mb32 text-center">
439 <b>The question has been closed for the following reason "<span t-field="question.closed_reason_id.name"/>"
440 <t t-if="question.closed_uid">
441 <i>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(question.closed_uid) }" t-field="question.closed_uid.name"/> </i>
443 <br/>close date <span t-field="question.closed_date"/></b>
447 <t t-call="website_forum.post_comment">
448 <t t-set="object" t-value="question"/>
454 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
455 <a t-attf-id="answer-#{str(answer.id)}"/>
456 <div t-attf-class="forum_answer #{answer.is_correct and 'alert alert-info answer_correct' or ''}" t-attf-id="answer_#{answer.id}" >
457 <div class="text-center pull-left">
458 <t t-call="website_forum.vote">
459 <t t-set="post" t-value="answer"/>
461 <div class="text-muted">
462 <a t-attf-class="accept_answer fa fa-2x fa-check-circle no-decoration oe_answer_true #{answer.is_correct and 'oe_answer_true' or 'oe_answer_false'}"
463 t-attf-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
466 <div style="margin-left: 95px;" class="clearfix">
467 <t t-raw="answer.content"/>
469 <ul class="list-inline pull-right">
470 <li t-if="user.id == answer.create_uid.id or user.karma>=50">
471 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
472 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }">comment
475 <li t-if="user.id == answer.create_uid.id or user.karma>=300">
476 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/edit">edit</a>
478 <li t-if="user.id == answer.create_uid.id or user.karma>=1000">
479 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/delete">delete</a>
481 <li t-if="user.id == answer.create_uid.id">
482 <a class="text-muted fa fa-magic" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/convert_to_comment">Convert as a comment</a>
484 <li><a class="text-muted fa fa-share" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/#answer_#{answer.id}">share</a></li>
486 <span t-field="answer.create_uid.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
488 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ user.id }"
489 t-field="answer.create_uid"
490 t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
491 style="display: inline-block;"/>
492 <div t-field="answer.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
493 <span class="text-muted">Answered on <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></span>
496 <t t-call="website_forum.post_comment">
497 <t t-set="object" t-value="answer"/>
502 <div t-if="not question.uid_has_answered">
503 <t t-call="website_forum.post_answer"/>
505 <div t-if="question.uid_has_answered" class="mb16">
506 <a class="btn btn-primary" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/edit_answer">Edit Your Previous Answer</a>
507 <span class="text-muted">(only one answer per question is allowed)</span>
512 <!-- Utility template: Post a Comment -->
513 <template id="post_comment">
514 <div class="row clearfix">
515 <div class="col-sm-10 col-sm-offset-2">
516 <div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey mb8">
517 <small class="text-muted">
518 <button type="button" t-if="user.partner_id.id == message.author_id.id and user.karma>=750"
519 t-attf-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/delete"
520 class="close comment_delete">&times;</button>
521 <span t-field="message.body"/>
522 <a t-attf-href="/forum/#{slug(forum)}/user/#{message.id}"
523 t-field="message.author_id" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
524 style="display: inline-block;"/>
525 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
526 <a class="fa fa-magic text-muted pull-right"
527 t-attf-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/convert_to_answer">Convert as an answer</a>
530 <div class="css_editable_mode_hidden">
531 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse"
532 t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
533 <input name="post_id" t-att-value="object.id" type="hidden"/>
534 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
535 <button type="submit" class="btn btn-primary mt8">Post</button>
543 <t t-call="website_forum.header">
547 <p class="text-muted">
548 A tag is a label that categorizes your question with other,
549 similar questions. Using the right tags makes it easier for
550 others to find and answer your question.
553 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
554 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
555 <span t-field="tag.name"/>
558 X <t t-esc="tag.posts_count"/>
565 <template id="badge">
566 <t t-call="website_forum.header">
571 Besides gaining reputation with your questions and answers,
572 you receive badges for being especially helpful. Badges
573 appear on your profile page, and your posts.
575 <table class="table mt32 mb64">
576 <tr t-foreach="badges" t-as="badge">
578 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
579 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
580 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
581 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
582 <span t-field="badge.name"/>
585 <b t-esc="badge.stat_count_distinct"/>
586 <i class="text-muted">awarded users</i>
588 <span t-field="badge.description"/>
595 <template id="badge_user">
596 <t t-call="website_forum.header">
597 <h3 class="mt32 mb32">
598 <b>Badge "<span t-field="badge.name"/>"</b>
601 <div class="pull-left badge">
602 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
603 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
604 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
605 <span t-field="badge.name"/>
607 <span t-field="badge.description" style="margin-left:20px"/>
610 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
611 <span t-if="badge.stat_count_distinct>1">users</span>
612 <span t-if="badge.stat_count_distinct<=1">user</span>
616 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
617 <span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
619 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
626 <template id="users">
627 <t t-call="website_forum.header">
629 <div t-foreach="users" t-as="user" class="col-sm-4">
630 <span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
632 <a t-attf-href="/forum/#{slug(forum)}/user/#{user.id}" t-field="user.name"/>
633 <t t-if="user.country_id">
634 <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/>
636 <b><t t-esc="user.karma"/></b>
637 <t t-raw="separator"/>
640 <span class="fa fa-circle badge-gold"/>
641 <t t-esc="user.gold_badge"/>
642 <span class="fa fa-circle badge-silver"/>
643 <t t-esc="user.silver_badge"/>
644 <span class="fa fa-circle badge-bronze"/>
645 <t t-esc="user.bronze_badge"/>
651 <div class="pull-left">
652 <t t-call="website.pager"/>
657 <template id="edit_profile">
658 <t t-call="website_forum.header">
659 <h3>Edit Profile </h3>
660 <div class="col-md-2">
661 <span t-field="user.image" t-field-options='{"widget": "image", "class": "img img-responsive img-circle"}'/>
663 <form t-attf-action="/forum/#{slug(forum)}/user/#{slug(user)}/save" method="post" role="form" class="form-horizontal">
664 <input name="user_id" t-att-value="user.id" type="hidden"/>
665 <label class="col-md-2 control-label mb16" for="user.name">Real name</label>
666 <div class="col-md-7 mb16">
667 <input type="text" class="col-md-7 mb16 form-control" name="name" required="True" t-attf-value="#{user.name}"/>
669 <label class="col-md-2 control-label mb16" for="user.partner_id.website">Website</label>
670 <div class="col-md-7 mb16">
671 <input type="text" class="form-control" name="website" t-attf-value="#{user.partner_id.website or ''}"/>
673 <label class="col-md-4 control-label mb16" for="user.partner_id.email">Email</label>
674 <div class="col-md-7 mb16">
675 <input type="text" class="form-control" name="email" required="True" t-attf-value="#{user.partner_id.email}"/>
677 <label class="col-md-4 control-label mb16" for="user.partner_id.city">City</label>
678 <div class="col-md-7 mb16">
679 <input type="text" class="form-control" name="city" t-attf-value="#{user.partner_id.city or ''}"/>
681 <label class="col-md-4 control-label mb16" for="contact_name">Country</label>
682 <div class="col-md-7 mb16">
683 <select class="form-control" name="country">
684 <option value="">Country...</option>
685 <t t-foreach="countries or []" t-as="country">
686 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country.id"><t t-esc="country.name"/></option>
690 <!--Note: using website_description fiels instead of using commnt firld of partner-->
691 <label class="col-md-4 control-label mb16" for="user.partner_id.website_description">Biography</label>
692 <div class="col-md-7 mb16">
693 <textarea name="description" style="min-height: 120px" required="True"
694 class="form-control"><t t-esc="user.partner_id.website_description"/></textarea>
696 <div class="col-sm-offset-4 col-md-4 mb16">
697 <button class="btn btn-primary btn-lg">Update</button>
703 <template id="user_detail_full">
704 <t t-call="website_forum.header">
705 <h1 class="mt0 page-header">
706 <span t-field="user.name"/>
707 <small>profile</small>
710 <div class="col-sm-2">
711 <span t-field="user.image"
712 t-field-options='{"widget": "image", "class": "img img-responsive img-circle"}'/>
714 <div class="col-sm-10">
715 <table class="table table-condensed">
717 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
718 <td>member since</td>
719 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
721 <td>last connection</td>
722 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
725 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
728 <a t-att-href="user.website" t-if="user.website">
729 <span t-field="user.website"/>
735 <span t-field="user.city"/>
736 <span t-if="user.city and user.country_id">, </span>
737 <span t-field="user.country_id"/>
738 <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class": "country_flag"}'/></t>
743 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
745 <td><span t-field="user.karma"/></td>
749 <span class="fa fa-thumbs-up"/>
750 <span t-esc="up_votes"/>
751 <span class="fa fa-thumbs-down"/>
752 <span t-esc="down_votes"/>
756 <div class="well well-sm">
757 <span t-field="user.partner_id.website_description"/>
758 <t t-if="uid == user.id">
759 <a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
765 <ul class="nav nav-tabs">
767 <a href="#questions" data-toggle="tab"><t t-esc="len(questions)"/> Questions</a>
770 <a href="#answers" data-toggle="tab"><t t-esc="len(answers)"/> Answers</a>
772 <li t-if="uid == user.id">
773 <a href="#favourite_question" data-toggle="tab"><t t-esc="len(favourite)"/> Favourite Questions</a>
775 <li t-if="uid == user.id">
776 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/> Followed Questions</a>
778 <li t-if="uid == user.id">
779 <a href="#activity" data-toggle="tab">Activity</a>
782 <a href="#badges" data-toggle="tab">Badges</a>
784 <li t-if="uid == user.id">
785 <a href="#votes" data-toggle="tab">Votes</a>
788 <div class="tab-content mt16">
789 <div class="tab-pane active" id="questions">
790 <div class="mb16" t-foreach="questions" t-as="question">
791 <t t-call="website_forum.display_post"/>
793 </div><div class="tab-pane" id="answers">
794 <div t-foreach="answers" t-as="answer">
795 <t t-call="website_forum.display_post_answer"/>
798 <div class="tab-pane" id="karma">
801 <div class="tab-pane" id="badges">
802 <t t-call="website_forum.user_badges"/>
804 <div class="tab-pane" id="favourite_question">
805 <div t-foreach="favourite" t-as="question">
806 <t t-call="website_forum.display_post"/>
809 <div class="tab-pane" id="followed_question">
810 <div t-foreach="followed" t-as="question">
811 <t t-call="website_forum.display_post"/>
814 <div class="tab-pane" id="votes">
815 <t t-call="website_forum.user_votes"/>
817 <div class="tab-pane" id="activity">
818 <ul class="list-unstyled">
819 <li t-foreach="activities" t-as="activity">
820 <span t-field="activity.date" t-field-options='{"format": "short"}'/>
821 <span t-esc="activity.subtype_id.name" class="label label-info"/>
822 <t t-set="post" t-value="posts[activity.res_id]"/>
823 <span t-if="post[1]">
824 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
825 <span t-esc="post[0].name"/>
828 <span t-if="not post[1]">
829 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
830 <span t-esc="post[0].name"/>
840 <template id="user_badges">
841 <table class="table mt32 mb64">
842 <tr t-foreach="user.badge_ids" t-as="badge">
844 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
845 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
846 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
847 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
848 <span t-field="badge.badge_id.name"/>
851 <b t-esc="badge.badge_id.stat_count_distinct"/>
852 <i class="text-muted">awarded users</i>
854 <span t-field="badge.badge_id.description"/>
858 <div class="mb16" t-if="not user.badge_ids">
859 <b>No badge yet!</b><br/>
860 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
864 <template id="user_votes">
865 <div t-foreach="vote_post" t-as="vote">
866 <t t-esc="vote.post_id.create_date"/>
867 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
868 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
869 <t t-if="vote.post_id.parent_id">
870 <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"/>
872 <t t-if="not vote.post_id.parent_id">
873 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
876 <div class="mb16" t-if="not vote_post">
877 <b>No vote given by you yet!</b>