feat: Add date support and simplify
This commit is contained in:
@@ -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 %}
|
||||||
|
Reference in New Issue
Block a user