|
20 | 20 | <div class="card-body">
|
21 | 21 | <form method="get">
|
22 | 22 | <button class="btn btn-primary" type="submit" style="float:right"><i class="fas fa-search"></i> Search</button>
|
23 |
| - <input class="form-control" type="search" placeholder="Search" aria-label="Search" data-width="250" style="width: 250px;float:right" name="filter" value="{{ filter }}"> |
| 23 | + <input class="form-control" type="search" placeholder="Search" aria-label="Search" data-width="250" style="width: 250px;float:right" name="search" value="{{ search }}"> |
24 | 24 | </form>
|
25 | 25 | </div>
|
26 | 26 |
|
|
32 | 32 | <div class="col-lg-12">
|
33 | 33 | <div class="search-element">
|
34 | 34 | <div class="card">
|
35 |
| - |
36 | 35 | <div class="card-body">
|
37 | 36 | <b>Sort By : - </b>
|
38 |
| - <a href="{% url 'product_list' %}?filter={{ filter }}&orderby=id">ID</a> | |
39 |
| - <a href="{% url 'product_list' %}?filter={{ filter }}&orderby=product_name">Title</a> | |
40 |
| - <a href="{% url 'product_list' %}?filter={{ filter }}&orderby=product_description">Description</a> |
| 37 | + <a href="{% url 'product_list' %}?subcategories_id={{ subCategories.id }}&orderby=id">ID</a> | |
| 38 | + <a href="{% url 'product_list' %}?subcategories_id={{ subCategories.id }}&orderby=product_name">Title</a> | |
| 39 | + <a href="{% url 'product_list' %}?subcategories_id={{ subCategories.id }}&orderby=product_description">Description</a> |
| 40 | + </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 subCategories in all_subCategories %} |
| 48 | + <a href="{% url 'product_list' %}?subcategories_id={{ subCategories.id }}" |
| 49 | + class="dropdown-item"> |
| 50 | + {{ subCategories.title}} |
| 51 | + </a> |
| 52 | + {% endfor %} |
| 53 | + </div> |
41 | 54 | </div>
|
42 | 55 | </div>
|
43 | 56 | </div>
|
|
83 | 96 | <nav aria-label="Page navigation example">
|
84 | 97 | <ul class="pagination">
|
85 | 98 | {% if page_obj.has_previous %}
|
86 |
| - <li class="page-item"><a class="page-link" href="{% url 'product_list' %}?filter={{ filter }}&orderby={{ orderby }}&page={{ page_obj.previous_page_number }}">Previous</a></li> |
| 99 | + <li class="page-item"><a class="page-link" href="{% url 'product_list' %}?subcategories_id={{ subCategories.id }}&orderby={{ orderby }}&page={{ page_obj.previous_page_number }}">Previous</a></li> |
87 | 100 | {% else %}
|
88 | 101 | <li class="page-item disabled"><a class="page-link" href="#">Previous</a></li>
|
89 | 102 | {% endif %}
|
90 | 103 | {% for i in paginator.page_range %}
|
91 |
| - <li class="page-item {% if i == page_obj.number %}active{% endif %}"><a class="page-link" href="{% url 'product_list' %}?filter={{ filter }}&orderby={{ orderby }}&page={{ i }}">{{ i }}</a></li> |
| 104 | + <li class="page-item {% if i == page_obj.number %}active{% endif %}"><a class="page-link" href="{% url 'product_list' %}?subcategories_id={{ subCategories.id }}&orderby={{ orderby }}&page={{ i }}">{{ i }}</a></li> |
92 | 105 | {% endfor %}
|
93 | 106 | {% if page_obj.has_next %}
|
94 |
| - <li class="page-item"><a class="page-link" href="{% url 'product_list' %}?filter={{ filter }}&orderby={{ orderby }}&page={{ page_obj.next_page_number }}">Next</a></li> |
| 107 | + <li class="page-item"><a class="page-link" href="{% url 'product_list' %}?subcategories_id={{ subCategories.id }}&orderby={{ orderby }}&page={{ page_obj.next_page_number }}">Next</a></li> |
95 | 108 | {% else %}
|
96 | 109 | <li class="page-item disabled"><a class="page-link" href="#">Next</a></li>
|
97 | 110 | {% endif %}
|
|
0 commit comments