From 71ac6bba8a7e203317e16cb5315a4447239535e0 Mon Sep 17 00:00:00 2001 From: spacenergy Date: Fri, 2 Oct 2015 13:12:22 +0600 Subject: [PATCH] auto --- batiskaf/jinja2.py | 3 ++- batiskaf/templates/jinja2/base.jinja | 27 ++++++++++++++++++++++++ batiskaf/templates/jinja2/category.jinja | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/batiskaf/jinja2.py b/batiskaf/jinja2.py index 392c4f1..cdf7a24 100644 --- a/batiskaf/jinja2.py +++ b/batiskaf/jinja2.py @@ -5,7 +5,7 @@ from batiskaf.jinja2_ext.thumbnails import thumbnail from batiskaf.jinja2_ext.cart import cart from batiskaf.jinja2_ext.html_filters import * from jinja2 import Environment -from store.models import Category +from store.models import Category, Brand def environment(**options): @@ -14,6 +14,7 @@ def environment(**options): 'static': staticfiles_storage.url, 'url': reverse, 'main_categories': Category.objects.filter(parent__isnull=True).order_by('pk'), + 'all_brands': Brand.objects.order_by('pk'), }) env.filters['linebreaks'] = linebreaks env.filters['thumbnail'] = thumbnail diff --git a/batiskaf/templates/jinja2/base.jinja b/batiskaf/templates/jinja2/base.jinja index f0cfb2b..ea7e2c6 100644 --- a/batiskaf/templates/jinja2/base.jinja +++ b/batiskaf/templates/jinja2/base.jinja @@ -141,6 +141,33 @@
  • Лидеры продаж
  • + diff --git a/batiskaf/templates/jinja2/category.jinja b/batiskaf/templates/jinja2/category.jinja index b494eb4..fada313 100644 --- a/batiskaf/templates/jinja2/category.jinja +++ b/batiskaf/templates/jinja2/category.jinja @@ -72,7 +72,7 @@
    {% if category.hide_products %} - {% for child in category.childs.all() %} + {% for child in category.childs.order_by('priority') %} {% include 'includes/category_category_thumb.jinja' with context %} {#
  • #} {# {{ child.title }}#}