[mrg]:lp:~openerp-dev/openobject-addons/trunk-website-forum-tpa
bzr revid: sunilsharma.sharma07@gmail.com-20140319121853-6h9pmz1zxr8fk5vy
This commit is contained in:
commit
cf338062c9
|
@ -34,7 +34,9 @@ class gamification_badge_user(osv.Model):
|
||||||
|
|
||||||
_name = 'gamification.badge.user'
|
_name = 'gamification.badge.user'
|
||||||
_description = 'Gamification user badge'
|
_description = 'Gamification user badge'
|
||||||
|
_inherit = ['mail.thread']
|
||||||
_order = "create_date desc"
|
_order = "create_date desc"
|
||||||
|
_rec_name = "badge_name"
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'user_id': fields.many2one('res.users', string="User", required=True),
|
'user_id': fields.many2one('res.users', string="User", required=True),
|
||||||
|
@ -57,16 +59,16 @@ class gamification_badge_user(osv.Model):
|
||||||
"""
|
"""
|
||||||
res = True
|
res = True
|
||||||
temp_obj = self.pool.get('email.template')
|
temp_obj = self.pool.get('email.template')
|
||||||
user_obj = self.pool.get('res.users')
|
|
||||||
template_id = self.pool['ir.model.data'].get_object(cr, uid, 'gamification', 'email_template_badge_received', context)
|
template_id = self.pool['ir.model.data'].get_object(cr, uid, 'gamification', 'email_template_badge_received', context)
|
||||||
for badge_user in self.browse(cr, uid, ids, context=context):
|
for badge_user in self.browse(cr, uid, ids, context=context):
|
||||||
body_html = temp_obj.render_template(cr, uid, template_id.body_html, 'gamification.badge.user', badge_user.id, context=context)
|
body_html = temp_obj.render_template(cr, uid, template_id.body_html, 'gamification.badge.user', badge_user.id, context=context)
|
||||||
res = user_obj.message_post(cr, uid, badge_user.user_id.id, body=body_html, context=context)
|
res = self.message_post(cr, uid, badge_user.id, body=body_html, partner_ids=[badge_user.user_id.partner_id.id], context=context)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def create(self, cr, uid, vals, context=None):
|
def create(self, cr, uid, vals, context=None):
|
||||||
|
create_context = dict(context, mail_create_nolog=True)
|
||||||
self.pool.get('gamification.badge').check_granting(cr, uid, badge_id=vals.get('badge_id'), context=context)
|
self.pool.get('gamification.badge').check_granting(cr, uid, badge_id=vals.get('badge_id'), context=context)
|
||||||
return super(gamification_badge_user, self).create(cr, uid, vals, context=context)
|
return super(gamification_badge_user, self).create(cr, uid, vals, context=create_context)
|
||||||
|
|
||||||
|
|
||||||
class gamification_badge(osv.Model):
|
class gamification_badge(osv.Model):
|
||||||
|
|
|
@ -53,6 +53,15 @@ class website_forum(http.Controller):
|
||||||
}, context=request.context)
|
}, context=request.context)
|
||||||
return request.redirect("/forum/%s" % forum_id)
|
return request.redirect("/forum/%s" % forum_id)
|
||||||
|
|
||||||
|
def _get_notifications(self, **kwargs):
|
||||||
|
cr, uid, context = request.cr, request.uid, request.context
|
||||||
|
Message = request.registry['mail.message']
|
||||||
|
BadgeUser = request.registry['gamification.badge.user']
|
||||||
|
#notification to user.
|
||||||
|
badgeuser_ids = BadgeUser.search(cr, uid, [('user_id', '=', uid)], context=context)
|
||||||
|
notification_ids = Message.search(cr, uid, [('res_id', 'in', badgeuser_ids), ('model', '=', 'gamification.badge.user'), ('to_read', '=', True)], context=context)
|
||||||
|
return Message.browse(cr, uid, notification_ids, context=context)
|
||||||
|
|
||||||
@http.route(['/forum/<model("website.forum"):forum>', '/forum/<model("website.forum"):forum>/page/<int:page>'], type='http', auth="public", website=True, multilang=True)
|
@http.route(['/forum/<model("website.forum"):forum>', '/forum/<model("website.forum"):forum>/page/<int:page>'], type='http', auth="public", website=True, multilang=True)
|
||||||
def questions(self, forum, page=1, filters='', sorting='', **searches):
|
def questions(self, forum, page=1, filters='', sorting='', **searches):
|
||||||
cr, uid, context = request.cr, request.uid, request.context
|
cr, uid, context = request.cr, request.uid, request.context
|
||||||
|
@ -94,6 +103,7 @@ class website_forum(http.Controller):
|
||||||
'uid': uid,
|
'uid': uid,
|
||||||
'total_questions': question_count,
|
'total_questions': question_count,
|
||||||
'question_ids': question_ids,
|
'question_ids': question_ids,
|
||||||
|
'notifications': self._get_notifications(),
|
||||||
'forum': forum,
|
'forum': forum,
|
||||||
'pager': pager,
|
'pager': pager,
|
||||||
'filters': filters,
|
'filters': filters,
|
||||||
|
@ -103,14 +113,27 @@ class website_forum(http.Controller):
|
||||||
|
|
||||||
return request.website.render("website_forum.index", values)
|
return request.website.render("website_forum.index", values)
|
||||||
|
|
||||||
|
@http.route('/forum/notification_read/', type='json', auth="user", multilang=True, methods=['POST'], website=True)
|
||||||
|
def notification_read(self, **kwarg):
|
||||||
|
request.registry['mail.message'].set_message_read(request.cr, request.uid, [int(kwarg.get('notification_id'))], read=True, context=request.context)
|
||||||
|
return True
|
||||||
|
|
||||||
@http.route(['/forum/<model("website.forum"):forum>/faq'], type='http', auth="public", website=True, multilang=True)
|
@http.route(['/forum/<model("website.forum"):forum>/faq'], type='http', auth="public", website=True, multilang=True)
|
||||||
def faq(self, forum, **post):
|
def faq(self, forum, **post):
|
||||||
values = { 'searches': {}, 'forum':forum }
|
values = {
|
||||||
|
'searches': {},
|
||||||
|
'forum':forum,
|
||||||
|
'notifications': self._get_notifications(),
|
||||||
|
}
|
||||||
return request.website.render("website_forum.faq", values)
|
return request.website.render("website_forum.faq", values)
|
||||||
|
|
||||||
@http.route(['/forum/<model("website.forum"):forum>/ask'], type='http', auth="public", website=True, multilang=True)
|
@http.route(['/forum/<model("website.forum"):forum>/ask'], type='http', auth="public", website=True, multilang=True)
|
||||||
def question_ask(self, forum, **post):
|
def question_ask(self, forum, **post):
|
||||||
values = { 'searches': {}, 'forum': forum }
|
values = {
|
||||||
|
'searches': {},
|
||||||
|
'forum': forum,
|
||||||
|
'notifications': self._get_notifications(),
|
||||||
|
}
|
||||||
return request.website.render("website_forum.ask_question", values)
|
return request.website.render("website_forum.ask_question", values)
|
||||||
|
|
||||||
@http.route(['/forum/<model("website.forum"):forum>/question/<model("website.forum.post"):question>'], type='http', auth="public", website=True, multilang=True)
|
@http.route(['/forum/<model("website.forum"):forum>/question/<model("website.forum.post"):question>'], type='http', auth="public", website=True, multilang=True)
|
||||||
|
@ -122,6 +145,7 @@ class website_forum(http.Controller):
|
||||||
filters = 'question'
|
filters = 'question'
|
||||||
values = {
|
values = {
|
||||||
'question': question,
|
'question': question,
|
||||||
|
'notifications': self._get_notifications(),
|
||||||
'searches': post,
|
'searches': post,
|
||||||
'filters': filters,
|
'filters': filters,
|
||||||
'answer_done': answer_done,
|
'answer_done': answer_done,
|
||||||
|
@ -162,6 +186,7 @@ class website_forum(http.Controller):
|
||||||
Activity = request.registry['mail.message']
|
Activity = request.registry['mail.message']
|
||||||
Data = request.registry["ir.model.data"]
|
Data = request.registry["ir.model.data"]
|
||||||
|
|
||||||
|
#questions asked by user.
|
||||||
question_ids = Post.search(cr, uid, [('forum_id', '=', forum.id), ('user_id', '=', user.id), ('parent_id', '=', False)], context=context)
|
question_ids = Post.search(cr, uid, [('forum_id', '=', forum.id), ('user_id', '=', user.id), ('parent_id', '=', False)], context=context)
|
||||||
user_questions = Post.browse(cr, uid, question_ids, context=context)
|
user_questions = Post.browse(cr, uid, question_ids, context=context)
|
||||||
|
|
||||||
|
@ -170,16 +195,21 @@ class website_forum(http.Controller):
|
||||||
user_answers = Post.browse(cr, uid, obj_ids, context=context)
|
user_answers = Post.browse(cr, uid, obj_ids, context=context)
|
||||||
answers = [answer.parent_id for answer in user_answers]
|
answers = [answer.parent_id for answer in user_answers]
|
||||||
|
|
||||||
|
#votes which given on users questions and answers.
|
||||||
total_votes = Vote.search(cr, uid, [('post_id.forum_id', '=', forum.id), ('post_id.user_id', '=', user.id)], count=True, context=context)
|
total_votes = Vote.search(cr, uid, [('post_id.forum_id', '=', forum.id), ('post_id.user_id', '=', user.id)], count=True, context=context)
|
||||||
up_votes = Vote.search(cr, uid, [('post_id.forum_id', '=', forum.id), ('post_id.user_id', '=', user.id), ('vote', '=', '1')], count=True, context=context)
|
up_votes = Vote.search(cr, uid, [('post_id.forum_id', '=', forum.id), ('post_id.user_id', '=', user.id), ('vote', '=', '1')], count=True, context=context)
|
||||||
down_votes = Vote.search(cr, uid, [('post_id.forum_id', '=', forum.id), ('post_id.user_id', '=', user.id), ('vote', '=', '-1')], count=True, context=context)
|
down_votes = Vote.search(cr, uid, [('post_id.forum_id', '=', forum.id), ('post_id.user_id', '=', user.id), ('vote', '=', '-1')], count=True, context=context)
|
||||||
|
|
||||||
|
#Votes which given by users on others questions and answers.
|
||||||
|
post_votes = Vote.search(cr, uid, [('user_id', '=', uid)], context=context)
|
||||||
|
vote_ids = Vote.browse(cr, uid, post_votes, context=context)
|
||||||
|
|
||||||
|
#activity by user.
|
||||||
user_post_ids = question_ids + obj_ids
|
user_post_ids = question_ids + obj_ids
|
||||||
model, comment = Data.get_object_reference(cr, uid, 'mail', 'mt_comment')
|
model, comment = Data.get_object_reference(cr, uid, 'mail', 'mt_comment')
|
||||||
activity_ids = Activity.search(cr, uid, [('res_id', 'in', user_post_ids), ('model', '=', 'website.forum.post'), '|', ('subtype_id', '!=', comment), ('subtype_id', '=', False)], context=context)
|
activity_ids = Activity.search(cr, uid, [('res_id', 'in', user_post_ids), ('model', '=', 'website.forum.post'), '|', ('subtype_id', '!=', comment), ('subtype_id', '=', False)], context=context)
|
||||||
activities = Activity.browse(cr, uid, activity_ids, context=context)
|
activities = Activity.browse(cr, uid, activity_ids, context=context)
|
||||||
|
|
||||||
|
|
||||||
posts = {}
|
posts = {}
|
||||||
for act in activities:
|
for act in activities:
|
||||||
posts[act.res_id] = True
|
posts[act.res_id] = True
|
||||||
|
@ -200,7 +230,9 @@ class website_forum(http.Controller):
|
||||||
'up_votes': up_votes,
|
'up_votes': up_votes,
|
||||||
'down_votes': down_votes,
|
'down_votes': down_votes,
|
||||||
'activities': activities,
|
'activities': activities,
|
||||||
'posts': posts
|
'posts': posts,
|
||||||
|
'vote_post':vote_ids,
|
||||||
|
'notifications': self._get_notifications(),
|
||||||
}
|
}
|
||||||
return request.website.render("website_forum.user_detail_full", values)
|
return request.website.render("website_forum.user_detail_full", values)
|
||||||
|
|
||||||
|
@ -245,6 +277,7 @@ class website_forum(http.Controller):
|
||||||
values = {
|
values = {
|
||||||
'post': post,
|
'post': post,
|
||||||
'post_answer': post_answer,
|
'post_answer': post_answer,
|
||||||
|
'notifications': self._get_notifications(),
|
||||||
'forum': forum,
|
'forum': forum,
|
||||||
'searches': kwargs
|
'searches': kwargs
|
||||||
}
|
}
|
||||||
|
@ -271,6 +304,7 @@ class website_forum(http.Controller):
|
||||||
|
|
||||||
values = {
|
values = {
|
||||||
'question_ids': question_ids,
|
'question_ids': question_ids,
|
||||||
|
'notifications': self._get_notifications(),
|
||||||
'pager': pager,
|
'pager': pager,
|
||||||
'forum': forum,
|
'forum': forum,
|
||||||
'searches': kwargs
|
'searches': kwargs
|
||||||
|
@ -285,6 +319,7 @@ class website_forum(http.Controller):
|
||||||
tags = Tag.browse(cr, uid, obj_ids, context=context)
|
tags = Tag.browse(cr, uid, obj_ids, context=context)
|
||||||
values = {
|
values = {
|
||||||
'tags': tags,
|
'tags': tags,
|
||||||
|
'notifications': self._get_notifications(),
|
||||||
'forum': forum,
|
'forum': forum,
|
||||||
'searches': {'tags': True}
|
'searches': {'tags': True}
|
||||||
}
|
}
|
||||||
|
@ -298,6 +333,7 @@ class website_forum(http.Controller):
|
||||||
badges = Badge.browse(cr, uid, badge_ids, context=context)
|
badges = Badge.browse(cr, uid, badge_ids, context=context)
|
||||||
values = {
|
values = {
|
||||||
'badges': badges,
|
'badges': badges,
|
||||||
|
'notifications': [],
|
||||||
'forum': forum,
|
'forum': forum,
|
||||||
'searches': {'badges': True}
|
'searches': {'badges': True}
|
||||||
}
|
}
|
||||||
|
@ -310,6 +346,7 @@ class website_forum(http.Controller):
|
||||||
|
|
||||||
values = {
|
values = {
|
||||||
'badge': badge,
|
'badge': badge,
|
||||||
|
'notifications': [],
|
||||||
'users': users,
|
'users': users,
|
||||||
'forum': forum,
|
'forum': forum,
|
||||||
'searches': kwargs
|
'searches': kwargs
|
||||||
|
@ -331,6 +368,7 @@ class website_forum(http.Controller):
|
||||||
|
|
||||||
values = {
|
values = {
|
||||||
'users': users,
|
'users': users,
|
||||||
|
'notifications': self._get_notifications(),
|
||||||
'pager': pager,
|
'pager': pager,
|
||||||
'forum': forum,
|
'forum': forum,
|
||||||
'searches': searches,
|
'searches': searches,
|
||||||
|
@ -364,7 +402,8 @@ class website_forum(http.Controller):
|
||||||
values = {
|
values = {
|
||||||
'post': post,
|
'post': post,
|
||||||
'forum': forum,
|
'forum': forum,
|
||||||
'searches': kwarg
|
'searches': kwarg,
|
||||||
|
'notifications': self._get_notifications(),
|
||||||
}
|
}
|
||||||
return request.website.render("website_forum.edit_question", values)
|
return request.website.render("website_forum.edit_question", values)
|
||||||
|
|
||||||
|
@ -382,7 +421,8 @@ class website_forum(http.Controller):
|
||||||
'post': post,
|
'post': post,
|
||||||
'post_answer': answer,
|
'post_answer': answer,
|
||||||
'forum': forum,
|
'forum': forum,
|
||||||
'searches': kwarg
|
'searches': kwarg,
|
||||||
|
'notifications': self._get_notifications(),
|
||||||
}
|
}
|
||||||
return request.website.render("website_forum.edit_answer", values)
|
return request.website.render("website_forum.edit_answer", values)
|
||||||
|
|
||||||
|
@ -415,6 +455,7 @@ class website_forum(http.Controller):
|
||||||
'forum': forum,
|
'forum': forum,
|
||||||
'searches': kwarg,
|
'searches': kwarg,
|
||||||
'countries': countries,
|
'countries': countries,
|
||||||
|
'notifications': self._get_notifications(),
|
||||||
}
|
}
|
||||||
return request.website.render("website_forum.edit_profile", values)
|
return request.website.render("website_forum.edit_profile", values)
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,15 @@ $(document).ready(function () {
|
||||||
.then(function (data) {
|
.then(function (data) {
|
||||||
$link.parents('#comment').remove();
|
$link.parents('#comment').remove();
|
||||||
});
|
});
|
||||||
return false;
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.notification_close').on('click', function (ev) {
|
||||||
|
ev.preventDefault();
|
||||||
|
var $link = $(ev.currentTarget);
|
||||||
|
openerp.jsonRpc("/forum/notification_read/", 'call', {
|
||||||
|
'notification_id': $link.attr("id")})
|
||||||
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
|
@ -66,7 +66,7 @@
|
||||||
<template id="header" name="Forum Index">
|
<template id="header" name="Forum Index">
|
||||||
<t t-call="website.layout">
|
<t t-call="website.layout">
|
||||||
<t t-set="head">
|
<t t-set="head">
|
||||||
<link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css' />
|
<link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
|
||||||
</t>
|
</t>
|
||||||
<div class="container mt16">
|
<div class="container mt16">
|
||||||
<div class="navbar navbar-default">
|
<div class="navbar navbar-default">
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="search" class="form-control"
|
<input type="search" class="form-control"
|
||||||
name="search" placeholder="Search a question..."
|
name="search" placeholder="Search a question..."
|
||||||
t-att-value="searches.get('search') or ''" />
|
t-att-value="searches.get('search') or ''"/>
|
||||||
<button type="submit" class="btn btn-default">Search</button>
|
<button type="submit" class="btn btn-default">Search</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -111,13 +111,14 @@
|
||||||
<div id="wrap" class="container">
|
<div id="wrap" class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<div class="alert alert-success alert-dismissable">
|
<div t-foreach="notifications" t-as="notification" class="alert alert-success alert-dismissable">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
|
<button type="button" class="close notification_close" t-att-id="notification.id" data-dismiss="alert" aria-hidden="true">&times;</button>
|
||||||
<strong>Congratulation!</strong> You received the <em>New Author</em> badge!<br/>
|
<div t-field="notification.body"/>
|
||||||
<a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right">View Your Badges</a>
|
<a t-attf-href="/forum/#{ slug(forum) }/badge" class="fa fa-arrow-right">View Your Badges</a>
|
||||||
</div>
|
</div>
|
||||||
<t t-raw="0"/>
|
<t t-raw="0"/>
|
||||||
</div><div class="col-sm-3" id="right-column">
|
</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>
|
<a class="btn btn-primary btn-lg btn-block mb16" t-attf-href="/forum/#{ slug(forum) }/ask">Ask a Question</a>
|
||||||
<div t-field="forum.right_column"/>
|
<div t-field="forum.right_column"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -189,9 +190,9 @@
|
||||||
</small>
|
</small>
|
||||||
</h1>
|
</h1>
|
||||||
<div t-foreach="question_ids" t-as="question" class="mb16">
|
<div t-foreach="question_ids" t-as="question" class="mb16">
|
||||||
<t t-call="website_forum.post_list" />
|
<t t-call="website_forum.post_list"/>
|
||||||
</div>
|
</div>
|
||||||
<t t-call="website.pager" />
|
<t t-call="website.pager"/>
|
||||||
</t>
|
</t>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -380,7 +381,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-left: 95px;" class="clearfix">
|
<div style="margin-left: 95px;" class="clearfix">
|
||||||
<t t-raw="answer.content" />
|
<t t-raw="answer.content"/>
|
||||||
<div class="mt16">
|
<div class="mt16">
|
||||||
<ul class="list-inline pull-right">
|
<ul class="list-inline pull-right">
|
||||||
<li>
|
<li>
|
||||||
|
@ -418,11 +419,9 @@
|
||||||
<div class="col-sm-10 col-sm-offset-2">
|
<div class="col-sm-10 col-sm-offset-2">
|
||||||
<div t-foreach="reversed(object.website_message_ids)" t-as="message" id="comment" class="oe_grey" style="padding: 4px;">
|
<div t-foreach="reversed(object.website_message_ids)" t-as="message" id="comment" class="oe_grey" style="padding: 4px;">
|
||||||
<small class="text-muted">
|
<small class="text-muted">
|
||||||
<t t-if="uid == message.create_uid.id">
|
<button type="button" t-if="uid == message.create_uid.id" t-att-id="message.id" class="close comment_delete">&times;</button>
|
||||||
<button type="button" t-att-id="message.id" class="close comment_delete">&times;</button>
|
<span t-field="message.body"/>
|
||||||
</t>
|
<a t-attf-href="/forum/#{ slug(forum) }/user/#{ message.create_uid.id }" t-field="message.create_uid"/>
|
||||||
<div t-field="message.body"/>
|
|
||||||
<a t-attf-href="/forum/#{ slug(forum) }/user/#{ message.create_uid.id }" t-field="message.create_uid"/>
|
|
||||||
on <span t-field="message.date" t-field-options='{"format":"short"}'/>
|
on <span t-field="message.date" t-field-options='{"format":"short"}'/>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
@ -450,7 +449,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
|
<div class="col-sm-3 mt16" t-foreach="tags" t-as="tag">
|
||||||
<a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }" class="badge">
|
<a t-attf-href="/forum/#{ slug(forum) }/tag/#{ slug(tag) }" class="badge">
|
||||||
<span t-field="tag.name" />
|
<span t-field="tag.name"/>
|
||||||
</a>
|
</a>
|
||||||
<span>
|
<span>
|
||||||
X <t t-esc="tag.posts_count"/>
|
X <t t-esc="tag.posts_count"/>
|
||||||
|
@ -477,7 +476,7 @@
|
||||||
<span t-if="badge.level == 'gold'" class="fa fa-circle badge-gold"/>
|
<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 == 'silver'" class="fa fa-circle badge-silver"/>
|
||||||
<span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
|
<span t-if="badge.level == 'bronze'" class="fa fa-circle badge-bronze"/>
|
||||||
<span t-field="badge.name" />
|
<span t-field="badge.name"/>
|
||||||
</a>
|
</a>
|
||||||
</td><td>
|
</td><td>
|
||||||
<b t-esc="badge.stat_count_distinct"/>
|
<b t-esc="badge.stat_count_distinct"/>
|
||||||
|
@ -531,7 +530,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
<t t-call="website.pager" />
|
<t t-call="website.pager"/>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
</template>
|
</template>
|
||||||
|
@ -656,26 +655,32 @@
|
||||||
<li>
|
<li>
|
||||||
<a href="#followed_question" data-toggle="tab">Followed Question</a>
|
<a href="#followed_question" data-toggle="tab">Followed Question</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#votes" data-toggle="tab">Votes</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content mt16">
|
<div class="tab-content mt16">
|
||||||
<div class="tab-pane active" id="questions">
|
<div class="tab-pane active" id="questions">
|
||||||
<div t-foreach="questions" t-as="question">
|
<div t-foreach="questions" t-as="question">
|
||||||
<t t-call="website_forum.post_list" />
|
<t t-call="website_forum.post_list"/>
|
||||||
</div>
|
</div>
|
||||||
</div><div class="tab-pane" id="answers">
|
</div><div class="tab-pane" id="answers">
|
||||||
<div t-foreach="answers" t-as="question">
|
<div t-foreach="answers" t-as="question">
|
||||||
<t t-call="website_forum.post_list" />
|
<t t-call="website_forum.post_list"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane" id="karma">
|
<div class="tab-pane" id="karma">
|
||||||
<h1>Karma</h1>
|
<h1>Karma</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane" id="badges">
|
<div class="tab-pane" id="badges">
|
||||||
<t t-call="website_forum.user_badges" />
|
<t t-call="website_forum.user_badges"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane" id="followed_question">
|
<div class="tab-pane" id="followed_question">
|
||||||
<h1>Followed Questions</h1>
|
<h1>Followed Questions</h1>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab-pane" id="votes">
|
||||||
|
<t t-call="website_forum.user_votes"/>
|
||||||
|
</div>
|
||||||
<div class="tab-pane" id="activity">
|
<div class="tab-pane" id="activity">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li t-foreach="activities" t-as="activity">
|
<li t-foreach="activities" t-as="activity">
|
||||||
|
@ -701,7 +706,7 @@
|
||||||
<div class="row mb16">
|
<div class="row mb16">
|
||||||
<div class="col-sm-3 mt16" t-foreach="user.badges" t-as="badge">
|
<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">
|
<a t-attf-href="/forum/#{ slug(forum) }/badge/#{ slug(badge.badge_id) }" class="badge">
|
||||||
<span t-field="badge.badge_id.name" />
|
<span t-field="badge.badge_id.name"/>
|
||||||
</a>
|
</a>
|
||||||
<span>
|
<span>
|
||||||
X <t t-esc="badge.badge_id.stat_count_distinct"/>
|
X <t t-esc="badge.badge_id.stat_count_distinct"/>
|
||||||
|
@ -714,5 +719,21 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template id="user_votes">
|
||||||
|
<div t-foreach="vote_post" t-as="vote">
|
||||||
|
<t t-esc="vote.post_id.create_date"/>
|
||||||
|
<span t-if="vote.vote == '1'" class="fa fa-thumbs-up text-success" style="margin-left:30px"/>
|
||||||
|
<span t-if="vote.vote == '-1'" class="fa fa-thumbs-down text-warning" style="margin-left:30px"/>
|
||||||
|
<t t-if="vote.post_id.parent_id">
|
||||||
|
<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"/>
|
||||||
|
</t>
|
||||||
|
<t t-if="not vote.post_id.parent_id">
|
||||||
|
<a t-attf-href="/forum/#{ slug(forum) }/question/#{ vote.post_id.id }" style=" color:black;margin-left:10px" t-esc="vote.post_id.name"/>
|
||||||
|
</t>
|
||||||
|
</div>
|
||||||
|
<div class="mb16" t-if="not vote_post">
|
||||||
|
<b>No vote given by you yet!</b>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
Loading…
Reference in New Issue