Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Move category 'update' button out of price field scope

Pacu293ec1f2a708b
diff --git a/saleor/static/scss/components/_filters.scss b/saleor/static/scss/components/_filters.scss
index 9f614cb04a..fc1681e6f8 100644
--- a/saleor/static/scss/components/_filters.scss
+++ b/saleor/static/scss/components/_filters.scss
@@ -24,6 +24,10 @@
}
}
}
+ button {
+ width: 100%;
+ margin-top: $global-margin;
+ }
&__attributes {
ul {
li {
@@ -52,10 +56,6 @@
text-align: center;
display: inline-block;
}
- button {
- width: 100%;
- margin-top: $global-margin;
- }
}
&__categories {
padding: $global-padding*2 0;
diff --git a/templates/category/index.html b/templates/category/index.html
index 4c4882691d..d5fca0db2b 100644
--- a/templates/category/index.html
+++ b/templates/category/index.html
@@ -123,7 +123,6 @@
<form method="get">
{% for field in filter.form %}
{% if field.name == 'sort_by' %}
-
{% comment %}
Field 'sort_by' is hidden because it is rendered in header.
This is required if you want to have sorting to be kept during further filtering.
@@ -131,8 +130,8 @@
<input type="hidden" name="sort_by"
value="{% if request.GET.sort_by %}{{ request.GET.sort_by }}{% endif %}">
- {% elif field.name != 'price' %}
- <div class="toggle-filter">
+ {% elif field.name == 'price' %}
+ <div class="toggle-filter product-filters__price-range">
<h3 class="filter-label">
{{ field.label }}
<div class="collapse-filters-icon">
@@ -140,11 +139,18 @@
</div>
</h3>
<div class="filter-form-field" style="display:block">
- {{ field }}
+ <div>
+ <input id="{{ field.auto_id }}_0" name="{{ field.name }}_0"
+ value="{% if field.value.0 %}{{ field.value.0 }}{% endif %}" type="number" min="0"
+ class="form-control d-inline"
+ placeholder="{% trans 'from' context 'Category price filter' %}"><span>-</span><input id="{{ field.auto_id }}_1" name="{{ field.name }}_1"
+ value="{% if field.value.1 %}{{ field.value.1 }}{% endif %}" type="number" min="0"
+ class="form-control d-inline" placeholder="{% trans 'to' context 'Category price filter' %}">
+ </div>
</div>
</div>
- {% elif field.name == 'price' %}
- <div class="toggle-filter product-filters__price-range">
+ {% else %}
+ <div class="toggle-filter">
<h3 class="filter-label">
{{ field.label }}
<div class="collapse-filters-icon">
@@ -152,19 +158,14 @@
</div>
</h3>
<div class="filter-form-field" style="display:block">
- <div>
- <input id="{{ field.auto_id }}_0" name="{{ field.name }}_0"
- value="{% if field.value.0 %}{{ field.value.0 }}{% endif %}" type="number" min="0"
- class="form-control d-inline"
- placeholder="{% trans 'from' context 'Category price filter' %}"><span>-</span><input id="{{ field.auto_id }}_1" name="{{ field.name }}_1"
- value="{% if field.value.1 %}{{ field.value.1 }}{% endif %}" type="number" min="0"
- class="form-control d-inline" placeholder="{% trans 'to' context 'Category price filter' %}">
- </div>
+ {{ field }}
</div>
- <button class="btn primary" type="submit">{% trans 'Update' context 'Category price filter' %}</button>
</div>
{% endif %}
{% endfor %}
+ <div class="product-filters">
+ <button class="btn primary" type="submit">{% trans 'Update' context 'Category price filter' %}</button>
+ </div>
</form>
</div>
</div>