summaryrefslogtreecommitdiff
path: root/templates/category/index.html
blob: 9a6149fb001991735c84da0f496b45fe9a81f91b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
{% extends "base.html" %}
{% load i18n %}
{% load shop %}
{% load staticfiles %}
{% load bootstrap_pagination from bootstrap3 %}
{% load render_bundle from webpack_loader %}
{% load prices_i18n %}
{% load product_first_image from product_images %}

{% block footer_scripts %}
  {{ block.super }}
{% endblock footer_scripts %}

{% block title %}{{ category }} — {{ block.super }}{% endblock %}

{% block breadcrumb %}
    {{ block.super }}
    {% for breadcrumb in breadcrumbs %}
        <li{% if forloop.last %} class="active"{% endif %}>
            {% if not forloop.last %}
                <a href="{{ breadcrumb.get_absolute_url }}">{{ breadcrumb }}</a>
            {% else %}
                <span>{{ breadcrumb }}</span>
            {% endif %}
        </li>
    {% endfor %}
{% endblock breadcrumb %}

{% block content %}
    <div id="category-page">
        <div class="category-top">
          <div class="row">
            <div class="col-md-7">
              <ul class="breadcrumbs list-unstyled d-none d-md-block">
                <li><a href="/">Home</a></li>
                {% for ancestor in category.get_ancestors %}
                  <li><a href='{{ ancestor.get_absolute_url }}'>{{ ancestor.name }}</a></li>
                {% endfor %}
                <li><a href='{{ category.get_absolute_url }}'>{{ category.name }}</a></li>
              </ul>
            </div>
            <div class="col-md-5">
              <div class="row">
                  <div class="col-6 col-md-2 col-lg-6 filters-menu">

                  </div>
                  <div class="col-6 col-md-10 col-lg-6">
                    <div class="sort-by">
                      <span>Sort by:
                        <strong>
                          <a href="{% get_sort_by_url 'name' %}" onclick="toggleSort('name-arrow')">
                            {% trans "name" context "Product name" %}
                          </a>
                          {% if request.GET.sort_by == 'name' %}
                            <div class="sort-order-icon"><img src="{% static "assets/arrow_up.svg" %}"></div>
                          {% elif request.GET.sort_by == '-name' %}
                            <div class="sort-order-icon"><img src="{% static "assets/arrow_down.svg" %}"></div>
                          {% else %}
                          {% endif %}
                          <a href="{% get_sort_by_url 'price' %}" onclick="toggleSort('price-arrow')">
                            {% trans "price" context "Product price" %}
                          </a>
                          {% if request.GET.sort_by == 'price' %}
                            <div class="sort-order-icon"><img src="{% static "assets/arrow_up.svg" %}"></div>
                          {% elif request.GET.sort_by == '-price' %}
                            <div class="sort-order-icon"><img src="{% static "assets/arrow_down.svg" %}"></div>
                          {% else %}
                          {% endif %}
                        </strong>
                      </span>
                      <div class="sort-order-icon">
                      </div>
                    </div>
                  </div>
              </div>
            </div>
          </div>
        </div>
        <div class="row">
          <div class="col-md-4 col-lg-3">
            <div class="product-filters">
              <div class="product-filters__categories">
                <h2>
                  <strong>{{ category.name }}</strong>
                </h2>
                <ul class="product-filters__categories__childs no-parent">
                  {% for child in category.get_children %}
                    <li><a href="{{ child.get_absolute_url }}">{{ child.name }}</a></li>
                  {% endfor %}
                </ul>
              </div>
            </div>
            <div>
              <h2>
                {% trans 'Filters' context 'Filter heading title' %}
                <a href="?">
                  <span class="clear-filters float-right">{% trans 'Clear filters' context 'Category page filters' %}</span>
                </a>
              </h2>
              <div class="product-filters">
                <div class="product-filters__attributes" data-icon-up="{% static "assets/chevron_up.svg" %}" data-icon-down="{% static "assets/chevron_down.svg" %}">
                  <form method="get">
                    {% for field in filter.product_attributes_filter_form %}
                      <div class="toggle-filter">
                        <h3 class="filter-label">
                          {{ field.label }}
                          <div class="collapse-filters-icon">
                            <img src="{% static "assets/chevron_up.svg" %}">
                          </div>
                        </h3>
                        <div class="filter-form-field" style="display:block">
                          {{ field }}
                        </div>
                      </div>
                    {% endfor %}
                      <div class="toggle-filter product-filters__price-range">
                        <h3 class="filter-label">
                          {{ filter.form.fields.price.label }}
                          <div class="collapse-filters-icon">
                            <img src="{% static "assets/chevron_up.svg" %}">
                          </div>
                        </h3>
                        <div class="filter-form-field" style="display:block">
                          <input id="price_0" name="price_0" type="number" min="0" class="form-control" placeholder="from"><span>-</span><input id="price_1" name="price_1" type="number" min="0" class="form-control" placeholder="to">
                          <button class="btn primary" type="submit">Update</button>
                        </div>
                      </div>
                  </form>
                </div>
              </div>
            </div>
          </div>
          <div class="col-md-8 col-lg-9 category-list">
            <div>
              <div>
                <div class="row">
                  {% include "category/_items.html" with products=products %}
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
{% endblock content %}