2017-11-11 22:27:42 +00:00
|
|
|
{% load widget_tweaks %}
|
|
|
|
|
2021-01-18 20:47:26 +00:00
|
|
|
<label for="id_{{ field.name }}" class="col-sm-2 col-form-label{% if field|field_type == 'booleanfield' %} boolean-label{% endif %}">
|
2017-11-11 22:27:42 +00:00
|
|
|
{% if field|field_type != "booleanfield" %}
|
|
|
|
{{ field.label }}
|
|
|
|
{% endif %}
|
|
|
|
</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
{% if field|field_type == "booleanfield" %}
|
2018-02-05 01:39:47 +00:00
|
|
|
<div class="btn-group-toggle" data-toggle="buttons">
|
2018-02-17 22:24:41 +00:00
|
|
|
<label for="id_{{ field.name }}" class="btn btn-outline-light btn-no-hover{% if field.value %} active{% endif %}">
|
2018-02-05 01:39:47 +00:00
|
|
|
{% if field.errors %}
|
|
|
|
{{ field|add_class:"is-invalid" }}
|
|
|
|
{% else %}
|
|
|
|
{{ field }}
|
|
|
|
{% endif %}
|
|
|
|
{{ field.label }}
|
|
|
|
</label>
|
2017-11-11 22:27:42 +00:00
|
|
|
</div>
|
|
|
|
{% elif field|field_type == "datetimefield" or field|field_type == "datefield" %}
|
2020-01-28 05:03:55 +00:00
|
|
|
<div class="input-group input-group-lg datetimepicker" id="datetimepicker_{{ field.name }}" data-target-input="nearest">
|
2021-09-04 03:42:37 +00:00
|
|
|
<div class="input-group-prepend px-2 rounded-left bg-dark" data-target="#datetimepicker_{{ field.name }}" data-toggle="datetimepicker">
|
2021-09-04 03:17:38 +00:00
|
|
|
<span class="input-group-text"><i class="icon-calendar"></i></span>
|
2017-11-11 22:27:42 +00:00
|
|
|
</div>
|
2020-01-28 04:40:52 +00:00
|
|
|
{% if field.errors %}
|
2020-01-28 04:41:11 +00:00
|
|
|
{{ field|add_class:"datetimepicker-input form-control form-control-lg is-invalid" }}
|
2020-01-28 04:40:52 +00:00
|
|
|
{% else %}
|
2020-01-28 04:41:11 +00:00
|
|
|
{{ field|add_class:"datetimepicker-input form-control form-control-lg" }}
|
2020-01-28 04:40:52 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
2018-02-05 00:56:04 +00:00
|
|
|
{% elif 'choice' in field|field_type %}
|
|
|
|
{% if field.errors %}
|
|
|
|
{{ field|add_class:"custom-select is-invalid" }}
|
|
|
|
{% else %}
|
|
|
|
{{ field|add_class:"custom-select" }}
|
|
|
|
{% endif %}
|
2017-11-11 22:27:42 +00:00
|
|
|
{% else %}
|
|
|
|
{% if field.errors %}
|
|
|
|
{{ field|add_class:"form-control is-invalid" }}
|
|
|
|
{% else %}
|
|
|
|
{{ field|add_class:"form-control" }}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% if field.help_text %}
|
|
|
|
<div class="help-block"><small>{{ field.help_text }}</small></div>
|
|
|
|
{% endif %}
|
|
|
|
{% if field.errors %}
|
|
|
|
<div class="invalid-feedback">{% for error in field.errors %}{{ error }}{% endfor %}</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|