remotes/origin/artem
Gena 11 years ago
parent c77794e75d
commit 6f44563f1e
  1. 276
      batiskaf/templates/jinja2/category.jinja
  2. 58
      batiskaf/templates/jinja2/includes/category_product_thumb.jinja
  3. 2
      batiskaf/templates/jinja2/index.jinja
  4. 2
      batiskaf/templates/jinja2/product.jinja

@ -1,16 +1,21 @@
{% extends 'base.jinja' %} {% extends 'base.jinja' %}
{% block meta_description %} {% block meta_description %}
{% if category %}{{ category.title }}{% elif 'sale' in request.path %}Скидки{% else %}Поиск по запросу {{ request.GET['q'] }}{% endif %} в интернет-магазине снаряжения для дайвинга и подводной охоты Батискаф-Казахстан. {% if category %}{{ category.title }}{% elif 'sale' in request.path %}Скидки{% else %}Поиск по запросу
{{ request.GET['q'] }}{% endif %} в интернет-магазине снаряжения для дайвинга и подводной охоты
Батискаф-Казахстан.
{% endblock %} {% endblock %}
{% block meta_keywords %} {% block meta_keywords %}
{% if products %}{% for product in products %}{{ product.title }}, {% endfor %}{% endif %}{% if category %}{{ category.title }}, {% for parent in category.get_parents() %}, {{ parent.title }}{% endfor %}{% elif 'sale' in request.path %}Скидки{% else %}Поиск, {{ request.GET['q'] }}{% endif %}, Товар, Цена, Купить, Фото, Интернет-Магазин, Батискаф-Казахстан {% if products %}{% for product in products %}{{ product.title }}, {% endfor %}{% endif %}{% if category %}
{{ category.title }}, {% for parent in category.get_parents() %},
{{ parent.title }}{% endfor %}{% elif 'sale' in request.path %}Скидки{% else %}Поиск,
{{ request.GET['q'] }}{% endif %}, Товар, Цена, Купить, Фото, Интернет-Магазин, Батискаф-Казахстан
{% endblock %} {% endblock %}
{% block title %} {% block title %}
{% if category %} {% if category %}
{{ category.title }}{% for parent in category.get_parents() %} > {{ parent.title }}{% endfor %} {{ category.title }}{% for parent in category.get_parents() %} > {{ parent.title }}{% endfor %}
{% elif 'sale' in request.path %} {% elif 'sale' in request.path %}
Скидки Скидки
{% else %} {% else %}
Поиск по запросу {{ request.GET['q'] }} Поиск по запросу {{ request.GET['q'] }}
{% endif %} {% endif %}
{% endblock %} {% endblock %}
@ -18,16 +23,16 @@
<div class=" breadcrumbs"> <div class=" breadcrumbs">
<ol class="breadcrumb breadcrumb-arrow"> <ol class="breadcrumb breadcrumb-arrow">
<li><a href="/">Главная</a></li> <li><a href="/">Главная</a></li>
{% if category %} {% if category %}
{% for parent in category.get_parents() %} {% for parent in category.get_parents() %}
<li><a href="{{ parent.get_absolute_url() }}">{{ parent.title }}</a></li> <li><a href="{{ parent.get_absolute_url() }}">{{ parent.title }}</a></li>
{% endfor %} {% endfor %}
<li class="active"><span>{{ category.title }}</span></li> <li class="active"><span>{{ category.title }}</span></li>
{% elif 'sale' in request.path %} {% elif 'sale' in request.path %}
<li class="active"><span>Скидки</span></li> <li class="active"><span>Скидки</span></li>
{% else %} {% else %}
<li class="active"><span>Поиск по запросу {{ request.GET['q'] }}</span></li> <li class="active"><span>Поиск по запросу {{ request.GET['q'] }}</span></li>
{% endif %} {% endif %}
</ol> </ol>
</div> </div>
@ -47,117 +52,66 @@
</div> </div>
<div class="col-xs-9 col-sm-9 col-md-9 col-lg-9 index-goods category-items"> <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9 index-goods category-items">
{% if products %} {% if products %}
<div class="category-paginator"> <div class="category-paginator">
<div class="category-paginator-top"> <div class="category-paginator-top">
<div class="row"> <div class="row">
<div class="col-xs-4">С {{ products.start_index() }} до {{ products.end_index() }} <div class="col-xs-4">С {{ products.start_index() }} до {{ products.end_index() }}
из {{ products.paginator.count }}</div> из {{ products.paginator.count }}</div>
<div class="col-xs-4 text-center paginate">Страница: {% if products.has_previous() %} <div class="col-xs-4 text-center paginate">Страница: {% if products.has_previous() %}
<a href="?page={{ products.previous_page_number() }}">&larr;</a>{% endif %} <a href="?page={{ products.previous_page_number() }}">&larr;</a>{% endif %}
{% for page in products.paginator.page_range %} {% for page in products.paginator.page_range %}
{% if page == products.number %} {% if page == products.number %}
{{ page }} {{ page }}
{% else %} {% else %}
<a href="?page={{ page }}">{{ page }}</a> <a href="?page={{ page }}">{{ page }}</a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if products.has_next() %} {% if products.has_next() %}
<a href="?page={{ products.next_page_number() }}">&rarr;</a> <a href="?page={{ products.next_page_number() }}">&rarr;</a>
{% endif %}</div> {% endif %}</div>
<div class="col-xs-4 text-right">Показать <div class="col-xs-4 text-right">Показать
<select name="show-count" id=""> <select name="show-count" id="">
<option value="30">30</option> <option value="30">30</option>
<option value="60">60</option> <option value="60">60</option>
<option value="90">90</option> <option value="90">90</option>
<option value="150">150</option> <option value="150">150</option>
<option value="all">Все</option> <option value="all">Все</option>
</select> </select>
на странице на странице
</div>
</div> </div>
</div> </div>
</div> <div class="category-paginator-bottom">
<div class="category-paginator-bottom"> <div class="row">
<div class="row"> <div class="col-xs-6"></div>
<div class="col-xs-6"></div> <div class="col-xs-6 text-right">Сортировать по
<div class="col-xs-6 text-right">Сортировать по <select name="products-sort" id="">
<select name="products-sort" id=""> <option value="-date">Дате добавления &darr;</option>
<option value="-date">Дате добавления &darr;</option> <option value="date">Дате добавления &uarr;</option>
<option value="date">Дате добавления &uarr;</option> <option value="-price">Цене &darr;</option>
<option value="-price">Цене &darr;</option> <option value="price">Цене &uarr;</option>
<option value="price">Цене &uarr;</option> </select>
</select> </div>
</div> </div>
</div> </div>
</div> </div>
</div> {% endif %}
{% endif %}
<div class="row"> <div class="row">
{% if products %} {% if products %}
{% for product in products %} {% for product in products %}
{% if product.in_stock() %}
{% include 'includes/category_product_thumb.jinja' with context %}
{% endif %}
<div class="col-md-4 col-xs-4 col-sm-4 col-lg-4"> {% endfor %}
<div class="thumbnail"> {% for product in products %}
{% if is_sale %} {% if not product.in_stock() %}
<div class="sale-percent-block"> {% include 'includes/category_product_thumb.jinja' with context %}
-{{ product.min_price_variation().discount }}% {% endif %}
</div>
{% endif %}
{% set im = product.main_image()|thumbnail("420x420") %}
<a href="{{ product.get_absolute_url() }}">
<img src="/static/{{ im.url }}"
class="img-responsive" alt="Купить {{ product.title }}" title="Купить {{ product.title }}"></a>
<div class="caption">
<div class="title">
<a href="{{ product.get_absolute_url() }}">
{{ product.title }}
</a>
</div>
<div class="price">
{% if is_sale %}
<small class="text-danger"><s>{{ product.min_price_variation().price }} ₸</s></small>
{% endif %}
{{ product.min_price() }} ₸
</div>
{% if product.in_stock() %}
<div class="state-yes">
<span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span> Товар
есть в наличии
</div>
{% else %}
<div class="state-no">
{# TODO: Товар на заказ#}
<span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span> Товара
нет в наличии
</div>
{% endif %}
<div class="in-cart">
{# TODO: Сделать кнопку заказать#}
{% if product.in_stock() %}
<a class="btn btn-warning btn-block"
href="/store/cart/add/?pk={{ product.variations.filter(in_stock__gt=0).order_by('price').first().pk }}&count=1&next={{ request.get_full_path()|urlencode }}"><span><span
class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Добавить в корзину</span></a>
{% else %}
<a class=" btn btn-danger btn-block order-order-link" href="#order-form" data-itemid="{{ product.pk }}"><span><span
class="glyphicon glyphicon-import" aria-hidden="true"></span> Заказать</span></a>
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %} {% endfor %}
{% else %} {% else %}
@ -169,64 +123,64 @@
<p><a class="btn btn-warning" href="/">Перейти на главную страницу</a> <p><a class="btn btn-warning" href="/">Перейти на главную страницу</a>
{% if category %} {% if category %}
<a class="btn btn-link" <a class="btn btn-link"
href="{{ category.get_absolute_url() }}">или href="{{ category.get_absolute_url() }}">или
отменить фильтрацию</a> отменить фильтрацию</a>
{% endif %} </p> {% endif %} </p>
</div> </div>
{% endif %} {% endif %}
</div> </div>
{% if products %} {% if products %}
<div class="category-paginator"> <div class="category-paginator">
<div class="category-paginator-top"> <div class="category-paginator-top">
<div class="row"> <div class="row">
<div class="col-xs-4">С {{ products.start_index() }} до {{ products.end_index() }} <div class="col-xs-4">С {{ products.start_index() }} до {{ products.end_index() }}
из {{ products.paginator.count }}</div> из {{ products.paginator.count }}</div>
<div class="col-xs-4 text-center paginate">Страница: {% if products.has_previous() %} <div class="col-xs-4 text-center paginate">Страница: {% if products.has_previous() %}
<a href="?page={{ products.previous_page_number() }}">&larr;</a>{% endif %} <a href="?page={{ products.previous_page_number() }}">&larr;</a>{% endif %}
{% for page in products.paginator.page_range %} {% for page in products.paginator.page_range %}
{% if page == products.number %} {% if page == products.number %}
{{ page }} {{ page }}
{% else %} {% else %}
<a href="?page={{ page }}">{{ page }}</a> <a href="?page={{ page }}">{{ page }}</a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if products.has_next() %} {% if products.has_next() %}
<a href="?page={{ products.next_page_number() }}">&rarr;</a> <a href="?page={{ products.next_page_number() }}">&rarr;</a>
{% endif %}</div> {% endif %}</div>
<div class="col-xs-4 text-right">Показать <div class="col-xs-4 text-right">Показать
<select name="show-count" id=""> <select name="show-count" id="">
<option value="30">30</option> <option value="30">30</option>
<option value="60">60</option> <option value="60">60</option>
<option value="90">90</option> <option value="90">90</option>
<option value="150">150</option> <option value="150">150</option>
<option value="all">Все</option> <option value="all">Все</option>
</select> </select>
на странице на странице
</div>
</div> </div>
</div> </div>
</div> <div class="category-paginator-bottom">
<div class="category-paginator-bottom"> <div class="row">
<div class="row"> <div class="col-xs-6"></div>
<div class="col-xs-6"></div> <div class="col-xs-6 text-right">Сортировать по
<div class="col-xs-6 text-right">Сортировать по <select name="products-sort" id="">
<select name="products-sort" id=""> <option value="-date">Дате добавления &darr;</option>
<option value="-date">Дате добавления &darr;</option> <option value="date">Дате добавления &uarr;</option>
<option value="date">Дате добавления &uarr;</option> <option value="-price">Цене &darr;</option>
<option value="-price">Цене &darr;</option> <option value="price">Цене &uarr;</option>
<option value="price">Цене &uarr;</option> </select>
</select> </div>
</div> </div>
</div> </div>
</div> </div>
</div> {% endif %}
{% endif %}
</div> </div>
</div> </div>

@ -0,0 +1,58 @@
<div class="col-md-4 col-xs-4 col-sm-4 col-lg-4">
<div class="thumbnail">
{% if is_sale %}
<div class="sale-percent-block">
-{{ product.min_price_variation().discount }}%
</div>
{% endif %}
{% set im = product.main_image()|thumbnail("420x420") %}
<a href="{{ product.get_absolute_url() }}">
<img src="/static/{{ im.url }}"
class="img-responsive" alt="Купить {{ product.title }}"
title="Купить {{ product.title }}"></a>
<div class="caption">
<div class="title">
<a href="{{ product.get_absolute_url() }}">
{{ product.title }}
</a>
</div>
<div class="price">
{% if is_sale %}
<small class="text-danger"><s>{{ product.min_price_variation().price }}
₸</s></small>
{% endif %}
{{ product.min_price() }} ₸
</div>
{% if product.in_stock() %}
<div class="state-yes">
<span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span> Товар
есть в наличии
</div>
{% else %}
<div class="state-no">
<span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span> Товара
нет в наличии
</div>
{% endif %}
<div class="in-cart">
{% if product.in_stock() %}
<a class="btn btn-warning btn-block"
href="/store/cart/add/?pk={{ product.variations.filter(in_stock__gt=0).order_by('price').first().pk }}&count=1&next={{ request.get_full_path()|urlencode }}"><span><span
class="glyphicon glyphicon-shopping-cart"
aria-hidden="true"></span> Добавить в корзину</span></a>
{% else %}
<a class=" btn btn-danger btn-block order-order-link" href="#order-form"
data-itemid="{{ product.pk }}"><span><span
class="glyphicon glyphicon-import" aria-hidden="true"></span> Заказать</span></a>
{% endif %}
</div>
</div>
</div>
</div>

@ -69,13 +69,11 @@
</div> </div>
{% else %} {% else %}
<div class="state-no"> <div class="state-no">
{# TODO: Товар на заказ#}
<span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span> Товара <span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span> Товара
нет в наличии нет в наличии
</div> </div>
{% endif %} {% endif %}
<div class="in-cart"> <div class="in-cart">
{# TODO: Сделать кнопку заказать#}
{% if product.in_stock() %} {% if product.in_stock() %}
<a class="btn btn-warning btn-block" <a class="btn btn-warning btn-block"
href="/store/cart/add/?pk={{ product.variations.filter(in_stock__gt=0).order_by('price').first().pk }}&count=1&next={{ request.get_full_path()|urlencode }}"><span><span href="/store/cart/add/?pk={{ product.variations.filter(in_stock__gt=0).order_by('price').first().pk }}&count=1&next={{ request.get_full_path()|urlencode }}"><span><span

@ -60,7 +60,6 @@
{% endif %} {% endif %}
<div class="product-variations"> <div class="product-variations">
<p>Варианты товара:</p> <p>Варианты товара:</p>
{# TODO: Предусмотреть если всего один вариант#}
<select name="product-variations-selecter" class="product-variations-selecter"> <select name="product-variations-selecter" class="product-variations-selecter">
{% for variation in product.variations.order_by('price') %} {% for variation in product.variations.order_by('price') %}
<option {% if variation.pk == variant.pk %}selected='selected'{% endif %} <option {% if variation.pk == variant.pk %}selected='selected'{% endif %}
@ -94,7 +93,6 @@
Итого: <span class="itogo-span">{{ product.min_price() }}</span> ₸ Итого: <span class="itogo-span">{{ product.min_price() }}</span> ₸
</div> </div>
<div class="col-xs-6 text-right"> <div class="col-xs-6 text-right">
{# TODO: Сделать кнопку заказать#}
<a href="/store/cart/add/?pk={{ variant.pk }}&count=1&next={{ product.get_absolute_url() }}" <a href="/store/cart/add/?pk={{ variant.pk }}&count=1&next={{ product.get_absolute_url() }}"
class="btn btn-warning btn-block" id="product-add-to-cart-link"><span class="btn btn-warning btn-block" id="product-add-to-cart-link"><span
class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Добавить в корзину</a> class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Добавить в корзину</a>

Loading…
Cancel
Save