Skip to content

Commit 2fb6349

Browse files
committed
Add filter button functionality
1 parent c3997e0 commit 2fb6349

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

DjangoEcommerceApp/templates/admin_templates/product_list.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,26 @@
3232
<div class="col-lg-12">
3333
<div class="search-element">
3434
<div class="card">
35-
3635
<div class="card-body">
3736
<b>Sort By : - </b>
3837
<a href="{% url 'product_list' %}?filter={{ filter }}&orderby=id">ID</a> |
3938
<a href="{% url 'product_list' %}?filter={{ filter }}&orderby=product_name">Title</a> |
4039
<a href="{% url 'product_list' %}?filter={{ filter }}&orderby=product_description">Description</a>
4140
</div>
41+
<div class="card-body dropdown">
42+
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu2"
43+
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
44+
Filter
45+
</button>
46+
<div class="dropdown-menu" aria-labelledby="dropdownMenu2">
47+
{% for product in all_products %}
48+
<a href="{% url 'product_list' %}?product_name={{ product.product_name }}"
49+
class="dropdown-item">
50+
{{ product.product_name }}
51+
</a>
52+
{% endfor %}
53+
</div>
54+
</div>
4255
</div>
4356
</div>
4457
</div>

0 commit comments

Comments
 (0)