Create select widget based on tomselect on django backend

Replace make_ajax in elections by the new widget
This commit is contained in:
2024-10-19 21:32:58 +02:00
parent 0a0092e189
commit 8be8328830
5 changed files with 103 additions and 60 deletions

View File

@ -0,0 +1,10 @@
<script-once src="{{ statics.js }}" defer></script-once>
{% for css in statics.csss %}
<link-once rel="stylesheet" type="text/css" href="{{ css }}" defer></link-once>
{% endfor %}
<autocomplete-select name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>{% for group_name, group_choices, group_index in widget.optgroups %}{% if group_name %}
<optgroup label="{{ group_name }}">{% endif %}{% for widget in group_choices %}
{% include widget.template_name %}{% endfor %}{% if group_name %}
</optgroup>{% endif %}{% endfor %}
</autocomplete-select>