[FIX] website_blog: category active

bzr revid: chm@openerp.com-20131118144108-jupdlu19g1d9r66t
This commit is contained in:
Christophe Matthieu
2013-11-18 15:41:08 +01:00
parent 5a6a1efc79
commit 3e2de8a457
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -111,13 +111,13 @@ class WebsiteBlog(http.Controller):
if category:
path_filter += "cat/%s/" % category.id
domain += [("id", "=", [blog.id for blog in category.blog_post_ids])]
domain += [("id", "in", [blog.id for blog in category.blog_post_ids])]
if tag:
path_filter += 'tag/%s/' % tag.id
domain += [("id", "=", [blog.id for blog in tag.blog_post_ids])]
domain += [("id", "in", [blog.id for blog in tag.blog_post_ids])]
if date:
path_filter += "date/%s/" % date
domain = [("create_date", ">=", date.split("_")[0]), ("create_date", "<=", date.split("_")[1])]
domain += [("create_date", ">=", date.split("_")[0]), ("create_date", "<=", date.split("_")[1])]
blog_post_ids = blog_post_obj.search(cr, uid, domain, context=context)
blog_posts = blog_post_obj.browse(cr, uid, blog_post_ids, context=context)
@@ -369,9 +369,9 @@
<xpath expr="//div[@id='blog_right_column']" position="inside">
<section class="mt32 mb32">
<h4>Our Blogs</h4>
<ul class="list-unstyled">
<ul class="nav nav-pills nav-stacked">
<t t-foreach="categories" t-as="nav_category">
<li>
<li t-att-class="nav_category.id == category.id and 'active' or ''">
<a t-href="/blog/cat/#{nav_category.id}">
<span t-field="nav_category.name"/>
</a>