Permalink
Browse files

Merge branch 'master' of git@github.com:pydanny/django-uni-form

  • Loading branch information...
2 parents 56281e1 + 24a1e53 commit 7a713d06604606e87aaf90a97d387b0bef6fb1cd @pydanny pydanny committed Nov 16, 2009
Showing with 30 additions and 30 deletions.
  1. +30 −30 uni_form/templates/uni_form/field.html
@@ -1,31 +1,31 @@
{% load uni_form_field %}
- {% if field.is_hidden %}
- {{ field }}
- {% else %}
- <div id="div_{{ field.auto_id }}" class="ctrlHolder{% if field.errors %} error{% endif %}{% if field|is_checkbox %} checkbox{% endif %}">
- {% for error in field.errors %}
- <p id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="errorField">
- {{ error }}
- </p>
- {% endfor %}
- {% if field|is_checkbox %}
- {{ field|with_class }}
- {% if field.label %}
- <label for="{{ field.auto_id }}">
- {{ field.label }}{% if field.field.required %}*{% endif %}
- </label>
- {% endif %}
- {% else %}
- {% if field.label %}
- <label for="{{ field.auto_id }}">
- {{ field.label }}{% if field.field.required %}*{% endif %}
- </label>
- {% endif %}
- {{ field|with_class }}
- {% endif %}
- {% if field.help_text %}
- <p id="hint_{{ field.auto_id }}" class="formHint">{{ field.help_text|safe }}</p>
- {% endif %}
- </div>
- {% endif %}
-
+
+{% if field.is_hidden %}
+ {{ field }}
+{% else %}
+ <div id="div_{{ field.auto_id }}" class="ctrlHolder{% if field.errors %} error{% endif %}{% if field|is_checkbox %} checkbox{% endif %} {% if field.field.widget.attrs.class %} {{ field.field.widget.attrs.class }}{% endif %}">
+ {% for error in field.errors %}
+ <p id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="errorField">
+ {{ error }}
+ </p>
+ {% endfor %}
+
+ {% if field|is_checkbox %}
+ {{ field|with_class }}
+ {% endif %}
+
+ {% if field.label %}
+ <label for="{{ field.auto_id }}">
+ {{ field.label }}{% if field.field.required %}*{% endif %}
+ </label>
+ {% endif %}
+
+ {% if not field|is_checkbox %}
+ {{ field|with_class }}
+ {% endif %}
+
+ {% if field.help_text %}
+ <p id="hint_{{ field.auto_id }}" class="formHint">{{ field.help_text|safe }}</p>
+ {% endif %}
+ </div>
+{% endif %}

0 comments on commit 7a713d0

Please sign in to comment.