feat: first batch of work

This commit is contained in:
Herculino Trotta
2025-11-01 03:15:44 -03:00
parent e600d87968
commit a63367a772
175 changed files with 3433 additions and 2245 deletions
@@ -4,17 +4,15 @@
<div {% if field_class %}class="{{ field_class }}"{% endif %}{% if flat_attrs %} {{ flat_attrs }}{% endif %}>
{% for group, options, index in field|optgroups %}
{% if group %}<strong class="tw:font-bold tw:mb-2 tw:block">{{ group }}</strong>{% endif %}
{% if group %}<strong class="font-bold mb-2 block">{{ group }}</strong>{% endif %}
{% for option in options %}
<div class="tw:form-control{% if inline_class %} tw:inline-flex{% endif %}">
<label class="tw:label tw:cursor-pointer{% if inline_class %} tw:inline-flex{% endif %}">
<input type="{{option.type}}" class="{% if option.type == 'radio' %}tw:radio{% else %}tw:checkbox{% endif %}{% if field.errors %} tw:{% if option.type == 'radio' %}radio{% else %}checkbox{% endif %}-error{% endif %} tw:me-2" name="{{ field.html_name }}" value="{{ option.value|unlocalize }}" {% include "crispy-daisyui/layout/attrs.html" with widget=option %}>
<span class="tw:label-text">{{ option.label|unlocalize }}</span>
</label>
<label class="label cursor-pointer{% if inline_class %} inline-flex{% endif %}">
<span class="label-text">{{ option.label|unlocalize }}</span>
<input type="{{option.type}}" class="{% if option.type == 'radio' %}radio{% else %}checkbox{% endif %}{% if field.errors %} {% if option.type == 'radio' %}radio{% else %}checkbox{% endif %}-error{% endif %}" name="{{ field.html_name }}" value="{{ option.value|unlocalize }}" {% include "crispy-daisyui/layout/attrs.html" with widget=option %}>
</label>
{% if field.errors and forloop.last and not inline_class and forloop.parentloop.last %}
{% include 'crispy-daisyui/layout/field_errors_block.html' %}
{% endif %}
</div>
{% endfor %}
{% endfor %}
@@ -22,13 +20,13 @@
{% if field.errors and inline_class %}
{% if field.errors.field_id %}
{# Django 5.2+ #}
<div id="{{field.errors.field_id}}_error" class="tw:text-error tw:text-sm tw:mt-1">
<label id="{{field.errors.field_id}}_error" for="{{ field.auto_id }}" class="label">
{% else %}
<div id="{{field.auto_id}}_error" class="tw:text-error tw:text-sm tw:mt-1">
<label id="{{field.auto_id}}_error" for="{{ field.auto_id }}" class="label">
{% endif %}
{% for error in field.errors %}
<p id="error_{{ forloop.counter }}_{{ field.auto_id }}"><strong>{{ error }}</strong></p>
<span id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="label-text-alt text-error">{{ error }}</span>
{% endfor %}
</div>
</label>
{% endif %}
{% include 'crispy-daisyui/layout/help_text.html' %}