mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-23 00:58:40 +02:00
26 lines
1.1 KiB
HTML
26 lines
1.1 KiB
HTML
{% load crispy_forms_field %}
|
|
|
|
<div class="tw:form-group tw:mb-3">
|
|
<div class="tw:join tw:w-full" role="group" aria-label="{{ field.label }}">
|
|
{% for choice in field.field.choices %}
|
|
<input type="radio"
|
|
class="tw:join-item tw:btn {% if forloop.first %}tw:btn-success{% elif forloop.last %}tw:btn-error{% else %}tw:btn-primary{% endif %} {% if field.errors %}tw:input-error{% endif %}"
|
|
name="{{ field.html_name }}"
|
|
id="{{ field.html_name }}_{{ forloop.counter }}_tr"
|
|
value="{{ choice.0 }}"
|
|
aria-label="{{ choice.1 }}"
|
|
{% if choice.0 == field.value %}checked{% endif %}>
|
|
{% endfor %}
|
|
</div>
|
|
{% if field.errors %}
|
|
<div class="tw:text-error tw:text-sm tw:mt-1">
|
|
{% for error in field.errors %}
|
|
{{ error }}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% if field.help_text %}
|
|
<small class="tw:text-base-content/60 tw:text-sm">{{ field.help_text }}</small>
|
|
{% endif %}
|
|
</div>
|