Skip to content

Instantly share code, notes, and snippets.

@alexanderjulo
Created July 14, 2012 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderjulo/3113251 to your computer and use it in GitHub Desktop.
Save alexanderjulo/3113251 to your computer and use it in GitHub Desktop.
<div class="control-group {% if input.errors %}error{% endif %}">
{% if input.type == 'BooleanField' %}
<div class="controls">
<label for="{{ input.name }}" class="checkbox">
{{ input }}
{{ input.label.text }}
</label>
</div>
{% else %}
<label for="{{ input.name }}" class="control-label">{{ input.label.text }}</label>
<div class="controls">
{{ input }}
{% if input.errors %}
<div>
{% for error in input.errors %}
<span class="help-inline">
{{ error }}
</span>
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment