|
|
@@ -1,19 +1,42 @@
|
|
|
1
|
+{% load form_tags %}
|
|
|
2
|
+
|
|
|
3
|
+{# Make the field widget type available to templates #}
|
|
|
4
|
+{% annotate_form_field field %}
|
|
|
5
|
+
|
|
1
|
6
|
<div class="control-group {% for error in field.errors %}error{% endfor %}">
|
|
2
|
7
|
{% if field.is_hidden %}
|
|
3
|
8
|
{{ field }}
|
|
4
|
9
|
{% else %}
|
|
5
|
|
- <label for="{{ field.auto_id }}" class="control-label {% if field.field.required %}required{% endif %}">{{ field.label }}{% if field.field.required %} <span>*</span>{% endif %}</label>
|
|
6
|
|
- <div class="controls">
|
|
7
|
|
- {{ field }}
|
|
8
|
|
- {% for error in field.errors %}
|
|
9
|
|
- <span class="help-block">{{ error }}</span>
|
|
10
|
|
- {% endfor %}
|
|
11
|
|
- {% if field.help_text %}
|
|
12
|
|
- <span class='help-block'>
|
|
13
|
|
- {# We allow HTML within form help fields #}
|
|
14
|
|
- {{ field.help_text|safe }}
|
|
15
|
|
- </span>
|
|
16
|
|
- {% endif %}
|
|
17
|
|
- </div>
|
|
|
10
|
+ {# Check if field is a checkbox as we mark these up differently #}
|
|
|
11
|
+ {% if field.widget_type == 'CheckboxInput' %}
|
|
|
12
|
+ <label for="{{ field.auto_id }}" class="control-label checkbox {% if field.field.required %}required{% endif %}">{{ field.label }}{% if field.field.required %} <span>*</span>{% endif %}
|
|
|
13
|
+ {{ field }}
|
|
|
14
|
+ </label>
|
|
|
15
|
+ <div class="controls">
|
|
|
16
|
+ {% for error in field.errors %}
|
|
|
17
|
+ <span class="help-block">{{ error }}</span>
|
|
|
18
|
+ {% endfor %}
|
|
|
19
|
+ {% if field.help_text %}
|
|
|
20
|
+ <span class='help-block'>
|
|
|
21
|
+ {# We allow HTML within form help fields #}
|
|
|
22
|
+ {{ field.help_text|safe }}
|
|
|
23
|
+ </span>
|
|
|
24
|
+ {% endif %}
|
|
|
25
|
+ </div>
|
|
|
26
|
+ {% else %}
|
|
|
27
|
+ <label for="{{ field.auto_id }}" class="control-label {% if field.field.required %}required{% endif %}">{{ field.label }}{% if field.field.required %} <span>*</span>{% endif %}</label>
|
|
|
28
|
+ <div class="controls">
|
|
|
29
|
+ {{ field }}
|
|
|
30
|
+ {% for error in field.errors %}
|
|
|
31
|
+ <span class="help-block">{{ error }}</span>
|
|
|
32
|
+ {% endfor %}
|
|
|
33
|
+ {% if field.help_text %}
|
|
|
34
|
+ <span class='help-block'>
|
|
|
35
|
+ {# We allow HTML within form help fields #}
|
|
|
36
|
+ {{ field.help_text|safe }}
|
|
|
37
|
+ </span>
|
|
|
38
|
+ {% endif %}
|
|
|
39
|
+ </div>
|
|
|
40
|
+ {% endif %}
|
|
18
|
41
|
{% endif %}
|
|
19
|
42
|
</div>
|