odoo/addons/website_forum/views/website_forum.xml

830 lines
44 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="editor_head" inherit_id="website.editor_head"
name="Event Editor">
<xpath expr="//script[@id='website_tour_js']" position="after">
<script type="text/javascript"
src="/website_forum/static/src/js/website.tour.forum.js"></script>
<!--
FP Note: Why do we need this ? Can we remove this code?
The problem is that you add your script for every page, not only for the forum
-->
<script type="text/javascript"
src="/website_forum/static/src/js/website_forum.editor.js"></script>
<script type="text/javascript">
CKEDITOR.config.toolbar = [['Bold','Italic','Underline','Strike'],['NumberedList','BulletedList']
,['Outdent','Indent','Link','Unlink'],] ;
</script>
</xpath>
</template>
<!-- Layout add nav and footer -->
<template id="header_footer_custom" inherit_id="website.layout"
name="Footer Questions Link">
<xpath expr="//footer//ul[@name='products']" position="inside">
<li>
<a t-attf-href="/forum/%(website_forum.forum_help)d/">Q&amp;A</a>
</li>
</xpath>
</template>
<!-- List of Questions -->
<template id="post_list">
<div class="question clearfix">
<div class="pull-left text-center">
<div t-attf-class="box #{len(question.child_ids) and 'oe_green' or 'oe_grey'}">
<span t-esc="len(question.child_ids)"/>
<div t-if="len(question.child_ids)&gt;1">Answers</div>
<div t-if="len(question.child_ids)&lt;=1">Answer</div>
</div>
<div class="text-muted text-center">
<span t-field="question.views"/> Views
</div>
</div>
<div style="margin-left: 95px;">
<div class="question-name">
<a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
</div>
<div class="text-muted">
by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }" t-field="question.create_uid"/>,
on <span t-field="question.write_date"/>
<div t-if="len(question.vote_ids)">
<strong>with <span t-esc="len(question.vote_ids)"/> votes</strong>
</div>
</div>
<t t-foreach="question.tags" t-as="tag">
<a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }" class="badge" t-field="tag.name"/>
</t>
</div>
</div>
</template>
<!-- Page Index -->
<template id="header" name="Forum Index">
<t t-call="website.layout">
<t t-set="head">
<link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css' />
</t>
<div class="container mt16">
<div class="navbar navbar-default">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe-help-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/forum">Help</a>
<!-- FP Note: Replace by this when controllers have changed
<a class="navbar-brand" t-attf-href="/forum/#{slug(forum)}">
<span t-field="forum.name"/>
</a>
-->
</div>
<div class="collapse navbar-collapse" id="oe-help-navbar-collapse">
<ul class="nav navbar-nav">
<li t-att-class="searches.get('type') in ('all', 'unanswered','followed') and 'active' or '' ">
<a t-attf-href="/forum/#{ slug(forum) }">Questions</a>
</li>
<li t-att-class="searches.get('users') and 'active' or '' ">
<a t-attf-href="/forum/#{ slug(forum) }/users">People</a>
</li>
<li t-att-class="searches.get('tags') and 'active' or '' ">
<a t-attf-href="/forum/#{ slug(forum) }/tags">Tags</a>
</li>
<li t-att-class="searches.get('badges') and 'active' or '' ">
<a t-attf-href="/forum/#{ slug(forum) }/badges">Badges</a>
</li>
</ul>
<form class="navbar-form navbar-right" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
<div class="form-group">
<input type="search" class="form-control"
name="search" placeholder="Search a question..."
t-att-value="searches.get('search') or ''" />
<button type="submit" class="btn btn-default">Search</button>
</div>
</form>
</div>
</div>
</div>
<div id="wrap" class="container">
<div class="row">
<div class="col-sm-9">
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
<strong>Congratulation!</strong> You received the <em>New Author</em> badge!<br/>
<a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right">View Your Badges</a>
</div>
<t t-raw="0"/>
</div><div class="col-sm-3" id="right-column">
<a class="btn btn-primary btn-lg btn-block mb16" t-attf-href="/forum/#{ slug(forum) }/ask">Ask a Question</a>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">About This Forum</h3>
</div>
<div class="panel-body">
This community is for professional and enthusiast about our
products and services.<br/>
<a t-attf-href="/forum/#{ slug(forum) }/faq" class="fa fa-arrow-right"> Read Guidelines</a>
</div>
</div>
</div>
</div>
</div>
</t>
</template>
<template id="faq">
<t t-call="website_forum.header">
<h1>Guidelines</h1>
<h2><a id="good_questions">What kinds of questions can I ask here?</a></h2>
<p>
This community is for professional and enthusiast users,
partners and programmers. You can ask questions about:
</p>
<ul>
<li>how to install OpenERP on a specific infrastructure,</li>
<li>how to configure or customize OpenERP to specific business needs,</li>
<li>what's the best way to use OpenERP for a specific business need,</li>
<li>how to develop modules for your own need,</li>
<li>specific questions about OpenERP service offers, etc.</li>
</ul>
<p>
<b>Before you ask - please make sure to search for a similar question.</b> You can
search questions by their title or tags. Its also OK to
answer your own question.
</p><p>
<b>Please avoid asking questions that are too subjective
and argumentative</b> or not relevant to this community.
</p>
<h2><a name="bad_questions">What should I avoid in my questions?</a></h2>
<p>
You should only ask practical, answerable questions based
on actual problems that you face. Chatty, open-ended
questions diminish the usefulness of this site and push
other questions off the front page.
</p><p>
To prevent your question from being flagged and possibly removed, avoid asking
subjective questions where …
</p>
<ul>
<li>every answer is equally valid: “Whats your favorite ______?”</li>
<li>your answer is provided along with the question, and you expect more answers: “I use ______ for ______, what do you use?”</li>
<li>there is no actual problem to be solved: “Im curious if other people feel like I do.”</li>
<li>we are being asked an open-ended, hypothetical question: “What if ______ happened?”</li>
<li>it is a rant disguised as a question: “______ sucks, am I right?”</li>
</ul>
<p>
If you fit in one of these example or if your motivation for asking the
question is “I would like to participate in a discussion about ______”, then
you should not be asking here but on our mailing lists.
However, if your motivation is “I would like others to explain ______ to me”,
then you are probably OK.
</p><p>
(The above section was adapted from Stackoverflows FAQ.)
</p><p>
More over:
</p>
<ul>
<li><b>Answers should not add or expand questions</b>. Instead either edit the question edit or add a question comment.</li>
<li><b>Answers should not comment other answers</b>. Instead add a comment on the other answers.</li>
<li><b>Answers shouldn't just point to other Questions</b>. Instead add a question comment indication "Possible duplicate of...". However, it's ok to include links to other questions or answers providing relevant additional information.</li>
<li><b>Answers shouldn't just provide a link a solution</b>. Instead provide the solution description text in your answer, even if it's just a copy/paste. Links are welcome, but should complementary to answer, referring sources or additional reading.</li>
</ul>
<h2><a name="bad_answers">What should I avoid in my answers?</a></h2>
<p>
<b>Answers should not add or expand questions</b>. Instead
either edit the question or add a comment.
</p><p>
<b>Answers should not comment other answers</b>. Instead
add a comment on the other answers.
</p><p>
<b>Answers shouldn't just point to other questions</b>.
Instead add a comment indicating <i>"Possible duplicate
of..."</i>. However, it's fine to include links to other
questions or answers providing relevant additional
information. </p> <p> <b>Answers shouldn't just provide a
link a solution</b>. Instead provide the solution
description text in your answer, even if it's just a
copy/paste. Links are welcome, but should complementary to
answer, referring sources or additional reading.
</p><p>
<b>Answers should not start debates</b>
This community Q&amp;A is not a discussion group. Please avoid holding debates in
your answers as they tend to dilute the essence of questions and answers. For
brief discussions please use commenting facility.
</p> <p>
When a question or answer is upvoted, the user who posted them will gain some
points, which are called "karma points". These points serve as a rough
measure of the community trust to him/her. Various moderation tasks are
gradually assigned to the users based on those points.
</p> <p>
For example, if you ask an interesting question or give a helpful answer, your
input will be upvoted. On the other hand if the answer is misleading - it will
be downvoted. Each vote in favor will generate 10 points, each vote against
will subtract 10 points. There is a limit of 200 points that can be accumulated
for a question or answer per day. The table below explains reputation point
requirements for each type of moderation task.
</p>
<table class="table table-striped">
<tbody>
<tr>
<td class="faq-rep-item"><strong>1</strong></td>
<td>upvote, add comments</td>
</tr><tr>
<td class="faq-rep-item"><strong>10</strong></td>
<td>downvote</td>
</tr><tr>
<td class="faq-rep-item"><strong>30</strong></td>
<td>insert text link, upload files</td>
</tr><tr>
<td class="faq-rep-item"><strong>50</strong></td>
<td>insert clickable link, answer own question immediately</td>
</tr><tr>
<td class="faq-rep-item"><strong>75</strong></td>
<td>retag, edit wiki questions and answers</td>
</tr><tr>
<td class="faq-rep-item"><strong>100</strong></td>
<td>flag offensive, close own questions</td>
</tr><tr>
<td class="faq-rep-item"><strong>200</strong></td>
<td>answer/comment by email</td>
</tr><tr>
<td class="faq-rep-item"><strong>300</strong></td>
<td>edit any post, view offensive flags</td>
</tr><tr>
<td class="faq-rep-item"><strong>400</strong></td>
<td>delete any comment</td>
</tr><tr>
<td class="faq-rep-item"><strong>500</strong></td>
<td>accept any answer (after 1 week)</td>
</tr><tr>
<td class="faq-rep-item"><strong>750</strong></td>
<td>delete any comment</td>
</tr><tr>
<td class="faq-rep-item"><strong>900</strong></td>
<td>lock posts</td>
</tr><tr>
<td class="faq-rep-item"><strong>1000</strong></td>
<td>delete any question or answer</td>
</tr>
</tbody>
</table>
<h2><a name="community_edit">Why can other people edit my questions/answers?</a></h2>
<p>
The goal of this site is create a relevant knowledge base that would answer
questions related to OpenERP.
</p><p>
Therefore questions and answers can be edited like wiki pages by experienced users of
this site in order to improve the overall quality of the knowledge base content.
Such privileges are granted based on user karma level: you will be able to do the same
once your karma gets high enough.
</p><p>
If this approach is not for you, please respect the community and use Google+
communities instead.
</p>
</t>
</template>
<template id="forum_index">
<t t-call="website.layout">
<!--TODO: Improve template -->
<t t-set="head">
<link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css' />
</t>
<div class="container">
<t t-foreach="forum_ids" t-as="forum">
<div class="speech-bubble speech-bubble-bottom mt32 mb32 pull-left" style="margin-left:30px">
<a style="color:white" t-attf-href="/forum/#{ slug(forum) }" t-field="forum.name"/>
</div>
</t>
</div>
<!--t t-call="website_forum.faq">
<div t-field="forum.faq"/>
</t-->
</t>
</template>
<template id="forum">
<t t-call="website.layout">
<!--TODO: Improve template -->
<div class="row">
<h1 class="text-center" t-attf-href="/forum/#{ slug(forum) }" t-field="forum.name"/>
</div>
<div class="row">
<h1 class="text-center" t-attf-href="/forum/#{ slug(forum) }/faq" t-field="forum.faq"/>
</div>
</t>
</template>
<template id="index">
<t t-call="website_forum.header">
<h1 class="page-header mt0">
<t t-esc="total_questions"/>
<span>Questions</span>
<small class="dropdown" t-if="searches.get('type') in ('all', 'unanswered','followed')">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<t t-if="searches.get('type') == 'all'">No filter</t>
<t t-if="searches.get('type') == 'unanswered'">Filter: Unanswered</t>
<t t-if="searches.get('type') == 'followed'">Filter: Followed</t>
<b class="caret"/>
</a>
<ul class="dropdown-menu">
<li class="dropdown-header">Filter on</li>
<li t-att-class="searches.get('type') == 'all' and 'active' or '' ">
<a t-attf-href="/forum/#{ slug(forum) }/?{{ keep_query( type='all') }}">All</a>
</li>
<li t-att-class="searches.get('type') == 'unanswered' and 'active' or '' ">
<a t-attf-href="/forum/#{ slug(forum) }/?{{ keep_query( type='unanswered') }}">Unanswered</a>
</li>
<li t-att-class="searches.get('type') == 'followed' and 'active' or '' ">
<a t-attf-href="/forum/#{ slug(forum) }/?{{ keep_query( type='followed') }}">Followed</a>
</li>
<li class="dropdown-header">Sort by</li>
<li>
<a href="#" class="active">Last activity date</a> <!-- default order to implement -->
</li>
<li>
<a href="#">Most answered</a>
</li>
<li>
<a href="#">Most voted</a>
</li>
</ul>
</small>
</h1>
<div t-foreach="question_ids" t-as="question" class="mb16">
<t t-call="website_forum.post_list" />
</div>
<t t-call="website.pager" />
</t>
</template>
<template id="404">
<t t-call="website_forum.header">
<div class="oe_structure oe_empty"/>
<h1 class="mt32">Question not found!</h1>
<p>Sorry, this question is not available anymore.</p>
<p>
<a t-attf-href="/forum">Return to the question list.</a>
</p>
</t>
</template>
<template id="user_detail">
<div>
<span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
<div>
<a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(user) }" t-field="user.name"/>
<t t-raw="separator or ', '"/>
<b><t t-esc="len(user.badges)"/> badges:</b>
<span class="fa fa-circle badge-gold"/>
<t t-esc="user.gold_badge"/>
<span class="fa fa-circle badge-silver"/>
<t t-esc="user.silver_badge"/>
<span class="fa fa-circle badge-bronze"/>
<t t-esc="user.bronze_badge"/>
<br/>
<t t-raw="0"/>
</div>
</div>
</template>
<template id="ask_question">
<t t-call="website_forum.header">
<h1 class="mt0">Ask your Question</h1>
<ul>
<li> please, try to make your question interesting to others </li>
<li> provide enough details and, if possible, give an example </li>
<li> be clear and concise, avoid unnecessary introductions (Hi, ... Thanks...) </li>
</ul>
<form t-attf-action="/forum/#{ slug(forum) }/question/ask/" method="post" role="form">
<input type="text" name="question_name" required="True" t-attf-value="#{question_name or ''}"
class="form-control" placeholder="Enter your Question"/>
<h5 class="mt20">Please enter a descriptive question (should finish by a '?')</h5>
<textarea name="question_content" required="True" class="form-control"
t-attf-value="#{question_content or ''}" id="textarea_ckeditor"/>
<input type="text" name="question_tag" t-attf-value="#{question_tag or ''}"
class="form-control" style="margin-top: 10px" placeholder="Tags"/>
<button class="btn btn-default forum_button" id="btn_ask_your_question"> Post Your Question </button>
</form>
<script type="text/javascript">
CKEDITOR.replace("textarea_ckeditor");
</script>
</t>
</template>
<template id="post_answer">
<h3 class="mt10">Your answer</h3>
<p>
<b>Please try to give a substantial answer.</b> If you wanted to comment on the question or answer, just
<b>use the commenting tool.</b> Please remember that you can always <b>revise your answers</b>
- no need to answer the same question twice. Also, please <b>don't forget to vote</b>
- it really helps to select the best questions and answers!
</p>
<form t-attf-action="/forum/#{ slug(forum) }/question/postanswer/" method="post" role="form">
<textarea name="answer_content" t-attf-value="#{answer_content or ''}"
class="form-control" id="textarea_ckeditor" required="True"/>
<input name="post_id" t-att-value="question.id" type="hidden"/>
<button class="btn btn-default forum_button" id="btn_ask_your_question"> Post Your Answer </button>
</form>
<script type="text/javascript">
CKEDITOR.replace("textarea_ckeditor");
</script>
</template>
<template id="edit_answer">
<t t-call="website_forum.header">
<h3>Edit answer</h3>
<form t-attf-action="/forum/#{ slug(forum) }/question/saveanswer/" method="post" role="form">
<textarea name="answer_content" required="True" value="content" class="form-control" id="textarea_ckeditor"/>
<input name="post_id" t-att-value="post.id" type="hidden"/>
<input name="answer_id" t-att-value="post_answer.id" type="hidden"/>
<button class="btn btn-default btn-lg forum_button"> Save edit </button>
</form>
<script type="text/javascript">
CKEDITOR.replace("textarea_ckeditor");
</script>
</t>
</template>
<template id="post_description_full" name="Question Navigation">
<t t-call="website_forum.header">
<form t-attf-action="/forum/#{ slug(forum) }/post_vote/" enctype="multipart/form-data" method="post" id="post_vote" role="form">
<input name="question_id" t-att-value="question.id" type="hidden"/>
<script type="text/javascript">
{
function getsupport (post_value, up_down)
{
var f=document.getElementById("post_vote")
var input = document.createElement("input");
input.name= "post_id";
input.type = "hidden";
input.value = post_value;
var vote = document.createElement("input");
vote.name= "vote";
vote.type = "hidden";
vote.value = up_down;
f.appendChild(input);
f.appendChild(vote);
document.getElementById('post_vote').submit();
}
}
</script>
</form>
<div class="question">
<div class="text-center pull-left">
<div t-attf-class="box oe_grey">
<a t-attf-class="fa fa-thumbs-up #{question.user_vote == 1 and 'text-success' or ''}"
t-attf-href="javascript:getsupport(#{ question.id },#{ 1 });"/>
<span t-esc="question.vote_count"/>
<a t-attf-class="fa fa-thumbs-down #{question.user_vote == -1 and 'text-warning' or ''}"
t-attf-href="javascript:getsupport(#{ question.id },#{ -1 });"/>
<div>
votes
</div>
</div>
<div class="text-muted">
<span t-esc="len(question.child_ids)"/>
<span t-if="len(question.child_ids)&gt;1">Answers</span>
<span t-if="len(question.child_ids)&lt;=1">Answer</span>
</div>
</div>
<div style="margin-left: 95px;">
<h1 t-field="question.name" class="mt0"/>
<t t-raw="question.content"/>
<div class="mt16 clearfix">
<div class="pull-right">
<t t-foreach="question.tags" t-as="tag">
<a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }" class="badge" t-field="tag.name"/>
</t>
</div>
<t t-set="user" t-value="question.create_uid"/>
<t t-call="website_forum.user_detail">
<span class="text-muted">Asked on <span t-field="question.write_date"/></span>
</t>
</div>
<t t-call="website_forum.comments">
<t t-set="object" t-value="question"/>
</t>
</div>
</div>
<hr/>
<div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
<div class="text-center pull-left">
<div t-attf-class="box oe_grey">
<a t-attf-class="fa fa-thumbs-up #{answer.user_vote == 1 and 'text-success' or ''}"
t-attf-href="javascript:getsupport(#{ answer.id },#{ 1 });"/>
<span t-esc="answer.vote_count"/>
<a t-attf-class="fa fa-thumbs-down #{answer.user_vote == -1 and 'text-warning' or ''}"
t-attf-href="javascript:getsupport(#{ answer.id },#{ -1 });"/>
<div>
votes
</div>
</div>
<div class="text-muted">
<a href="#" class="fa fa-2x fa-check"/>
</div>
</div>
<div style="margin-left: 95px;" class="clearfix">
<t t-raw="answer.content" />
<div class="mt16">
<div class="pull-right">
<a class="action-links" href="">
<span class="fa fa-edit"></span>
</a>
<a class="action-links" href="">
<span class="fa fa-flag"></span>
</a>
<a class="action-links" href="">
<span class="fa-trash-o"></span>
</a>
<a class="action-links" href="">
<span class="fa fa-link"></span>
</a>
</div>
<t t-set="user" t-value="answer.create_uid"/>
<t t-call="website_forum.user_detail">
<span class="text-muted">Answered on <span t-field="answer.create_date"/></span>
</t>
</div>
<t t-call="website_forum.comments">
<t t-set="object" t-value="answer"/>
</t>
</div>
</div>
<div t-if="not answer_done">
<t t-call="website_forum.post_answer"/>
</div>
<div t-if="answer_done">
<a class="btn btn-primary mb16" t-attf-href="/forum/#{ slug(forum) }/question/#{ question.id }/editanswer">Edit Your Previous Answer</a>
<span style="margin-bottom: 10px;">(only one answer per question is allowed)</span>
</div>
</t>
</template>
<template id="comments">
<h4 class="mt10"> <b>Comments</b> </h4>
<div class="mb10 css_editable_mode_hidden">
<form id="comment" t-attf-action="/forum/#{ slug(forum) }/comment" method="POST">
<input name="post_id" t-att-value="object.id" type="hidden"/>
<textarea rows="2" name="comment" class="form-control" placeholder="Write a comment..."></textarea>
<button type="submit" class="btn btn-primary mt8">Post</button>
</form>
</div>
<div class="clearfix"/>
<ul class="media-list" id="comments-list">
<li t-foreach="object.website_message_ids" t-as="message" class="media">
<div class="media-body">
<div t-field="message.body"/>
<h5 class="media-heading">
<a t-attf-href="/forum/#{ slug(forum) }/user/#{ message.author_id.id }" t-field="message.author_id"/>
<small>on <span t-field="message.date"/></small>
</h5>
</div>
</li>
</ul>
</template>
<template id="tag">
<t t-call="website_forum.header">
<h1 class="mt0">
Tags
</h1>
<p class="text-muted">
A tag is a label that categorizes your question with other,
similar questions. Using the right tags makes it easier for
others to find and answer your question.
</p>
<div class="row">
<div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
<a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }" class="badge">
<span t-field="tag.name" />
</a>
<span>
X <t t-esc="len(tag.post_ids)"/>
</span>
</div>
</div>
</t>
</template>
<template id="badge">
<t t-call="website_forum.header">
<h1 class="mt0">
Users with Badges
</h1>
<p>
Besides gaining reputation with your questions and answers,
you receive badges for being especially helpful. Badges
appear on your profile page, and your posts.
</p>
<table class="table mt32 mb64">
<tr t-foreach="badges" t-as="badge">
<td>
<a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge) }" class="badge pull-left">
<span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
<span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
<span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
<span t-field="badge.name" />
</a>
</td><td>
<b t-esc="len(badge.owner_ids)"/>
<i class="text-muted">awarded users</i>
</td><td>
<span t-field="badge.description"/>
</td>
</tr>
</table>
</t>
</template>
<template id="badge_user">
<t t-call="website_forum.header">
<h3 class="mt32 mb32">
<b>Badge "<span t-field="badge.name"/>"</b>
</h3>
<div>
<div class="pull-left badge">
<span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
<span t-if="badge.level == 'silver'" class="fa fa-circle badge-silver"/>
<span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
<span t-field="badge.name"/>
</div>
<span t-field="badge.description" style="margin-left:20px"/>
</div>
<h4 class="mt32">
<t class="pull-left" t-esc="len(badge.owner_ids)"/>
<span t-if="len(badge.owner_ids)&gt;1">users</span>
<span t-if="len(badge.owner_ids)&lt;=1">user</span>
received this badge:
</h4>
<div class="row">
<div class="col-sm-3 mt16" t-foreach="users" t-as="user">
<span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
<div>
<a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(user) }" t-field="user.name"/>
</div>
</div>
</div>
</t>
</template>
<template id="users">
<t t-call="website_forum.header">
<div class="row">
<div t-foreach="users" t-as="user" class="col-sm-4">
<t t-set="separator"><br/></t>
<t t-call="website_forum.user_detail"/>
<span class="text-muted">Joined on <span t-field="user.create_date" t-field-options='{"format":"short"}'/></span>
</div>
</div>
<div class="pull-left">
<t t-call="website.pager" />
</div>
</t>
</template>
<template id="user_detail_full">
<t t-call="website_forum.header">
<h1 class="mt0 page-header">
<span t-field="user.name" />
<small>profile</small>
</h1>
<div class="row">
<div class="col-sm-2">
<span t-field="user.image"
t-field-options='{"widget": "image", "class": "img img-responsive img-circle"}'/>
</div>
<div class="col-sm-5">
<table class="table table-condensed">
<tr>
<td rowspan="2" valign="top"><span class="text-muted">contributions</span></td>
<td>member since</td>
<td><span t-field="user.create_date" t-field-options='{"format": "short"}'/></td>
</tr><tr>
<td>last connection</td>
<td><span t-field="user.login_date" t-field-options='{"format": "short"}'/></td>
</tr>
</table>
</div><div class="col-sm-5">
<table class="table table-condensed">
<tr>
<td rowspan="3" valign="top"><span class="text-muted">stats</span></td>
<td>karma</td>
<td><span t-field="user.karma"/></td>
</tr><tr>
<td>up votes</td>
<td>
<span class="glyphicon glyphicon-thumbs-up"/>
<span t-esc="up_votes"/>
</td>
</tr><tr>
<td>down votes</td>
<td>
<span class="glyphicon glyphicon-thumbs-down"/>
<span t-esc="down_votes"/>
</td>
</tr>
</table>
</div>
<div class="col-sm-10">
<div class="well well-sm">
<!-- add website description here -->
<a href="#" class="fa fa-arrow-right"> Edit Your Bio</a>
</div>
</div>
</div>
<ul class="nav nav-tabs">
<li class="active">
<a href="#questions" data-toggle="tab"><t t-esc="len(questions)"/> Questions</a>
</li>
<li>
<a href="#answers" data-toggle="tab"><t t-esc="len(answers)"/> Answers</a>
</li>
<li>
<a href="#activity" data-toggle="tab">Activity</a>
</li>
<li>
<a href="#badges" data-toggle="tab">Badges</a>
</li>
<li>
<a href="#followed_question" data-toggle="tab">Followed Question</a>
</li>
</ul>
<div class="tab-content mt16">
<div class="tab-pane active" id="questions">
<div t-foreach="questions" t-as="question">
<t t-call="website_forum.post_list" />
</div>
</div><div class="tab-pane" id="answers">
<div t-foreach="answers" t-as="question">
<t t-call="website_forum.post_list" />
</div>
</div>
<div class="tab-pane" id="karma">
<h1>Karma</h1>
</div>
<div class="tab-pane" id="badges">
<t t-call="website_forum.user_badges" />
</div>
<div class="tab-pane" id="followed_question">
<h1>Followed Questions</h1>
</div>
<div class="tab-pane" id="activity">
<t t-call="website_forum.user_activity" />
</div>
</div>
</t>
</template>
<template id="user_activity">
<ul class="media-list">
<li t-foreach="activities" t-as="activity" class="media">
<small t-esc="activity.create_date" class="pull-left"/>
<span t-field="activity.type" class="label label-info"/>
<a t-esc="activity.name" t-if="not activity.post_id.parent_id"
t-attf-href="/forum/#{ slug(forum) }/question/#{ activity.post_id.id }"/>
<t t-if="activity.post_id.parent_id">
<a t-esc="activity.post_id.parent_id.name"
t-attf-href="/forum/#{ slug(forum) }/question/#{ activity.post_id.parent_id.id }"/>
<span class="glyphicon glyphicon-play"/>
<t t-esc="activity.post_id.content[0:100]"/>
<strong> ... </strong>
</t>
</li>
</ul>
</template>
<template id="user_badges">
<div class="row mb32">
<div class="col-sm-3 mt16" t-foreach="user.badges" t-as="badge">
<a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge">
<span t-field="badge.badge_id.name" />
</a>
<span>
X <t t-esc="len(badge.badge_id.owner_ids)"/>
</span>
</div>
</div>
<b t-if="not user.badges" class="mb32">No badge yet!</b>
</template>
</data>
</openerp>