[FIX] forum
This commit is contained in:
@@ -79,7 +79,7 @@ class WebsiteForum(http.Controller):
|
||||
'''/forum/<model("forum.forum"):forum>/tag/<model("forum.tag", "[('forum_id','=',forum[0])]"):tag>/questions''',
|
||||
'''/forum/<model("forum.forum"):forum>/tag/<model("forum.tag", "[('forum_id','=',forum[0])]"):tag>/questions/page/<int:page>''',
|
||||
], type='http', auth="public", website=True)
|
||||
def questions(self, forum, tag=None, page=1, filters='all', sorting=None, search='', post_type='all', **post):
|
||||
def questions(self, forum, tag=None, page=1, filters='all', sorting=None, search='', post_type=None, **post):
|
||||
cr, uid, context = request.cr, request.uid, request.context
|
||||
Post = request.registry['forum.post']
|
||||
user = request.registry['res.users'].browse(cr, uid, uid, context=context)
|
||||
@@ -93,14 +93,14 @@ class WebsiteForum(http.Controller):
|
||||
domain += [('child_ids', '=', False)]
|
||||
elif filters == 'followed':
|
||||
domain += [('message_follower_ids', '=', user.partner_id.id)]
|
||||
else:
|
||||
filters = 'all'
|
||||
|
||||
if post_type:
|
||||
domain += [('type', '=', post_type)]
|
||||
if not sorting:
|
||||
sorting = forum.default_order
|
||||
|
||||
print domain
|
||||
|
||||
question_count = Post.search(cr, uid, domain, count=True, context=context)
|
||||
if tag:
|
||||
url = "/forum/%s/tag/%s/questions" % (slug(forum), slug(tag))
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
<div class="col-md-10 clearfix">
|
||||
<div class="question-name">
|
||||
<t t-if="question.type == 'link'">
|
||||
<a t-att-href="question.name" t-raw="question.content"/>
|
||||
<a t-att-href="question.content_link" t-raw="question.name"/>
|
||||
</t>
|
||||
<t t-if="question.type in ('question', 'discussion')">
|
||||
<a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
|
||||
|
||||
Reference in New Issue
Block a user