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 c22fc18987 - Show all commits

View File

@ -22,25 +22,21 @@
{% endif %} {% endif %}
{% if tags %} {% if tags %}
<div class="d-flex flex-column flex-md-row"> <div class="d-flex flex-column flex-md-row me-2">
<div class="dropdown dropdown-filter-sort"> <div class="dropdown dropdown-filter-sort">
<button class="align-items-center d-flex dropdown-toggle js-dropdown-toggle" data-toggle-menu-id="js-dropdown-menu-filter"> <button class="align-items-center d-flex dropdown-toggle js-dropdown-toggle" data-toggle-menu-id="js-dropdown-menu-filter">
{% if tag %} {% if tag %}
{{ tag.name }} {{ tag.name }}
{# TODO: @back-end add tags count dynamic #} {# TODO: @back-end add tags count dynamic #}
{% comment %}
<div class="align-items-center bg-tertiary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4"> <div class="align-items-center bg-tertiary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4">
1 1
</div> </div>
{% endcomment %}
{% else %} {% else %}
All All
{# TODO: @back-end add tags count dynamic #} {# TODO: @back-end add tags count dynamic #}
{% comment %}
<div class="align-items-center bg-tertiary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4"> <div class="align-items-center bg-tertiary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4">
1 1
</div> </div>
{% endcomment %}
{% endif %} {% endif %}
<i class="i-chevron-down"></i> <i class="i-chevron-down"></i>
@ -51,11 +47,9 @@
{# TODO @back-end: Find a proper way to get the plural tag type to build the URL. #} {# TODO @back-end: Find a proper way to get the plural tag type to build the URL. #}
<a class="dropdown-item {% if not tag.name %}is-active{% endif %}" href="/{{ tag.get_type_display|slugify }}s/"> <a class="dropdown-item {% if not tag.name %}is-active{% endif %}" href="/{{ tag.get_type_display|slugify }}s/">
All All
{% comment %}
<div class="align-items-center bg-tertiary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4"> <div class="align-items-center bg-tertiary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4">
1 1
</div> </div>
{% endcomment %}
</a> </a>
</li> </li>
@ -64,11 +58,9 @@
<a class="dropdown-item {% if tag.name == list_tag.name %}is-active{% endif %}" href="{% url "extensions:by-tag" tag_slug=list_tag.slug %}" title="{{ list_tag.name }}"> <a class="dropdown-item {% if tag.name == list_tag.name %}is-active{% endif %}" href="{% url "extensions:by-tag" tag_slug=list_tag.slug %}" title="{{ list_tag.name }}">
{{ list_tag.name }} {{ list_tag.name }}
{% comment %}
<div class="align-items-center bg-tertiary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4"> <div class="align-items-center bg-tertiary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4">
1 1
</div> </div>
{% endcomment %}
</a> </a>
</li> </li>
{% endfor %} {% endfor %}
@ -76,6 +68,49 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
<div class="dropdown dropdown-filter-sort">
<button class="dropdown-toggle js-dropdown-toggle" data-toggle-menu-id="js-dropdown-menu-sort">
Sort by <i class="i-chevron-down"></i>
</button>
<ul class="dropdown-menu dropdown-menu-filter-sort dropdown-menu-right js-dropdown-menu" id="js-dropdown-menu-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>
{% else %} {% else %}