#activity by user.
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)], context=context)
activities = Activity.browse(cr, uid, activity_ids, context=context)
posts = {}
'content': post.get('content'),
}
question_tags = []
- if post.get('question_tag').strip('[]'):
+ if post.get('question_tag') and post.get('question_tag').strip('[]'):
Tag = request.registry['website.forum.tag']
tags = post.get('question_tag').strip('[]').replace('"','').split(",")
for tag in tags:
} else if (data['error'] == 'user'){
var $warning = $('<div class="alert alert-danger alert-dismissable" id="correct_answer_alert" style="position:absolute; margin-top: -30px; margin-left: 90px;">'+
'<button type="button" class="close notification_close" data-dismiss="alert" aria-hidden="true">×</button>'+
- 'Sorry, You cannot choose correct answer.'+
+ 'Sorry, the user who asked this question can only accept the answer as correct.'+
'</div>');
}
correct_answer_alert = $link.parent().find("#correct_answer_alert");
<div class="tab-pane" id="activity">
<ul class="list-unstyled">
<li t-foreach="activities" t-as="activity">
- <span t-esc="activity.date"/>
+ <span t-field="activity.date" t-field-options='{"format": "short"}'/>
<span t-esc="activity.subtype_id.name" class="label label-info"/>
<t t-set="post" t-value="posts[activity.res_id]"/>
<span t-if="post[1]">
<a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }#answer-#{ str(post[1].id) }">
- Gave an answer
- </a> on
+ <span t-esc="post[0].name"/>
+ </a>
+ </span>
+ <span t-if="not post[1]">
+ <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
+ <span t-esc="post[0].name"/>
+ </a>
</span>
- <a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post[0]) }">
- <span t-esc="post[0].name"/>
- </a>
</li>
</ul>
</div>