[MRG] merge lp:~openerp-dev/openobject-addons/trunk-website-forum-tpa-template_ans-ssh adding answer template to show anwers on user profile.

bzr revid: tpa@tinyerp.com-20140321132140-hmnt072v4kw6it0q
This commit is contained in:
Turkesh Patel (Open ERP) 2014-03-21 18:51:40 +05:30
commit 224bc24310
2 changed files with 20 additions and 3 deletions

View File

@ -225,7 +225,7 @@ class website_forum(http.Controller):
'searches': post,
'forum': forum,
'questions': user_questions,
'answers': answers,
'answers': user_answers,
'total_votes': total_votes,
'up_votes': up_votes,
'down_votes': down_votes,

View File

@ -699,8 +699,8 @@
<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 t-foreach="answers" t-as="answer">
<t t-call="website_forum.post_list_answer"/>
</div>
</div>
<div class="tab-pane" id="karma">
@ -769,5 +769,22 @@
<b>No vote given by you yet!</b>
</div>
</template>
<template id="post_list_answer">
<div class="clearfix">
<div t-attf-class="pull-left text-center mb16 box #{len(answer.vote_ids) and 'oe_green' or 'oe_grey'}">
<div t-esc="len(answer.vote_ids)"/>
</div>
<div class="question-name" style="margin-left: 32px;">
<a style="font-size: 15px;" t-attf-href="/forum/#{ slug(forum) }/question/#{ answer.parent_id.id }/#answer-#{ answer.id }" t-esc="answer.name"/>
<t t-if="len(answer.website_message_ids)&gt;0">
(<t t-esc="len(answer.website_message_ids)"/>
<t t-if="len(answer.website_message_ids)&gt;1">Comments</t>
<t t-if="len(answer.website_message_ids)&lt;=1">Comment</t>)
</t>
</div>
</div>
</template>
</data>
</openerp>