Extensions list: sort_by parameter #159

Merged
Márton Lente merged 36 commits from filter-sort into main 2024-06-03 12:57:45 +02:00
Showing only changes of commit a17d8a149a - Show all commits

View File

@ -32,7 +32,7 @@
<div class="d-flex flex-column flex-md-row"> <div class="d-flex flex-column flex-md-row">
<div class="align-items-center d-flex flex-shrink-0 justify-content-between mb-2 mb-md-0 me-md-3"> <div class="align-items-center d-flex flex-shrink-0 justify-content-between mb-2 mb-md-0 me-md-3">
<div class="box dropdown p-2 rounded-2"> <div class="box dropdown p-2 rounded-2">
<button class="align-items-center d-flex dropdown-toggle js-dropdown-toggle" data-toggle-menu-id="js-nav-example-dropdown"> <button class="align-items-center d-flex dropdown-toggle js-dropdown-toggle" data-toggle-menu-id="js-dropdown-filter">
{% if tag %} {% if tag %}
{{ tag.name }} {{ tag.name }}
{# TODO: @back-end add tags count dynamic #} {# TODO: @back-end add tags count dynamic #}
@ -46,9 +46,10 @@
1 1
</div> </div>
{% endif %} {% endif %}
<i class="i-chevron-down"></i> <i class="i-chevron-down"></i>
</button> </button>
<ul class="dropdown-menu dropdown-menu-right js-dropdown-menu" id="js-nav-example-dropdown"> <ul class="dropdown-menu dropdown-menu-right js-dropdown-menu" id="js-dropdown-filter">
<li> <li>
{% if tag %} {% if tag %}
{# If tag is active, show button 'All'. #} {# If tag is active, show button 'All'. #}
@ -62,10 +63,12 @@
{% else %} {% else %}
{% endif %} {% endif %}
</li> </li>
{% for list_tag in tags %} {% for list_tag in tags %}
<li> <li>
<a class="dropdown-item justify-content-between" href="{% url "extensions:by-tag" tag_slug=list_tag.slug %}" title="{{ list_tag.name }}"> <a class="dropdown-item justify-content-between" href="{% url "extensions:by-tag" tag_slug=list_tag.slug %}" title="{{ list_tag.name }}">
{{ list_tag.name }} {{ list_tag.name }}
<div class="align-items-center bg-secondary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4"> <div class="align-items-center bg-secondary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4">
1 1
</div> </div>
@ -73,26 +76,51 @@
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div>
</div>
<div class="align-items-center d-flex flex-shrink-0 justify-content-between">
{# TODO: @back-end add sort based on select options #}
<div class="box d-flex p-2">
{# TODO: change to web-assets dropdown #}
<label class="align-items-center d-flex fs-sm mb-0 me-3 text-nowrap">Sort by</label>
<select class="form-control form-control-sm">
<option value="-date_approved">Newest First</option>
<option value="date_approved">Oldest First</option>
<option value="-date_modified">Recently Updated</option>
<option value="-total_ratings_count">Most Reviewed</option>
<option value="-average_score">Rating</option>
<option value="-download_count">Downloads</option>
<option value="-name">Title (A-Z)</option>
<option value="name">Title (Z-A)</option>
</select>
</div>
</div> </div>
</div> </div>
<div class="box dropdown p-2 rounded-2">
<button class="dropdown-toggle js-dropdown-toggle" data-toggle-menu-id="js-dropdown-sort">
Sort by <i class="i-chevron-down"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right js-dropdown-menu" id="js-dropdown-sort">
<li>
<a class="dropdown-item" href="#">
Newest First
</a>
</li>
<li>
<a class="dropdown-item" href="#">
Recently Updated
</a>
</li>
<li>
<a class="dropdown-item" href="#">
Most Reviewed
</a>
</li>
<li>
<a class="dropdown-item" href="#">
Rating
</a>
</li>
<li>
<a class="dropdown-item" href="#">
Downloads
</a>
</li>
<li>
<a class="dropdown-item" href="#">
Title (A-Z)
</a>
</li>
<li>
<a class="dropdown-item" href="#">
Title (Z-A)
</a>
</li>
</ul>
</div>
</div>
</div> </div>
</div> </div>
{% endif %} {% endif %}