♻️ refactor: only show project tag filter with 2 or more tags

Prior to this change, the project filters would show up even with a single
tag, which wasn't very useful for filtering. Now filters only appear when
there are 2+ unique tags.
main
welpo 3 months ago
parent c15098a959
commit 180fc53384
No known key found for this signature in database
GPG Key ID: A2F978CF4EC1F5A6

@ -12,7 +12,8 @@
{% endfor %}
{#- Display unique terms -#}
{%- if all_terms -%}
{% set unique_terms = all_terms | unique | sort %}
{%- if unique_terms | length >= 2 -%}
<ul class="filter-controls" role="group" aria-label="{{ macros_translate::translate(key='project_filters', default='Project filters', language_strings=language_strings) }}">
<li class="taxonomy-item no-hover-padding">
<a id="all-projects-filter" class="no-hover-padding active"
@ -21,7 +22,7 @@
{{- macros_translate::translate(key="all_projects", default="All projects", language_strings=language_strings) -}}
</a>
</li>
{% for term in all_terms | unique | sort %}
{% for term in unique_terms %}
<li class="taxonomy-item no-hover-padding">
<a class="no-hover-padding"
href="{{ get_taxonomy_url(kind="tags", name=term, lang=lang) }}"

Loading…
Cancel
Save