[FIX] website_blog: category active
authorChristophe Matthieu <chm@openerp.com>
Mon, 18 Nov 2013 14:41:08 +0000 (15:41 +0100)
committerChristophe Matthieu <chm@openerp.com>
Mon, 18 Nov 2013 14:41:08 +0000 (15:41 +0100)
bzr revid: chm@openerp.com-20131118144108-jupdlu19g1d9r66t

addons/website_blog/controllers/main.py
addons/website_blog/views/website_blog_templates.xml

index 78e2bb3..84a1508 100644 (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)
index 79e0193..657ba4b 100644 (file)
         <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>