remotes/origin/mitri4
spacenergy 10 years ago
parent 2819e36f31
commit 71ac6bba8a
  1. 3
      batiskaf/jinja2.py
  2. 27
      batiskaf/templates/jinja2/base.jinja
  3. 2
      batiskaf/templates/jinja2/category.jinja

@ -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

@ -141,6 +141,33 @@
<li><a href="/store/leaders/"><span class="lead">Лидеры продаж</span></a>
</li>
<li class="dropdown yamm-fw"><a href="#" data-toggle="dropdown"
class="dropdown-toggle "><span
class="lead">Все бренды</span></a>
<ul class="dropdown-menu">
<li>
<div class="yamm-content">
<div class="row">
{% for brand in all_brands %}
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
<ul>
<li><a class="title"
href="/store/search/?q=&brand[]={{ brand.pk }}">{{ brand.title }}</a>
</li>
</ul>
</div>
{% endfor %}
</div>
</div>
</li>
</ul>
</li>
</ul>

@ -72,7 +72,7 @@
</div>
<div class="col-xs-9 col-sm-9 col-md-9 col-lg-9 index-goods category-items">
{% 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 %}
{# <li>#}
{# <a href="{{ child.get_absolute_url() }}">{{ child.title }}</a>#}

Loading…
Cancel
Save