Change checkboxes to checkbox buttons.

This commit is contained in:
Christopher Charbonneau Wells 2018-02-04 20:39:47 -05:00
parent 18583d8cb6
commit d69667bbab
1 changed files with 9 additions and 7 deletions

View File

@ -7,13 +7,15 @@
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
{% if field|field_type == "booleanfield" %} {% if field|field_type == "booleanfield" %}
<div class="custom-control custom-checkbox"> <div class="btn-group-toggle" data-toggle="buttons">
{% if field.errors %} <label for="id_{{ field.name }}" class="btn btn-outline-light{% if field.value %} active{% endif %}">
{{ field|add_class:"custom-control-input is-invalid" }} {% if field.errors %}
{% else %} {{ field|add_class:"is-invalid" }}
{{ field|add_class:"custom-control-input" }} {% else %}
{% endif %} {{ field }}
<label for="id_{{ field.name }}" class="custom-control-label">{{ field.label }}</label> {% endif %}
{{ field.label }}
</label>
</div> </div>
{% elif field|field_type == "datetimefield" or field|field_type == "datefield" %} {% elif field|field_type == "datetimefield" or field|field_type == "datefield" %}
<div class="input-group date" id="datetimepicker_{{ field.name }}" data-target-input="nearest"> <div class="input-group date" id="datetimepicker_{{ field.name }}" data-target-input="nearest">