mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-07-22 11:59:33 +00:00
ui: tags: Show tags on all cards pages if present
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
d629295110
commit
29d6cb2302
@ -11,42 +11,3 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block body_class %}apps-page{% endblock %}
|
||||
|
||||
{% block tags %}
|
||||
{% if tags %}
|
||||
<div class="container">
|
||||
<div class="dropdown searchable-dropdown">
|
||||
<div class="tag-input">
|
||||
<div id="selected-tags">
|
||||
{% for tag in tags %}
|
||||
<span class="btn btn-light rounded-pill tag"
|
||||
data-tag="{{ tag }}">
|
||||
{% trans tag %}
|
||||
<button class="btn btn-sm btn-light remove-tag">
|
||||
<i class="fa fa-times"></i>
|
||||
</button>
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<input id="add-tag-input" type="search" class="form-control dropdown-toggle"
|
||||
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
|
||||
autocomplete="off" placeholder="{% trans "Search with tags" %}">
|
||||
<div class="dropdown-menu" aria-labelledby="add-tag-input">
|
||||
<ul class="dropdown-items">
|
||||
{% for tag in all_tags %}
|
||||
{% if tag not in tags %}
|
||||
<li class="dropdown-item" data-tag="{{ tag }}"
|
||||
data-tag_l10n="{% trans tag %}">
|
||||
{% trans tag %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<a href="{% url 'apps' %}" aria-label="{% trans 'Clear all tags' %}"
|
||||
class="btn-close" type="button"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@ -15,7 +15,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% block tags %}{% endblock %}
|
||||
{% block tags %}
|
||||
{% include "tags.html" %}
|
||||
{% endblock %}
|
||||
|
||||
<div class="container card-container">
|
||||
<div class="row">
|
||||
|
||||
42
plinth/templates/tags.html
Normal file
42
plinth/templates/tags.html
Normal file
@ -0,0 +1,42 @@
|
||||
{% comment %}
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
{% endcomment %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% if tags %}
|
||||
<div class="container">
|
||||
<div class="dropdown searchable-dropdown">
|
||||
<div class="tag-input">
|
||||
<div id="selected-tags">
|
||||
{% for tag in tags %}
|
||||
<span class="btn btn-light rounded-pill tag"
|
||||
data-tag="{{ tag }}">
|
||||
{% trans tag %}
|
||||
<button class="btn btn-sm btn-light remove-tag">
|
||||
<i class="fa fa-times"></i>
|
||||
</button>
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<input id="add-tag-input" type="search" class="form-control dropdown-toggle"
|
||||
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
|
||||
autocomplete="off" placeholder="{% trans "Search with tags" %}">
|
||||
<div class="dropdown-menu" aria-labelledby="add-tag-input">
|
||||
<ul class="dropdown-items">
|
||||
{% for tag in all_tags %}
|
||||
{% if tag not in tags %}
|
||||
<li class="dropdown-item" data-tag="{{ tag }}"
|
||||
data-tag_l10n="{% trans tag %}">
|
||||
{% trans tag %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<a href="{% url 'apps' %}" aria-label="{% trans 'Clear all tags' %}"
|
||||
class="btn-close" type="button"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
Loading…
x
Reference in New Issue
Block a user