fix: wrong binding for checked box
This commit is contained in:
@@ -52,28 +52,30 @@
|
|||||||
|
|
||||||
<div id="{{ form.rentalitems.auto_id }}" class="col-span-full">
|
<div id="{{ form.rentalitems.auto_id }}" class="col-span-full">
|
||||||
{% for elem in form.rentalitems %}
|
{% for elem in form.rentalitems %}
|
||||||
<div class="col-span-2 mb-2">
|
<div class="col-span-2 mb-2">
|
||||||
|
<label for="{{ elem.data.value }}">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
id="{{ elem.data.value }}"
|
||||||
|
name="{{ form.rentalitems.html_name }}"
|
||||||
|
value="{{ elem.data.value }}"
|
||||||
|
{% if elem.data.selected %}checked{% endif %}
|
||||||
|
class="rounded border-gray-300 dark:border-none text-proprietary shadow-sm focus:border-blue-300 focus:ring focus:ring-offset-0 focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50"
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
href="{% url 'rental:rentalitem_detail' elem.data.value %}"
|
||||||
|
class="text-gray-700 dark:text-gray-200 underline hover:text-blue-700 dark:hover:text-blue-300"
|
||||||
|
title="Details zu {{ elem.choice_label }}"
|
||||||
|
aria-label="Details zu {{ elem.choice_label }}"
|
||||||
|
>{{ elem.choice_label }}</a>
|
||||||
|
</label>
|
||||||
|
|
||||||
<label for="{{ elem.id_for_label }}">
|
{% for item in rentalitems_addinfo %}
|
||||||
<input
|
{% if item.name == elem.choice_label and item.induction %}
|
||||||
type="checkbox"
|
<p class="text-xs text-gray-700 dark:text-gray-200">Einschulung erforderlich!</p>
|
||||||
id="{{ elem.id_for_label }}"
|
{% endif %}
|
||||||
name="{{ form.rentalitems.html_name }}"
|
{% endfor %}
|
||||||
value="{{ elem.data.value }}"
|
</div>
|
||||||
class="rounded border-gray-300 dark:border-none text-proprietary shadow-sm focus:border-blue-300 focus:ring focus:ring-offset-0 focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
href="{% url 'rental:rentalitem_detail' elem.data.value %}"
|
|
||||||
class="text-gray-700 dark:text-gray-200 underline hover:text-blue-700 dark:hover:text-blue-300"
|
|
||||||
>{{ elem.choice_label }}</a>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
{% for item in rentalitems_addinfo %}
|
|
||||||
{% if item.name == elem.choice_label and item.induction %}
|
|
||||||
<p class="text-xs text-gray-700 dark:text-gray-200">Einschulung erforderlich!</p>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user