34 lines
992 B
HTML
34 lines
992 B
HTML
{% load i18n %}
|
|
|
|
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
|
|
<label for="{{ field.id_for_label }}" class="form-label">
|
|
{{ field.label }}
|
|
{% if field.field.required %}<span class="text-danger">*</span>{% endif %}
|
|
</label>
|
|
|
|
{% if field.field.widget.input_type == 'checkbox' %}
|
|
<div class="form-check">
|
|
{{ field }}
|
|
<label class="form-check-label" for="{{ field.id_for_label }}">
|
|
{{ field.label }}
|
|
</label>
|
|
</div>
|
|
{% elif field.field.widget.input_type == 'select' %}
|
|
{{ field }}
|
|
{% else %}
|
|
{{ field }}
|
|
{% endif %}
|
|
|
|
{% if field.help_text %}
|
|
<small class="form-text text-muted">{{ field.help_text }}</small>
|
|
{% endif %}
|
|
|
|
{% if field.errors %}
|
|
<div class="invalid-feedback d-block">
|
|
{% for error in field.errors %}
|
|
{{ error }}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|