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 57a74466cc - Show all commits

View File

@ -35,33 +35,38 @@
<div class="align-items-center d-flex fs-sm fw-bold mb-0 me-3 text-nowrap">Filters</div>
<div class="dropdown">
<button class="align-items-center d-flex dropdown-toggle js-dropdown-toggle" data-toggle-menu-id="js-nav-example-dropdown">
{% if tag %}
{{ tag.name }}
{# TODO: @back-end add tags count dynamic #}
<div class="align-items-center bg-secondary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4">
1
</div>
{% else %}
All
{# TODO: @back-end add tags count dynamic #}
<div class="align-items-center bg-secondary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4">
1
</div>
{% endif %}
<i class="i-chevron-down"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right js-dropdown-menu" id="js-nav-example-dropdown">
<li>
{% if tag %}
{# TODO: add tag active display #}
{% else %}
<a class="dropdown-item justify-content-between" href="{% url 'extensions:by-type' type_slug=type|slugify %}">
{# If tag is active, show button 'All'. #}
{# TODO @back-end: Find a proper way to get the plural tag type to build the URL. #}
<a class="dropdown-item justify-content-between" href="/{{ tag.get_type_display|slugify }}s/">
All
<div class="align-items-center bg-secondary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4">
1
</div>
</a>
{% else %}
{% endif %}
</li>
{% for list_tag in tags %}
<li>
{% comment %}
{# TODO @back-end: Find a proper way to get the plural tag type to build the URL. #}
<a class="dropdown-item justify-content-between" href="{% url "extensions:by-tag %}" tag_slug={% list_tag.slug %}" title="{{ list_tag.name }}">
{% endcomment %}
<a class="dropdown-item justify-content-between" href="#" 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 }}
<div class="align-items-center bg-secondary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4">
1