Commit baf2c430e83e16eea08de36d98ebf0c802b54681
1 parent
fbd3d720
Exists in
master
and in
5 other branches
Fixing template error #7
Showing
2 changed files
with
18 additions
and
4 deletions
Show diff stats
users/templates/users/edit_profile.html
... | ... | @@ -31,7 +31,7 @@ |
31 | 31 | <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> |
32 | 32 | <label for="{{ field.auto_id }}">{{ field.label }}</label> |
33 | 33 | {% if field.auto_id == 'id_birth_date' %} |
34 | - <input type="date" class="form-control"name="{{field.name}}" value="{% if field.value.year %}{{field.value|date:'Y-m-d'}}{% else %}{{field.value}}{% endif %}" min="{{now|date:'Y-m-d'}}" id="{{ field.auto_id }}"> | |
34 | + <input type="text" class="form-control date-picker"name="{{field.name}}" value="{% if field.value.year %}{{field.value|date:'Y-m-d'}}{% else %}{{field.value}}{% endif %}" min="{{now|date:'Y-m-d'}}" id="{{ field.auto_id }}"> | |
35 | 35 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> |
36 | 36 | {% elif field.auto_id == 'id_image' %} |
37 | 37 | {% render_field field class='form-control input-sm' %} |
... | ... | @@ -49,11 +49,16 @@ |
49 | 49 | {% render_field field type='checkbox' %} |
50 | 50 | </label> |
51 | 51 | </div> |
52 | + {% elif field.auto_id == 'id_cpf' %} | |
53 | + {% render_field field class='form-control' onkeypress='campoNumerico(this,event); formatarCpf(this,event);' %} | |
54 | + | |
55 | + {% elif field.auto_id == 'id_phone' %} | |
56 | + {% render_field field class='form-control' onkeypress='campoNumerico(this,event); formatarTelefone(this,event);' %} | |
52 | 57 | {% else %} |
53 | 58 | {% render_field field class='form-control' %} |
54 | 59 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> |
55 | 60 | {% endif %} |
56 | - {% if field.errors.length > 0 %} | |
61 | + {% if field.errors %} | |
57 | 62 | <div class="alert alert-danger alert-dismissible" role="alert"> |
58 | 63 | <button type="button" class="close" data-dismiss="alert" aria-label="Close"> |
59 | 64 | <span aria-hidden="true">×</span> |
... | ... | @@ -64,7 +69,6 @@ |
64 | 69 | {% endfor %} |
65 | 70 | </ul> |
66 | 71 | </div> |
67 | - </div> | |
68 | 72 | {% endif %} |
69 | 73 | </div> |
70 | 74 | {% endfor %} | ... | ... |
users/templates/users/update.html
... | ... | @@ -34,7 +34,7 @@ |
34 | 34 | <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> |
35 | 35 | <label for="{{ field.auto_id }}">{{ field.label }}</label> |
36 | 36 | {% if field.auto_id == 'id_birth_date' %} |
37 | - <input type="date" class="form-control"name="{{field.name}}" value="{% if field.value.year %}{{field.value|date:'Y-m-d'}}{% else %}{{field.value}}{% endif %}" min="{{now|date:'Y-m-d'}}" id="{{ field.auto_id }}"> | |
37 | + <input type="text" class="form-control date-picker"name="{{field.name}}" value="{% if field.value.year %}{{field.value|date:'Y-m-d'}}{% else %}{{field.value}}{% endif %}" min="{{now|date:'Y-m-d'}}" id="{{ field.auto_id }}"> | |
38 | 38 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> |
39 | 39 | {% elif field.auto_id == 'id_image' %} |
40 | 40 | {% render_field field class='form-control input-sm' %} |
... | ... | @@ -48,6 +48,16 @@ |
48 | 48 | </div> |
49 | 49 | {% elif field.auto_id == 'id_cpf' %} |
50 | 50 | {% render_field field class='form-control' onkeypress='campoNumerico(this,event); formatarCpf(this,event);' %} |
51 | + | |
52 | + {% elif field.auto_id == 'id_phone' %} | |
53 | + {% render_field field class='form-control' onkeypress='campoNumerico(this,event); formatarTelefone(this,event);' %} | |
54 | + | |
55 | + {% elif field.auto_id == 'id_is_staff' or field.auto_id == 'id_is_active' %} | |
56 | + <div class="checkbox"> | |
57 | + <label for="{{ field.auto_id }}"> | |
58 | + {% render_field field %}<span class="checkbox-material"><span class="check"></span></span> {{field.label}} | |
59 | + </label> | |
60 | + </div> | |
51 | 61 | {% else %} |
52 | 62 | {% render_field field class='form-control' %} |
53 | 63 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | ... | ... |