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="align-items-center d-flex fs-sm fw-bold mb-0 me-3 text-nowrap">Filters</div>
<div class="dropdown"> <div class="dropdown">
<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-nav-example-dropdown">
All {% if tag %}
{# TODO: @back-end add tags count dynamic #} {{ tag.name }}
<div class="align-items-center bg-secondary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4"> {# TODO: @back-end add tags count dynamic #}
1 <div class="align-items-center bg-secondary d-flex h-4 fs-xs justify-content-center ms-2 rounded-circle w-4">
</div> 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> <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-nav-example-dropdown">
<li> <li>
{% if tag %} {% if tag %}
{# TODO: add tag active display #} {# If tag is active, show button 'All'. #}
{% else %} {# 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-type' type_slug=type|slugify %}"> <a class="dropdown-item justify-content-between" href="/{{ tag.get_type_display|slugify }}s/">
All All
<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>
</a> </a>
{% else %}
{% endif %} {% endif %}
</li> </li>
{% for list_tag in tags %} {% for list_tag in tags %}
<li> <li>
{% comment %} <a class="dropdown-item justify-content-between" href="{% url "extensions:by-tag" tag_slug=list_tag.slug %}" title="{{ list_tag.name }}">
{# 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 }}">
{{ 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