Created
November 8, 2011 16:33
-
-
Save pydanny/1348277 to your computer and use it in GitHub Desktop.
django-uni-form + Twitter Bootstrap
This file contains 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
<!-- this usually goes in <project-root>/templates/uni_form/field.html --> | |
{% if field.is_hidden %} | |
{{ field }} | |
{% else %} | |
<div class="clearfix {% if field.errors %}error{% endif %}"> | |
<label for="{{ field.auto_id }}" {% if field.field.required %}class="requiredField"{% endif %}> | |
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %} | |
</label> | |
<div class="input"> | |
{{ field }} | |
{% if field.help_text or field.errors %} | |
<span class="help-inline"> | |
{% if field.help_text %} | |
{{ field.help_text|safe }} | |
{% endif %} | |
{% for error in field.errors %} | |
{{ error }} | |
{% endfor %} | |
</span> | |
{% endif %} | |
</div> | |
</div> | |
{% endif %} |
Very interesting and useful!!
Forked it with new bootstrap support - https://gist.github.com/1819668
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice!