mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-25 18:19:02 +02:00
feat: automated replacement
This commit is contained in:
@@ -1,40 +1,34 @@
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_field %}
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<div class="btn-group w-100" role="group" aria-label="{{ field.label }}">
|
||||
<div class="tw:form-group tw:mb-3">
|
||||
<div class="tw:join tw:w-full" role="group" aria-label="{{ field.label }}">
|
||||
<input type="radio"
|
||||
class="btn-check"
|
||||
class="tw:join-item tw:btn tw:btn-neutral {% if field.errors %}tw:input-error{% endif %}"
|
||||
name="{{ field.html_name }}"
|
||||
id="{{ field.html_name }}_none_tr"
|
||||
value=""
|
||||
aria-label="{% trans 'Unchanged' %}"
|
||||
{% if field.value is None %}checked{% endif %}>
|
||||
<label class="btn btn-outline-secondary {% if field.errors %}is-invalid{% endif %} w-100"
|
||||
for="{{ field.html_name }}_none_tr">
|
||||
{% trans 'Unchanged' %}
|
||||
</label>
|
||||
|
||||
{% for choice in field.field.choices %}
|
||||
<input type="radio"
|
||||
class="btn-check"
|
||||
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 %}>
|
||||
<label class="btn {% if forloop.first %}btn-outline-success{% elif forloop.last %}btn-outline-danger{% else %}btn-outline-primary{% endif %} {% if field.errors %}is-invalid{% endif %} w-100"
|
||||
for="{{ field.html_name }}_{{ forloop.counter }}_tr">
|
||||
{{ choice.1 }}
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if field.errors %}
|
||||
<div class="invalid-feedback d-block">
|
||||
<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="form-text text-muted">{{ field.help_text }}</small>
|
||||
<small class="tw:text-base-content/60 tw:text-sm">{{ field.help_text }}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user