diff options
author | michal <michal.sipa@mirumee.com> | 2017-10-02 10:15:16 +0200 |
---|---|---|
committer | michal <michal.sipa@mirumee.com> | 2017-10-02 10:15:16 +0200 |
commit | 9a1d52f14efc199a0d79aa5361491654811503fd (patch) | |
tree | 92eb1312fd72f4a4995c4cc8dee93caa58be0b6c /templates | |
parent | 44dba52940691161464463228e7a78b6f31eb6ce (diff) | |
download | saleor-frontend-9a1d52f14efc199a0d79aa5361491654811503fd.tar.gz saleor-frontend-9a1d52f14efc199a0d79aa5361491654811503fd.tar.bz2 saleor-frontend-9a1d52f14efc199a0d79aa5361491654811503fd.zip |
Add standard_form to ProductFilter
Add standard_form property to ProductFilter which returns only filters generated in __init__().
Change template to use standard_form and correctly render price filter.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/category/index.html | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/templates/category/index.html b/templates/category/index.html index cbacd7b6..426b700a 100644 --- a/templates/category/index.html +++ b/templates/category/index.html @@ -42,8 +42,7 @@ <div class="col-md-5"> <div class="row"> <div class="col-6 col-md-2 col-lg-6 filters-menu"> - <span class="filters-menu__label hidden-sm-up">Filters</span> - <span class="filters-menu__icon hidden-sm-up"></span> + </div> <div class="col-6 col-md-10 col-lg-6"> <div class="sort-by"> @@ -96,35 +95,31 @@ <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.form %} - {% if field.label == 'Price' %} - <div class="toggle-filter product-filters__price-range"> - <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 }} + {% for field in filter.standard_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> - {% elif field.label == 'Sort by' %} - {% else %} - <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> + {% 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> - {% endif %} - {% endfor %} - <button class="btn primary" type="submit">Search</button> + </div> </form> </div> </div> |