feat: Add date support and simplify

This commit is contained in:
2025-06-16 23:01:12 +02:00
parent 5511d8275c
commit e132b1c9f6

View File

@@ -1,6 +1,8 @@
<!--- See https://docs.djangoproject.com/en/5.2/topics/forms/#reusable-form-templates --> <!--- See https://docs.djangoproject.com/en/5.2/topics/forms/#reusable-form-templates -->
{% load custom_tags %} {% load custom_tags %}
{% load widget_tweaks %}
{% for field in form %} {% for field in form %}
<div class="field"> <div class="field">
@@ -8,12 +10,13 @@
{{ field.label }} {{ field.label }}
</label> </label>
<div class="control"> <div class="control">
{% if field|widget_type == 'TextInput' %} {% if field|widget_type == 'Select' %}
{{ field|add_class:"input" }}
{% elif field|widget_type == 'Select' %}
<div class="select"> <div class="select">
{{ field }} {{ field }}
</div> </div>
{% elif field|widget_type == 'dateinput' %}
{{ field|add_class:"input"|attr:"type:date" }}
{% else %} {% else %}
{{ field|add_class:"input" }} {{ field|add_class:"input" }}
{% endif %} {% endif %}