kpsul/kfet/templates/kfet/form_field_snippet.html
2020-09-07 14:57:41 +02:00

27 lines
821 B
HTML

{% load widget_tweaks %}
<div class="form-group">
<label for="{{ field.id_for_label }}" class="col-sm-2 control-label">{{ field.label }}</label>
<div class="col-sm-10">
{% if field|widget_type == "checkboxselectmultiple" %}
<ul class="list-unstyled checkbox-select-multiple">
{% for choice in field %}
<li class="col-sm-6 col-lg-4">
<label for="{{ choice.id_for_label }}">
{{ choice.tag }} {{ choice.choice_label }}
</label>
</li>
{% endfor %}
</ul>
{% else %}
{{ field|add_class:'form-control' }}
{% endif %}
{% if field.errors %}
<span class="help-block">{{field.errors}}</span>
{% endif %}
{% if field.help_text %}
<span class="help-block">{{field.help_text}}</span>
{% endif %}
</div>
</div>