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 3a5000c1ed - Show all commits

View File

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