Files
shoppy/web/templates/components/default/form.html
T
2026-03-17 14:03:51 +01:00

33 lines
966 B
HTML

{% load i18n %}
{% load static %}
<form hx-post="{{ url }}" hx-swap="none">
{% csrf_token %}
{% for field in form %}
<div class="mb-4">
<label for="{{ field.id_for_label }}"
class="inline-block text-sm font-medium ml-2">
{{ field.label }}
</label>
{{ field }}
</div>
{% endfor %}
{% for k, error in form.errors.items %}
<span class="flex justify-center mb-2 text-sm font-medium text-red-900 ">{{ error }}</span>
{% endfor %}
{% if success_message %}
<span class="flex justify-center mb-2 text-sm font-medium text-red-900 ">{{ success_message }}</span>
{% endif %}
<footer class="flex justify-end">
<button class="text-white hover: focus:ring-4 focus:outline-none
focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center
: :ring-primary-800 cursor-pointer"
>
{{ save_button_text }}
</button>
</footer>
</form>