Sunil Mohan Adapa 5ce7385f60
tags: css: Minor styling cleanups
- Use CSS based styling instead of styling based on bootstrap classes.

- Add a placeholder for the input box to easily locate it and convey what it
does.

- Drop dead code for '.tag-input .tag'.

- Drop some repeated data- attributes by using DOM navigation.

- Drop redundant styling.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-10-16 21:08:10 -07:00

48 lines
1.5 KiB
HTML

{% extends 'cards.html' %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load static %}
{% load i18n %}
{% 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="badge badge-light badge-pill tag-badge"
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-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 list-unstyled">
{% for tag in all_tags %}
{% if tag not in tags %}
<li class="dropdown-item" data-value="{{ tag }}">{% trans tag %}</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
{% block page_js %}
<script type="text/javascript" src="{% static 'tags.js' %}"></script>
{% endblock %}