1 <?xml version="1.0" encoding="utf-8"?>
5 <template id="editor_head" inherit_id="website.editor_head"
7 <xpath expr="//script[@id='website_tour_js']" position="after">
8 <script type="text/javascript"
9 src="/website_forum/static/src/js/website.tour.forum.js"/>
10 <script type="text/javascript"
11 src="/website_forum/static/src/js/website_forum.editor.js"/>
15 <!-- Layout add nav and footer -->
16 <template id="header_footer_custom" inherit_id="website.layout"
17 name="Footer Questions Link">
18 <xpath expr="//footer//ul[@name='products']" position="inside">
20 <a t-attf-href="/forum/%(website_forum.forum_help)d/">Q&A</a>
25 <!-- List of Questions -->
26 <template id="post_list">
27 <div class="question clearfix">
28 <div class="pull-left text-center">
29 <div t-attf-class="box #{question.child_count and 'oe_green' or 'oe_grey'}">
30 <span t-esc="question.child_count"/>
31 <div t-if="question.child_count>1">Answers</div>
32 <div t-if="question.child_count<=1">Answer</div>
34 <div class="text-muted text-center">
35 <span t-field="question.views"/> Views
38 <div style="margin-left: 95px;">
39 <div class="question-name">
40 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
41 <span t-if="not question.active"><b> [Deleted]</b></span>
42 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
44 <div class="text-muted">
45 by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.user_id.id }" t-field="question.user_id"/>,
46 on <span t-field="question.write_date"/>
47 <div t-if="question.vote_count">
48 <strong>with <span t-esc="question.vote_count"/> votes</strong>
51 <t t-foreach="question.tags" t-as="tag">
52 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
59 <template id="header" name="Forum Index">
60 <t t-call="website.layout">
62 <link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
63 <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
65 FP Note: Why do we need this ? Can we remove this code?
66 The problem is that you add your script for every page, not only for the forum
68 <script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
69 <script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
70 <script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
71 <script type="text/javascript">
72 CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList', 'Blockquote']
73 ,['Outdent','Indent','Link','Unlink','Image'],] ;
76 <div class="container mt16">
77 <div class="navbar navbar-default">
78 <div class="navbar-header">
79 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
80 <span class="sr-only">Toggle navigation</span>
81 <span class="icon-bar"></span>
82 <span class="icon-bar"></span>
83 <span class="icon-bar"></span>
85 <a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
86 <span t-field="forum.name"/>
89 <div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
90 <ul class="nav navbar-nav">
91 <li t-att-class="filters in ('all', 'unanswered','followed','question','tag') and 'active' or '' ">
92 <a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
94 <li t-att-class="searches.get('users') and 'active' or '' ">
95 <a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
97 <li t-att-class="searches.get('tags') and 'active' or '' ">
98 <a t-attf-href="/forum/#{ slug(forum) }/tag">Tags</a>
100 <li t-att-class="searches.get('badges') and 'active' or '' ">
101 <a t-attf-href="/forum/#{ slug(forum) }/badge">Badges</a>
104 <form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
105 <div class="form-group">
106 <input type="search" class="form-control"
107 name="search" placeholder="Search a question..."
108 t-att-value="searches.get('search') or ''"/>
109 <button type="submit" class="btn btn-default">Search</button>
116 <div id="wrap" class="container">
118 <div class="col-sm-9">
119 <div t-foreach="notifications.get('notifications') or []" t-as="notification" class="alert alert-success alert-dismissable">
120 <button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
121 <div t-field="notification.body"/>
122 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(notifications.get('user')) }#badges" class="fa fa-arrow-right">View Your Badges</a>
126 <div class="col-sm-3" id="right-column">
127 <a class="btn btn-primary btn-lg btn-block mb16" t-attf-href="/forum/#{ slug(forum) }/ask">Ask a Question</a>
128 <div t-field="forum.right_column"/>
129 <div t-if="question_data">
130 <div class="panel panel-default">
131 <div class="panel-heading text-center">
132 <h3 class="panel-title">Question tools</h3>
134 <div class="panel-body text-center">
135 <a class="btn btn-block btn-default btn-md" t-if="not following"
136 t-attf-href="/forum/#{ slug(forum) }/question/#{ question.id }/subscribe">Follow</a>
137 <a class="btn btn-block btn-default btn-md" t-if="following"
138 t-attf-href="/forum/#{ slug(forum) }/question/#{ question.id }/unsubscribe">UnFollow</a>
140 <strong><t t-raw="len(question.message_follower_ids)"/></strong> follower
143 <div class="panel-heading text-center">
144 <h3 class="panel-title ">Stats</h3>
146 <div class="panel-body">
147 <table class="table">
148 <thead><tr><td> Asked: <strong><span t-field="question.create_date" t-field-options='{"format":"short"}'/></strong></td></tr></thead>
149 <tr><td> Seen: <strong><t t-raw="question.views"/></strong>
150 <span t-if="question.views>1">times</span>
151 <span t-if="question.views<=1">time</span>
153 <tr><td> Last updated: <strong><span t-field="question.write_date" t-field-options='{"format":"short"}'/></strong></td></tr>
161 <div class="oe_structure"/>
166 <t t-call="website_forum.header">
167 <div t-field="forum.faq"/>
171 <template id="forum_index">
172 <t t-call="website.layout">
173 <div class="container">
174 <h1 class="mb32">Our forums</h1>
176 <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
177 <a t-attf-href="/forum/#{ slug(forum) }">
178 <div class="fa fa-5x fa-comment mb16"/>
179 <div t-field="forum.name"/>
187 <template id="index">
188 <t t-call="website_forum.header">
189 <h1 class="page-header mt0">
190 <t t-esc="total_questions"/>
191 <span>Questions</span>
192 <small class="dropdown" t-if="filters in ('all', 'unanswered','followed', 'tag')">
193 <a href="#" class="dropdown-toggle" data-toggle="dropdown">
194 <t t-if="filters == 'all'">All</t>
195 <t t-if="filters == 'unanswered'">Unanswered</t>
196 <t t-if="filters == 'followed'">Followed</t>
197 <t t-if="filters == 'tag'">Tag</t>
198 <t t-if="sorting == 'date'"> by activity date</t>
199 <t t-if="sorting == 'answered'"> by most answered</t>
200 <t t-if="sorting == 'vote'"> by most voted</t>
203 <ul class="dropdown-menu">
204 <li class="dropdown-header">Filter on</li>
205 <li t-att-class="filters == 'all' and 'active' or '' ">
206 <a t-att-href="url_for('') + '?' + keep_query( 'sorting', filters='all')">All</a>
208 <li t-att-class="filters == 'unanswered' and 'active' or '' ">
209 <a t-att-href="url_for('') + '?' + keep_query( 'sorting', filters='unanswered')">Unanswered</a>
211 <li t-if="uid" t-att-class="filters == 'followed' and 'active' or '' ">
212 <a t-att-href="url_for('') + '?' + keep_query( 'sorting', filters='followed')">Followed</a>
214 <li t-if="tag" t-att-class="tag and 'active' or '' ">
215 <a href=""><t t-esc="tag.name"/> Tag</a>
217 <li class="dropdown-header">Sort by</li>
218 <li t-att-class="sorting == 'date' and 'active' or '' ">
219 <a t-att-href="url_for('') + '?' + keep_query( 'filters', sorting='date')">Last activity date</a>
221 <li t-att-class="sorting == 'answered' and 'active' or '' ">
222 <a t-att-href="url_for('') + '?' + keep_query( 'filters', sorting='answered')">Most answered</a>
224 <li t-att-class="sorting == 'vote' and 'active' or '' ">
225 <a t-att-href="url_for('') + '?' + keep_query( 'filters', sorting='vote')">Most voted</a>
230 <div t-foreach="question_ids" t-as="question" class="mb16">
231 <t t-call="website_forum.post_list"/>
233 <t t-call="website.pager"/>
238 <t t-call="website_forum.header">
239 <div class="oe_structure oe_empty"/>
240 <h1 class="mt32">Question not found!</h1>
241 <p>Sorry, this question is not available anymore.</p>
243 <a t-attf-href="/forum">Return to the question list.</a>
248 <template id="user_detail">
250 <span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
252 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(user) }" t-field="user.name"/>
253 <t t-raw="separator or ', '"/>
254 <t t-esc="user.karma"/>
256 <span class="fa fa-circle badge-gold"/>
257 <t t-esc="user.gold_badge"/>
258 <span class="fa fa-circle badge-silver"/>
259 <t t-esc="user.silver_badge"/>
260 <span class="fa fa-circle badge-bronze"/>
261 <t t-esc="user.bronze_badge"/>
268 <template id="ask_question">
269 <t t-call="website_forum.header">
270 <h1 class="mt0">Ask your Question</h1>
272 <li> please, try to make your question interesting to others </li>
273 <li> provide enough details and, if possible, give an example </li>
274 <li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
276 <form t-attf-action="/forum/#{ slug(forum) }/question/ask/" method="post" role="form" class="tag_text">
277 <input type="text" name="question_name" required="True" t-attf-value="#{question_name}"
278 class="form-control" placeholder="Enter your Question"/>
279 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
280 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
281 <textarea name="content" required="True" class="form-control load_editor">
282 <t t-esc="question_content"/>
285 <input type="text" name="question_tags" t-attf-value="#{question_tag or ''}"
286 placeholder="Tags" class="form-control load_tags"/>
288 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Question</button>
290 <script type="text/javascript">
291 CKEDITOR.replace("content");
296 <template id="edit_post">
297 <t t-call="website_forum.header">
298 <h3 t-if="not is_answer">Edit question</h3>
299 <h3 t-if="is_answer">Edit answer</h3>
300 <form t-attf-action="/forum/#{ slug(forum) }/post/save" method="post" role="form" class="tag_text">
301 <select class="form-control post_history">
302 <t t-foreach="post_history" t-as="history">
303 <option t-att-value="history.id"><t t-esc="history.name"/></option>
306 <div t-if="not is_answer">
307 <input type="text" name="question_name" id="question_name" required="True"
308 t-attf-value="#{question.name}" class="form-control" placeholder="Edit your Question"/>
309 <h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
310 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
312 <textarea name="content" required="True" class="form-control load_editor">
313 <t t-if="is_answer"> <t t-esc="answer.content"/></t>
314 <t t-if="not is_answer"><t t-esc="question.content"/></t>
316 <input name="question_id" t-att-value="question.id" type="hidden"/>
317 <div t-if="is_answer">
318 <input name="answer_id" t-att-value="answer.id" type="hidden"/>
320 <div t-if="not is_answer">
322 <input type="text" name="question_tag" class="form-control col-md-9 load_tags" placeholder="Tags" t-attf-value="#{tags}"/>
325 <button class="btn btn-primary btn-lg">Save</button>
327 <script type="text/javascript">
328 CKEDITOR.replace("content");
333 <template id="close_question">
334 <t t-call="website_forum.header">
335 <h3 class=""><b>Close question</b></h3><br/>
336 <form t-attf-action="/forum/#{ slug(forum) }/question/close/" method="post" role="form">
337 <input name="post_id" t-att-value="post.id" type="hidden"/>
338 <span class="pull-left">Close the question:</span>
339 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post) }" t-field="post.name"/>
341 <label class="col-md-2 control-label mb16" for="reason">Reasons:</label>
342 <div class="col-md-9 mb16">
343 <select class="form-control" name="reason">
344 <t t-foreach="reasons or []" t-as="reason">
345 <option t-att-value="reason.id" t-att-selected="reason.id == post.reason_id.id"><t t-esc="reason.name"/></option>
351 <button class="btn btn-primary btn-lg">Close</button>
357 <template id="post_answer">
358 <h3 class="mt10">Your answer</h3>
360 <b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
361 <b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
362 - no need to answer the same question twice. Also, please <b>don't forget to vote</b>
363 - it really helps to select the best questions and answers!
365 <form t-attf-action="/forum/#{ slug(forum) }/question/postanswer/" method="post" role="form">
366 <input type="hidden" name="karma" t-attf-value="#{user.karma}" id="karma"/>
367 <textarea name="content" class="form-control load_editor" required="True"/>
368 <input name="post_id" t-att-value="question.id" type="hidden"/>
369 <button class="btn btn-primary" id="btn_ask_your_question">Post Your Answer</button>
371 <script type="text/javascript">
372 CKEDITOR.replace("content");
377 <div t-attf-class="box oe_grey">
378 <a t-attf-class="fa fa-thumbs-up #{post.user_vote == 1 and 'text-success' or ''}"
379 t-attf-id="#{post.id}" t-attf-value="1"/>
380 <span id="vote_count" t-esc="post.vote_count"/>
381 <a t-attf-class="fa fa-thumbs-down #{post.user_vote == -1 and 'text-warning' or ''}"
382 t-attf-id="#{post.id}" t-attf-value="-1"/>
389 <template id="post_description_full" name="Question Navigation">
390 <t t-call="website_forum.header">
392 <div t-attf-class="question #{not question.active and 'alert alert-danger' or ''}">
393 <div class="text-center pull-left">
394 <t t-call="website_forum.vote">
395 <t t-set="post" t-value="question"/>
397 <div class="text-muted">
398 <span t-esc="question.child_count"/>
399 <span t-if="question.child_count>1">Answers</span>
400 <span t-if="question.child_count<=1">Answer</span>
403 <div style="margin-left: 95px;">
405 <span t-field="question.name"/>
406 <span t-if="not question.active"><b> [Deleted]</b></span>
407 <span t-if="question.state == 'close'"><b> [Closed]</b></span>
409 <t t-raw="question.content"/>
411 <div class="mt16 clearfix">
412 <div class="pull-right">
413 <div class="text-right">
414 <t t-foreach="question.tags" t-as="tag">
415 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
418 <ul class="list-inline">
420 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
421 t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
425 <li t-if="question.state != 'close' and user.id == question.user_id.id and user.karma>=100">
426 <a class="text-muted fa fa-times" t-attf-href="/forum/#{ slug(forum) }/close/question/#{ question.id }">close</a>
428 <li t-if="question.state == 'close' and uid">
429 <a class="text-muted fa fa-undo" t-attf-href="/forum/#{ slug(forum) }/reopen/question/#{ question.id }">reopen</a>
431 <li t-if="user.id == question.user_id.id or user.karma>=300">
432 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{ slug(forum) }/edit/question/#{ question.id }">edit</a>
434 <li t-if="question.active and user.id == question.user_id.id or user.karma>=1000">
435 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/delete/question/#{ question.id }">delete</a>
437 <li t-if="uid == question.user_id.id and not question.active">
438 <a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/undelete/question/#{ question.id }">undelete</a>
440 <li><a class="text-muted fa fa-share" href="">share</a></li>
443 <t t-call="website_forum.user_detail">
444 <t t-set="user" t-value="question.user_id"/>
445 <span class="text-muted">Asked on <span t-field="question.write_date"/></span>
447 <div class="alert alert-info" t-if="question.state == 'close'">
448 <p class="mt32 mb32 text-center">
449 <b>The question has been closed for the following reason "<span t-field="question.reason_id.name"/>"
450 <i>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(question.closed_by) }" t-field="question.closed_by.name"/> </i>
451 <br/>close date <span t-field="question.closed_date"/></b>
455 <t t-call="website_forum.comments">
456 <t t-set="object" t-value="question"/>
462 <div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32" id="answer">
463 <a t-attf-id="answer-#{str(answer.id)}"/>
464 <div class="text-center pull-left">
465 <t t-call="website_forum.vote">
466 <t t-set="post" t-value="answer"/>
468 <div class="text-muted">
469 <a t-attf-id="#{answer.id}" t-if="answer.correct" class="fa fa-2x fa-check oe_answer_true"/>
470 <a t-attf-id="#{answer.id}" t-if="not answer.correct" class="fa fa-2x fa-check oe_answer_false"/>
473 <div style="margin-left: 95px;" class="clearfix">
474 <t t-raw="answer.content"/>
476 <ul class="list-inline pull-right">
478 <a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
479 t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }">comment
482 <li t-if="user.id == answer.user_id.id or user.karma>=300">
483 <a class="text-muted fa fa-edit" t-attf-href="/forum/#{ slug(forum) }/question/#{ question.id }/edit/#{ answer.id }">edit</a>
485 <li t-if="user.id == answer.user_id.id or user.karma>=1000">
486 <a class="text-muted delete fa fa-trash-o" href="" t-attf-id="#{answer.id}">delete</a>
489 <a class="text-muted fa fa-magic" t-attf-href="/forum/#{ slug(forum) }/post/#{ answer.id }/converttocomment">Convert as a comment</a>
491 <li><a class="text-muted fa fa-share" t-attf-href="/forum/#{ slug(forum) }/question/#{ question.id }/#answer-#{ answer.id }">share</a></li>
493 <t t-call="website_forum.user_detail">
494 <t t-set="user" t-value="answer.user_id"/>
495 <span class="text-muted">Answered on <span t-field="answer.create_date"/></span>
498 <t t-call="website_forum.comments">
499 <t t-set="object" t-value="answer"/>
503 <div t-if="not answer_done">
504 <t t-call="website_forum.post_answer"/>
506 <div t-if="answer_done" class="mb16">
507 <a class="btn btn-primary" t-attf-href="/forum/#{ slug(forum) }/question/#{ question.id }/editanswer">Edit Your Previous Answer</a>
508 <span class="text-muted">(only one answer per question is allowed)</span>
513 <template id="comments">
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" id="comment" class="oe_grey" style="padding: 4px;">
517 <small class="text-muted">
518 <button type="button" t-if="user.id == message.create_uid.id or user.karma>=750" t-att-id="message.id" class="close comment_delete">&times;</button>
519 <span t-field="message.body"/>
520 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ message.create_uid.id }" t-field="message.create_uid"/>
521 on <span t-field="message.date" t-field-options='{"format":"short"}'/>
522 <a class="fa fa-magic text-muted pull-right" t-if="uid == message.create_uid.id"
523 t-attf-href="/forum/#{ slug(forum) }/post/#{ object.id }/commet/#{ message.id }/converttoanswer">Convert as an answer</a>
526 <div class="css_editable_mode_hidden oe_grey">
527 <form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse" t-attf-action="/forum/#{ slug(forum) }/comment" method="POST">
528 <input name="post_id" t-att-value="object.id" type="hidden"/>
529 <textarea name="comment" class="form-control" placeholder="Comment this post..."/>
530 <button type="submit" class="btn btn-primary mt8">Post</button>
538 <t t-call="website_forum.header">
542 <p class="text-muted">
543 A tag is a label that categorizes your question with other,
544 similar questions. Using the right tags makes it easier for
545 others to find and answer your question.
548 <div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
549 <a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }/questions?{{ keep_query( filters='tag') }}" class="badge">
550 <span t-field="tag.name"/>
553 X <t t-esc="tag.posts_count"/>
560 <template id="badge">
561 <t t-call="website_forum.header">
566 Besides gaining reputation with your questions and answers,
567 you receive badges for being especially helpful. Badges
568 appear on your profile page, and your posts.
570 <table class="table mt32 mb64">
571 <tr t-foreach="badges" t-as="badge">
573 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
574 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
575 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
576 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
577 <span t-field="badge.name"/>
580 <b t-esc="badge.stat_count_distinct"/>
581 <i class="text-muted">awarded users</i>
583 <span t-field="badge.description"/>
590 <template id="badge_user">
591 <t t-call="website_forum.header">
592 <h3 class="mt32 mb32">
593 <b>Badge "<span t-field="badge.name"/>"</b>
596 <div class="pull-left badge">
597 <span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
598 <span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
599 <span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
600 <span t-field="badge.name"/>
602 <span t-field="badge.description" style="margin-left:20px"/>
605 <t class="pull-left" t-esc="badge.stat_count_distinct"/>
606 <span t-if="badge.stat_count_distinct>1">users</span>
607 <span t-if="badge.stat_count_distinct<=1">user</span>
611 <div class="col-sm-3 mt16" t-foreach="users" t-as="user">
612 <span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
614 <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(user) }" t-field="user.name"/>
621 <template id="users">
622 <t t-call="website_forum.header">
624 <div t-foreach="users" t-as="user" class="col-sm-4">
625 <t t-set="separator"><br/></t>
626 <t t-call="website_forum.user_detail"/>
627 <span class="text-muted">Joined on <span t-field="user.create_date" t-field-options='{"format":"short"}'/></span>
630 <div class="pull-left">
631 <t t-call="website.pager"/>
636 <template id="edit_profile">
637 <t t-call="website_forum.header">
638 <h3>Edit Profile </h3>
639 <div class="col-md-2">
640 <span t-field="user.image" t-field-options='{"widget": "image", "class": "img img-responsive img-circle"}'/>
642 <form t-attf-action="/forum/#{ slug(forum) }/save/profile/" method="post" role="form" class="form-horizontal">
643 <input name="user_id" t-att-value="user.id" type="hidden"/>
644 <label class="col-md-2 control-label mb16" for="user.name">Real name</label>
645 <div class="col-md-7 mb16">
646 <input type="text" class="col-md-7 mb16 form-control" name="name" required="True" t-attf-value="#{user.name}"/>
648 <label class="col-md-2 control-label mb16" for="user.partner_id.website">Website</label>
649 <div class="col-md-7 mb16">
650 <input type="text" class="form-control" name="website" t-attf-value="#{user.partner_id.website or ''}"/>
652 <label class="col-md-4 control-label mb16" for="user.partner_id.email">Email</label>
653 <div class="col-md-7 mb16">
654 <input type="text" class="form-control" name="email" required="True" t-attf-value="#{user.partner_id.email}"/>
656 <label class="col-md-4 control-label mb16" for="user.partner_id.city">City</label>
657 <div class="col-md-7 mb16">
658 <input type="text" class="form-control" name="city" t-attf-value="#{user.partner_id.city or ''}"/>
660 <label class="col-md-4 control-label mb16" for="contact_name">Country</label>
661 <div class="col-md-7 mb16">
662 <select class="form-control" name="country">
663 <option value="">Country...</option>
664 <t t-foreach="countries or []" t-as="country">
665 <option t-att-value="country.id" t-att-selected="country.id == user.partner_id.country.id"><t t-esc="country.name"/></option>
669 <!--Note: using website_description fiels instead of using commnt firld of partner-->
670 <label class="col-md-4 control-label mb16" for="user.partner_id.website_description">Biography</label>
671 <div class="col-md-7 mb16">
672 <textarea name="description" style="min-height: 120px" required="True"
673 class="form-control"><t t-esc="user.partner_id.website_description"/></textarea>
675 <div class="col-sm-offset-4 col-md-4 mb16">
676 <button class="btn btn-primary btn-lg">Update</button>
682 <template id="user_detail_full">
683 <t t-call="website_forum.header">
684 <h1 class="mt0 page-header">
685 <span t-field="user.name"/>
686 <small>profile</small>
689 <div class="col-sm-2">
690 <span t-field="user.image"
691 t-field-options='{"widget": "image", "class": "img img-responsive img-circle"}'/>
693 <div class="col-sm-10">
694 <table class="table table-condensed">
696 <td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
697 <td>member since</td>
698 <td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
700 <td>last connection</td>
701 <td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
704 <td rowspan="2" valign="top"><span class="text-muted">bio</span></td>
707 <a t-att-href="user.website" t-if="user.website">
708 <span t-field="user.website"/>
714 <span t-field="user.city"/>
715 <span t-if="user.city and user.country_id">, </span>
716 <span t-field="user.country_id"/>
720 <td rowspan="2" valign="top"><span class="text-muted">stats</span></td>
722 <td><span t-field="user.karma"/></td>
726 <span class="fa fa-thumbs-up"/>
727 <span t-esc="up_votes"/>
729 <span class="fa fa-thumbs-down "/>
730 <span t-esc="down_votes"/>
734 <div class="well well-sm">
735 <span t-field="user.partner_id.website_description"/>
736 <t t-if="uid == user.id">
737 <a class="fa fa-arrow-right" t-attf-href="/forum/#{ slug(forum) }/edit/profile/#{ user.id }"> Edit Your Bio</a>
743 <ul class="nav nav-tabs">
745 <a href="#questions" data-toggle="tab"><t t-esc="len(questions)"/> Questions</a>
748 <a href="#answers" data-toggle="tab"><t t-esc="len(answers)"/> Answers</a>
751 <a href="#activity" data-toggle="tab">Activity</a>
754 <a href="#badges" data-toggle="tab">Badges</a>
757 <a href="#followed_question" data-toggle="tab"><t t-esc="len(followed)"/>Followed Question</a>
760 <a href="#votes" data-toggle="tab">Votes</a>
763 <div class="tab-content mt16">
764 <div class="tab-pane active" id="questions">
765 <div class="mb16" t-foreach="questions" t-as="question">
766 <t t-call="website_forum.post_list"/>
768 </div><div class="tab-pane" id="answers">
769 <div t-foreach="answers" t-as="answer">
770 <t t-call="website_forum.post_list_answer"/>
773 <div class="tab-pane" id="karma">
776 <div class="tab-pane" id="badges">
777 <t t-call="website_forum.user_badges"/>
779 <div class="tab-pane" id="followed_question">
780 <div t-foreach="followed" t-as="question">
781 <t t-call="website_forum.post_list"/>
784 <div class="tab-pane" id="votes">
785 <t t-call="website_forum.user_votes"/>
787 <div class="tab-pane" id="activity">
788 <ul class="list-unstyled">
789 <li t-foreach="activities" t-as="activity">
790 <span t-esc="activity.date"/>
791 <span t-esc="activity.subtype_id.name" class="label label-info"/>
792 <t t-set="post" t-value="posts[activity.res_id]"/>
793 <span t-if="post[1]">
794 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
798 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
799 <span t-esc="post[0].name"/>
808 <template id="user_badges">
809 <table class="table mt32 mb64">
810 <tr t-foreach="user.badges" t-as="badge">
812 <a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge pull-left">
813 <span t-if="badge.badge_id.level == 'gold'" class="fa fa-circle badge-gold"/>
814 <span t-if="badge.badge_id.level == 'silver'" class="fa fa-circle badge-silver"/>
815 <span t-if="badge.badge_id.level == 'bronze'" class="fa fa-circle badge-bronze"/>
816 <span t-field="badge.badge_id.name"/>
819 <b t-esc="badge.badge_id.stat_count_distinct"/>
820 <i class="text-muted">awarded users</i>
822 <span t-field="badge.badge_id.description"/>
826 <div class="mb16" t-if="not user.badges">
827 <b>No badge yet!</b><br/>
828 <a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right"> Check available badges</a>
832 <template id="user_votes">
833 <div t-foreach="vote_post" t-as="vote">
834 <t t-esc="vote.post_id.create_date"/>
835 <span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
836 <span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
837 <t t-if="vote.post_id.parent_id">
838 <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"/>
840 <t t-if="not vote.post_id.parent_id">
841 <a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
844 <div class="mb16" t-if="not vote_post">
845 <b>No vote given by you yet!</b>
849 <template id="post_list_answer">
850 <div class="clearfix">
851 <div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
852 <div t-esc="len(answer.vote_ids)"/>
854 <div class="question-name" style="margin-left: 32px;">
855 <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"/>
856 <t t-if="len(answer.website_message_ids)>0">
857 (<t t-esc="len(answer.website_message_ids)"/>
858 <t t-if="len(answer.website_message_ids)>1">Comments</t>
859 <t t-if="len(answer.website_message_ids)<=1">Comment</t>)