remotes/origin/artem
Gena 11 years ago
parent c77794e75d
commit 6f44563f1e
  1. 72
      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,13 +1,18 @@
{% 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 %}
@ -99,65 +104,14 @@
{% for product in products %} {% for product in products %}
<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() %} {% if product.in_stock() %}
{% include 'includes/category_product_thumb.jinja' with context %}
<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 %} {% endif %}
<div class="in-cart"> {% endfor %}
{# TODO: Сделать кнопку заказать#} {% for product in products %}
{% if product.in_stock() %} {% if not product.in_stock() %}
<a class="btn btn-warning btn-block" {% include 'includes/category_product_thumb.jinja' with context %}
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 %} {% endif %}
</div>
</div>
</div>
</div>
{% endfor %} {% endfor %}
{% else %} {% else %}

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