{% load widget_tweaks slippers %}
{% var render_fields=render_fields|default:"true" %}
{% var use_default_button=use_default_button|default:"true" %}
<form class="py-3" method="post" action="{{ url }}">
    {% for error in form.non_field_errors %}
        <span class="my-1 flex items-center max-w-xs mt-1 ml-1 text-sm font-medium tracking-wide text-error">{{ error }}</span>
    {% endfor %}
    {% if render_fields == "true" %}
        {% for field in form.visible_fields %}
            {% if field.name != "remember" %}
                <label class="label" for="{{ field.id_for_label }}">
                    <span class="label-text">{{ field.label }}</span>
                </label>
                {% if field.errors %}
                    {% render_field field placeholder="" class="w-full input input-bordered text-primary input-error" %}
                {% else %}
                    {% render_field field placeholder="" class="w-full input input-bordered text-primary" %}
                {% endif %}
                {% for error in field.errors %}
                    <span class="flex items-center max-w-xs mt-1 ml-1 text-xs font-medium tracking-wide text-error">{{ error }}</span>
                {% endfor %}
            {% endif %}
        {% endfor %}
    {% endif %}
    {{ children }}
    {% if use_default_button == "true" %}
        <button type="submit" class="my-3 btn btn-primary">{{ button_text }}</button>
    {% endif %}
</form>
