|
3 | 3 |
|
4 | 4 | {% if field|is_checkbox %} |
5 | 5 | <div class="col {{ classes.label }}"> |
6 | | - <div class="{{ classes.single_value }}"> |
7 | | - <div class="checkbox"> |
8 | | - {% if field.auto_id %} |
9 | | - {{ field }} |
10 | | - <label for="{{ field.id_for_label }}" {% if field.field.required and form.required_css_class %}class="{{ form.required_css_class }}"{% endif %}> |
| 6 | + <div class="{{ classes.single_value }} {% if field.field.required and form.required_css_class %}{{ form.required_css_class }}{% endif %}"> |
| 7 | + <label> |
| 8 | + {% if field.auto_id %} |
| 9 | + {{ field }} |
| 10 | + |
11 | 11 | <span>{{ field.label }}</span> |
12 | | - </label> |
13 | | - {% endif %} |
14 | | - {% for error in field.errors %} |
15 | | - <span class="help-block {{ form.error_css_class }}">{{ error }}</span> |
16 | | - {% endfor %} |
| 12 | + {% endif %} |
| 13 | + {% for error in field.errors %} |
| 14 | + <span class="help-block {{ form.error_css_class }}">{{ error }}</span> |
| 15 | + {% endfor %} |
17 | 16 |
|
18 | | - {% if field.help_text %} |
19 | | - <p class="help-block"> |
20 | | - {{ field.help_text|safe }} |
21 | | - </p> |
22 | | - {% endif %} |
23 | | - </div> |
| 17 | + </div> |
| 18 | + </label> |
| 19 | + {% if field.help_text %} |
| 20 | + <p class="help-block"> |
| 21 | + {{ field.help_text|safe }} |
| 22 | + </p> |
| 23 | + {% endif %} |
24 | 24 | </div> |
25 | 25 | </div> |
26 | 26 | {% elif field|is_radio %} |
27 | 27 | <div class="col {{ classes.label }}"> |
| 28 | + <div class="{{ classes.single_value }} {% if field.field.required and form.required_css_class %}{{ form.required_css_class }}{% endif %}"> |
| 29 | + <label> |
| 30 | + {% if field.auto_id %} |
| 31 | + {{ field }} |
| 32 | + <span>{{ field.label }}</span> |
| 33 | + {% endif %} |
| 34 | + {% for error in field.errors %} |
| 35 | + <span class="help-block {{ form.error_css_class }}">{{ error }}</span> |
| 36 | + {% endfor %} |
28 | 37 |
|
29 | | - {% if field.auto_id %} |
30 | | - <label class="control-label {{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}">{{ field.label }}</label> |
31 | | - {% endif %} |
32 | | - <div class="{{ classes.value }}"> |
33 | | - {% for choice in field %} |
34 | | - <p> |
35 | | - {{ choice.tag }} |
36 | | - <label for="{{ choice.id_for_label }}">{{ choice.choice_label }}</label> |
37 | | - </p> |
38 | | - {% endfor %} |
39 | | - |
40 | | - {% for error in field.errors %} |
41 | | - <span class="help-block {{ form.error_css_class }}">{{ error }}</span> |
42 | | - {% endfor %} |
43 | | - |
| 38 | + </div> |
| 39 | + </label> |
44 | 40 | {% if field.help_text %} |
45 | | - <p class="help-block"> |
46 | | - {{ field.help_text|safe }} |
47 | | - </p> |
| 41 | + <p class="help-block"> |
| 42 | + {{ field.help_text|safe }} |
| 43 | + </p> |
48 | 44 | {% endif %} |
49 | 45 | </div> |
50 | 46 | </div> |
51 | | - {% elif field|is_date_input %} |
| 47 | + {% elif field|is_date_input or field|is_datetime_input %} |
52 | 48 | <div class="col {{ classes.label }}"> |
53 | 49 |
|
54 | 50 | <label for="{{ field.id_for_label }}">{{ field.label }}</label> |
|
65 | 61 | {% endif %} |
66 | 62 | </div> |
67 | 63 | {% elif field|is_select %} |
68 | | - <div class="col {{ classes.label }}"> |
| 64 | + <div class="col input-field {{ classes.label }} {{ classes.value }}"> |
69 | 65 | {% if field|is_checkbox_select_multiple %} |
70 | | - {% if field.auto_id %} |
71 | | - <label class="control-label {{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}">{{ field.label }}</label> |
72 | | - {% endif %} |
73 | | - <div class="{{ classes.value }}"> |
74 | | - {% for choice in field %} |
75 | | - <p> |
76 | | - {{ choice.tag }} |
77 | | - <label for="{{ choice.id_for_label }}">{{ choice.choice_label }}</label> |
78 | | - </p> |
79 | | - {% endfor %} |
| 66 | + <div class="input-field {{ classes.value }}"> |
| 67 | + <select multiple> |
| 68 | + {% for choice in field %} |
| 69 | + <option value="{{ choice.tag }}">{{ choice.choice_label }}</option> |
| 70 | + {% endfor %} |
| 71 | + </select> |
| 72 | + {% if field.auto_id %} |
| 73 | + <label class="control-label {{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}">{{ field.label }}</label> |
| 74 | + {% endif %} |
80 | 75 |
|
81 | 76 | {% for error in field.errors %} |
82 | 77 | <span class="help-block {{ form.error_css_class }}">{{ error }}</span> |
|
90 | 85 | </div> |
91 | 86 |
|
92 | 87 | {% else %} |
93 | | - <label for="{{ field.id_for_label }}">{{ field.label }}</label> |
94 | | - {{field}} |
95 | | - {% for error in field.errors %} |
96 | | - <span class="help-block {{ form.error_css_class }}">{{ error }}</span> |
97 | | - {% endfor %} |
| 88 | + <select> |
| 89 | + {% for choice in field %} |
| 90 | + <option value="{{ choice.tag }}">{{ choice.choice_label }}</option> |
| 91 | + {% endfor %} |
| 92 | + </select> |
| 93 | + {% if field.auto_id %} |
| 94 | + <label class="control-label {{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}">{{ field.label }}</label> |
| 95 | + {% endif %} |
98 | 96 |
|
99 | | - {% if field.help_text %} |
100 | | - <p class="help-block"> |
101 | | - {{ field.help_text|safe }} |
102 | | - </p> |
103 | | - {% endif %} |
| 97 | + {% for error in field.errors %} |
| 98 | + <span class="help-block {{ form.error_css_class }}">{{ error }}</span> |
| 99 | + {% endfor %} |
104 | 100 |
|
105 | | - {% endif %} |
| 101 | + {% if field.help_text %} |
| 102 | + <p class="help-block"> |
| 103 | + {{ field.help_text|safe }} |
| 104 | + </p> |
| 105 | + {% endif %} |
| 106 | + |
| 107 | + {% endif %} |
106 | 108 |
|
107 | 109 | </div> |
108 | 110 |
|
|
0 commit comments