Created
June 8, 2016 13:44
-
-
Save reidransom/c363b517993e2034a6e4c83382548568 to your computer and use it in GitHub Desktop.
Simple Crispy Field Layout Template (Non-Radio/Checkbox)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load crispy_forms_field %} | |
<{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="form-group{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if form_show_errors%}{% if field.errors %} has-error{% endif %}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}"> | |
{% if field.label and form_show_labels %} | |
<label for="{{ field.id_for_label }}" class="control-label {{ label_class }}{% if field.field.required %} requiredField{% endif %}"> | |
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %} | |
</label> | |
{% endif %} | |
<div class="controls {{ field_class }}"> | |
{% crispy_field field %} | |
{% include 'bootstrap3/layout/help_text_and_errors.html' %} | |
</div> | |
</{% if tag %}{{ tag }}{% else %}div{% endif %}> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment