'notifications': self._get_notifications(),
'header': kwargs.get('header', dict()),
'searches': kwargs.get('searches', dict()),
- 'no_introduction_message': request.session.get('no_introduction_message', False),
+ 'no_introduction_message': request.httprequest.cookies.get('no_introduction_message', False),
}
if forum:
values['forum'] = forum
arch = lxml.html.parse(urlopen(kwargs.get('url')))
return arch.find(".//title").text
- @http.route('/forum/remove_introduction_message', type='json', auth="public", methods=['POST'], website=True)
- def remove_introduction_message(self, **kwargs):
- request.session['no_introduction_message'] = True
- return True
-
@http.route(['''/forum/<model("forum.forum"):forum>/question/<model("forum.post", "[('forum_id','=',forum[0]),('parent_id','=',False)]"):question>'''], type='http', auth="public", website=True)
def question(self, forum, question, **post):
cr, uid, context = request.cr, request.uid, request.context
$('.close_introduction_message').on('click', function (ev) {
ev.preventDefault();
- var $link = $(ev.currentTarget);
- openerp.jsonRpc("/forum/remove_introduction_message", 'call', {})
+ document.cookie = "no_introduction_message = false";
return true;
});
t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
</a>
</li>
- <li t-if="question.type != 'question'">
+ <li t-if="question.type != 'question' and not answer.parent_id or answer.parent_id and not answer.parent_id.parent_id">
<a t-attf-class="fa fa-comment-o #{not answer.can_comment and 'karma_required text-muted' or ''}"
t-attf-data-karma="#{not answer.can_comment and answer.karma_comment or 0}"
style="cursor: pointer" data-toggle="collapse"