{% load tailwind_field %} {% if field.is_hidden %} {{ field }} {% else %}
{% if field.label and form_show_labels %} {% endif %}
{% if crispy_prepended_text and not crispy_appended_text %} {{ crispy_prepended_text|safe }} {% if field.errors %} {% tailwind_field field "class" "border border-red-500 rounded-lg rounded-l-none px-4 py-2 w-full focus:outline-none text-gray-700 border-l-0 leading-normal" %} {% else %} {% tailwind_field field "class" "border border-gray-300 rounded-lg rounded-l-none px-4 py-2 w-full focus:outline-none text-gray-700 border-l-0 leading-normal" %} {% endif %} {% elif crispy_appended_text and not crispy_prepended_text %} {% if field.errors %} {% tailwind_field field "class" "border border-red-500 rounded-lg rounded-r-none px-4 py-2 w-full focus:outline-none text-gray-700 border-r-0 leading-normal" %} {% else %} {% tailwind_field field "class" "border border-gray-300 rounded-lg rounded-r-none px-4 py-2 w-full focus:outline-none text-gray-700 border-r-0 leading-normal" %} {% endif %} {{ crispy_appended_text|safe }} {% else %} {{ crispy_prepended_text|safe }} {% if field.errors %} {% tailwind_field field "class" "border border-r-0 border-l-0 border-red-500 px-4 py-2 w-full focus:outline-none text-gray-700 border-r-0 leading-normal" %} {% else %} {% tailwind_field field "class" "border border-gray-300 px-4 py-2 w-full focus:outline-none text-gray-700 border-r-0 leading-normal" %} {% endif %} {{ crispy_appended_text|safe }} {% endif %}
{% include 'tailwind/layout/field_errors.html' %} {% include 'tailwind/layout/help_text.html' %}
{% endif %}