{% load ui %}
{% for field in attrs.form.hidden_fields %}{{ field }}{% endfor %}
{% for error in attrs.form.non_field_errors %}
    <div class="alert alert-error my-2">
        <span>{{ error }}</span>
    </div>
{% endfor %}
{% for field in attrs.form.visible_fields %}
    <div class="form-control my-3 w-full">
        {% if field.field.widget.input_type == "checkbox" %}
            <label class="label cursor-pointer justify-start gap-3" for="{{ field.id_for_label }}">
                {{ field|daisy }}
                <span class="label-text">{{ field.label }}</span>
            </label>
        {% else %}
            <label class="label" for="{{ field.id_for_label }}">
                <span class="label-text">{{ field.label }}</span>
            </label>
            {{ field|daisy }}
        {% endif %}
        {% if field.help_text %}<span class="label-text-alt mt-1 text-base-content/70">{{ field.help_text }}</span>{% endif %}
        {% for error in field.errors %}<span class="label-text-alt mt-1 text-error">{{ error }}</span>{% endfor %}
    </div>
{% endfor %}
