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,7 +31,7 @@ | ||
31 | <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> | 31 | <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> |
32 | <label for="{{ field.auto_id }}">{{ field.label }}</label> | 32 | <label for="{{ field.auto_id }}">{{ field.label }}</label> |
33 | {% if field.auto_id == 'id_birth_date' %} | 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 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | 35 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> |
36 | {% elif field.auto_id == 'id_image' %} | 36 | {% elif field.auto_id == 'id_image' %} |
37 | {% render_field field class='form-control input-sm' %} | 37 | {% render_field field class='form-control input-sm' %} |
@@ -49,11 +49,16 @@ | @@ -49,11 +49,16 @@ | ||
49 | {% render_field field type='checkbox' %} | 49 | {% render_field field type='checkbox' %} |
50 | </label> | 50 | </label> |
51 | </div> | 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 | {% else %} | 57 | {% else %} |
53 | {% render_field field class='form-control' %} | 58 | {% render_field field class='form-control' %} |
54 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | 59 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> |
55 | {% endif %} | 60 | {% endif %} |
56 | - {% if field.errors.length > 0 %} | 61 | + {% if field.errors %} |
57 | <div class="alert alert-danger alert-dismissible" role="alert"> | 62 | <div class="alert alert-danger alert-dismissible" role="alert"> |
58 | <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | 63 | <button type="button" class="close" data-dismiss="alert" aria-label="Close"> |
59 | <span aria-hidden="true">×</span> | 64 | <span aria-hidden="true">×</span> |
@@ -64,7 +69,6 @@ | @@ -64,7 +69,6 @@ | ||
64 | {% endfor %} | 69 | {% endfor %} |
65 | </ul> | 70 | </ul> |
66 | </div> | 71 | </div> |
67 | - </div> | ||
68 | {% endif %} | 72 | {% endif %} |
69 | </div> | 73 | </div> |
70 | {% endfor %} | 74 | {% endfor %} |
users/templates/users/update.html
@@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
34 | <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> | 34 | <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> |
35 | <label for="{{ field.auto_id }}">{{ field.label }}</label> | 35 | <label for="{{ field.auto_id }}">{{ field.label }}</label> |
36 | {% if field.auto_id == 'id_birth_date' %} | 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 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | 38 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> |
39 | {% elif field.auto_id == 'id_image' %} | 39 | {% elif field.auto_id == 'id_image' %} |
40 | {% render_field field class='form-control input-sm' %} | 40 | {% render_field field class='form-control input-sm' %} |
@@ -48,6 +48,16 @@ | @@ -48,6 +48,16 @@ | ||
48 | </div> | 48 | </div> |
49 | {% elif field.auto_id == 'id_cpf' %} | 49 | {% elif field.auto_id == 'id_cpf' %} |
50 | {% render_field field class='form-control' onkeypress='campoNumerico(this,event); formatarCpf(this,event);' %} | 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 | {% else %} | 61 | {% else %} |
52 | {% render_field field class='form-control' %} | 62 | {% render_field field class='form-control' %} |
53 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | 63 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> |