Commit 31836b59799f3b6fc380b17279c137b4434108a6
1 parent
ddfbb5fc
Exists in
master
and in
5 other branches
Adding breadcrumbs to edit profile template and fix error #25 #7
Showing
1 changed file
with
20 additions
and
7 deletions
Show diff stats
users/templates/users/edit_profile.html
1 | -{% extends 'app/base.html' %} | 1 | +{% extends 'users/profile.html' %} |
2 | 2 | ||
3 | {% load static i18n %} | 3 | {% load static i18n %} |
4 | {% load widget_tweaks %} | 4 | {% load widget_tweaks %} |
5 | +{% load django_bootstrap_breadcrumbs %} | ||
5 | 6 | ||
6 | {% block breadcrumbs %} | 7 | {% block breadcrumbs %} |
7 | - <ol class="breadcrumb"> | ||
8 | - <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li> | ||
9 | - <li class="active">{% trans 'Edit Profile' %}</li> | ||
10 | - </ol> | 8 | + |
9 | + {{ block.super }} | ||
10 | + {% breadcrumb 'Edit' 'users:update_profile' %} | ||
11 | + | ||
11 | {% endblock %} | 12 | {% endblock %} |
12 | 13 | ||
13 | {% block sidebar %} | 14 | {% block sidebar %} |
@@ -36,9 +37,21 @@ | @@ -36,9 +37,21 @@ | ||
36 | <form method="post" action="" enctype="multipart/form-data"> | 37 | <form method="post" action="" enctype="multipart/form-data"> |
37 | {% csrf_token %} | 38 | {% csrf_token %} |
38 | {% for field in form %} | 39 | {% for field in form %} |
39 | - <div class="form-group{% if form.has_error %} has-error {% endif %}"> | 40 | + <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> |
40 | <label for="{{ field.auto_id }}">{{ field.label }}</label> | 41 | <label for="{{ field.auto_id }}">{{ field.label }}</label> |
41 | - {% render_field field class='form-control input-sm' %} | 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 %} | ||
42 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | 55 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> |
43 | {% if field.errors.length > 0 %} | 56 | {% if field.errors.length > 0 %} |
44 | <div class="alert alert-danger alert-dismissible" role="alert"> | 57 | <div class="alert alert-danger alert-dismissible" role="alert"> |