Commit 1181094df54a569b5f1b8619184fa9ea97260e1a
1 parent
4e78bf14
Exists in
master
and in
3 other branches
Fixing categories form checkbox
Showing
2 changed files
with
10 additions
and
11 deletions
Show diff stats
categories/templates/categories/create.html
... | ... | @@ -14,18 +14,17 @@ |
14 | 14 | {% csrf_token %} |
15 | 15 | {% for field in form %} |
16 | 16 | <div class="form-group {% if form.has_error %} has-error {% endif %} is-fileinput"> |
17 | - {% if field.auto_id != 'id_public' %} | |
17 | + {% if field.auto_id != 'id_visible' %} | |
18 | 18 | <label for="{{ field.auto_id }}">{{ field.label }}</label> |
19 | 19 | {% endif %} |
20 | 20 | {% if field.auto_id == 'id_init_register_date' or field.auto_id == 'id_end_register_date' or field.auto_id == 'id_init_date' or field.auto_id == 'id_end_date'%} |
21 | 21 | <input type="text" class="form-control date-picker" name="{{field.name}}" value="{{field.value|date}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> |
22 | - {% elif field.auto_id == 'id_public' %} | |
22 | + {% elif field.auto_id == 'id_visible' %} | |
23 | 23 | <div class="checkbox"> |
24 | - <label> | |
25 | - <input type="checkbox" name="{{field.name}}" {% if field.value %}checked="checked"{% endif %}><span class="checkbox-material"></span> {{field.name}} | |
26 | - </label> | |
24 | + <label for="{{ field.auto_id }}"> | |
25 | + {% render_field field %} {{field.label}} | |
26 | + </label> | |
27 | 27 | </div> |
28 | - | |
29 | 28 | {% elif field.auto_id == 'id_description' %} |
30 | 29 | {% render_field field class='form-control text_wysiwyg' %} |
31 | 30 | {% else %} | ... | ... |
categories/templates/categories/update.html
... | ... | @@ -16,16 +16,16 @@ |
16 | 16 | {% csrf_token %} |
17 | 17 | {% for field in form %} |
18 | 18 | <div class="form-group {% if form.has_error %} has-error {% endif %} is-fileinput"> |
19 | - {% if field.auto_id != 'id_public' %} | |
19 | + {% if field.auto_id != 'id_visible' %} | |
20 | 20 | <label for="{{ field.auto_id }}">{{ field.label }}</label> |
21 | 21 | {% endif %} |
22 | 22 | {% if field.auto_id == 'id_init_register_date' or field.auto_id == 'id_end_register_date' or field.auto_id == 'id_init_date' or field.auto_id == 'id_end_date'%} |
23 | 23 | <input type="text" class="form-control date-picker" name="{{field.name}}" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}"> |
24 | - {% elif field.auto_id == 'id_public' %} | |
24 | + {% elif field.auto_id == 'id_visible' %} | |
25 | 25 | <div class="checkbox"> |
26 | - <label> | |
27 | - <input type="checkbox" name="{{field.name}}" {% if field.value %}checked="checked"{% endif %}><span class="checkbox-material"></span> {{field.name}} | |
28 | - </label> | |
26 | + <label for="{{ field.auto_id }}"> | |
27 | + {% render_field field %} {{field.label}} | |
28 | + </label> | |
29 | 29 | </div> |
30 | 30 | {% elif field.auto_id == 'id_description' %} |
31 | 31 | {% render_field field class='form-control text_wysiwyg' %} | ... | ... |