Commit 80fc879b6d00d913348c7b1a42a6eaf4e1006972

Authored by ailsoncgt
1 parent 2530088b

Side bar in edit profile #52

Showing 1 changed file with 55 additions and 46 deletions   Show diff stats
users/templates/users/edit_profile.html
... ... @@ -11,17 +11,6 @@
11 11  
12 12 {% endblock %}
13 13  
14   -{% block sidebar %}
15   - <div class="list-group">
16   - <a href="{% url 'users:profile' %}" class="list-group-item">
17   - {% trans 'Profile' %}
18   - </a>
19   - <a href="{% url 'users:edit_profile' user.id %}" class="list-group-item active">
20   - {% trans 'Edit Profile' %}
21   - </a>
22   - </div>
23   -{% endblock %}
24   -
25 14 {% block content %}
26 15 {% if messages %}
27 16 {% for message in messages %}
... ... @@ -33,42 +22,62 @@
33 22 </div>
34 23 {% endfor %}
35 24 {% endif %}
36   -
37   - <form method="post" action="" enctype="multipart/form-data">
38   - {% csrf_token %}
39   - {% for field in form %}
40   - <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput">
41   - <label for="{{ field.auto_id }}">{{ field.label }}</label>
42   - {% if field.auto_id == 'id_image' %}
43   - {% render_field field class='form-control input-sm' %}
44   - <div class="input-group">
45   - <input type="text" readonly="" class="form-control" placeholder="Choose your photo...">
46   - <span class="input-group-btn input-group-sm">
47   - <button type="button" class="btn btn-fab btn-fab-mini">
48   - <i class="material-icons">attach_file</i>
49   - </button>
50   - </span>
51   - </div>
52   - {% else %}
53   - {% render_field field class='form-control input-sm' %}
54   - {% endif %}
55   - <span id="helpBlock" class="help-block">{{ field.help_text }}</span>
56   - {% if field.errors.length > 0 %}
57   - <div class="alert alert-danger alert-dismissible" role="alert">
58   - <button type="button" class="close" data-dismiss="alert" aria-label="Close">
59   - <span aria-hidden="true">&times;</span>
60   - </button>
61   - <ul>
62   - {% for error in field.errors %}
63   - <li>{{ error }}</li>
64   - {% endfor %}
65   - </ul>
  25 + <div class="card">
  26 + <div class="card-content">
  27 + <div class="card-body">
  28 + <form method="post" action="" enctype="multipart/form-data">
  29 + {% csrf_token %}
  30 + {% for field in form %}
  31 + <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput">
  32 + <label for="{{ field.auto_id }}">{{ field.label }}</label>
  33 + {% if field.auto_id == 'id_birth_date' %}
  34 + {% render_field field class='form-control input-sm' type='date' %}
  35 + <span id="helpBlock" class="help-block">{{ field.help_text }}</span>
  36 + {% elif field.auto_id == 'id_image' %}
  37 + {% render_field field class='form-control input-sm' %}
  38 + <div class="input-group">
  39 + <input type="text" readonly="" class="form-control" placeholder="{% trans 'Choose your photo...' %}">
  40 + <span class="input-group-btn input-group-sm">
  41 + <button type="button" class="btn btn-fab btn-fab-mini">
  42 + <i class="material-icons">attach_file</i>
  43 + </button>
  44 + </span>
  45 + </div>
  46 + {% elif field.auto_id == 'id_is_staff' or field.auto_id == 'id_is_active' %}
  47 + <div class="checkbox">
  48 + <label>
  49 + {% render_field field type='checkbox' %}
  50 + </label>
  51 + </div>
  52 + {% else %}
  53 + {% render_field field class='form-control input-sm' %}
  54 + <span id="helpBlock" class="help-block">{{ field.help_text }}</span>
  55 + {% endif %}
  56 + {% if field.errors.length > 0 %}
  57 + <div class="alert alert-danger alert-dismissible" role="alert">
  58 + <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  59 + <span aria-hidden="true">&times;</span>
  60 + </button>
  61 + <ul>
  62 + {% for error in field.errors %}
  63 + <li>{{ error }}</li>
  64 + {% endfor %}
  65 + </ul>
  66 + </div>
  67 + </div>
  68 + {% endif %}
  69 + </div>
  70 + {% endfor %}
  71 + <div class="col-md-offset-2 col-md-2 col-sm-2 col-xs-2">
  72 + <input type="submit" value="{% trans 'Save' %}" class="btn btn-sm btn-success" />
66 73 </div>
67   - </div>
68   - {% endif %}
  74 + <div class="col-md-offset-3 col-md-2 col-sm-2 col-xs-2">
  75 + <a href="{% url 'users:manage' %}" class="btn btn-sm btn-success" >{% trans 'Cancel' %}</a>
  76 + </div>
  77 + </form>
69 78 </div>
70   - {% endfor %}
71   - <input type="submit" value="{% trans 'Save' %}" class="btn btn-sm btn-success" />
72   - </form>
  79 + </div>
  80 + </div>
  81 +
73 82 <br clear="all" />
74 83 {% endblock %}
... ...