This commit is contained in:
Jonas Heinrich 2025-04-08 10:33:00 +02:00
parent 2308302de0
commit abf6da60a8
4 changed files with 84 additions and 40 deletions

View file

@ -0,0 +1,18 @@
{% load i18n %}
{% load frontendbuild %}
<div style="display: none">{% include "django/forms/widgets/input.html" %}</div>
<select class="tagautocomplete"
data-additemtext="{% trans 'Press Enter to add <b>${value}</b>' %}"
data-uniqueitemtext="{% trans 'This tag is already set.' %}"
data-loading="{% trans 'Searching…' %}"
data-noresults="{% trans 'No results' %}"
data-nochoices="{% trans 'No results' %}"
data-itemselect="{% trans 'Press to select' %}"
data-allownew="{% if allow_new %}true{% else %}false{% endif %}"
data-queryparam="{{ query_param }}"
{% if max_item_count %}data-maxitemcount="{{ max_item_count }}"{% endif %}
id="{{ widget.attrs.id }}_select"
{% if max_item_count != 1 %}multiple{% endif %}>
{% for value in values %}<option value="{{ value.value }}" selected>{{ value.label }}</option>{% endfor %}
</select>