Commit b9c94c49379abef42051e96e3605d5694f3f5d99
1 parent
84522ed1
Exists in
master
and in
5 other branches
create remove account
Showing
4 changed files
with
50 additions
and
1 deletions
Show diff stats
users/templates/users/profile.html
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | <li><a href="{% url 'users:profile' %}">{% trans 'View Profile' %}</a></li> | 22 | <li><a href="{% url 'users:profile' %}">{% trans 'View Profile' %}</a></li> |
23 | <li><a href="{% url 'users:update_profile' %}">{% trans 'Edit Profile' %}</a></li> | 23 | <li><a href="{% url 'users:update_profile' %}">{% trans 'Edit Profile' %}</a></li> |
24 | <li><a href="{% url 'users:change_password' %}">{% trans 'Change Password' %}</a></li> | 24 | <li><a href="{% url 'users:change_password' %}">{% trans 'Change Password' %}</a></li> |
25 | - <li><a href="#">{% trans 'Remove account' %}</a></li> | 25 | + <li><a href="{% url 'users:remove_account' %}">{% trans 'Remove account' %}</a></li> |
26 | </ul> | 26 | </ul> |
27 | </div> | 27 | </div> |
28 | </div> | 28 | </div> |
@@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
1 | +{% extends 'users/profile.html' %} | ||
2 | + | ||
3 | +{% load static i18n %} | ||
4 | +{% load widget_tweaks %} | ||
5 | +{% load django_bootstrap_breadcrumbs %} | ||
6 | + | ||
7 | +{% block breadcrumbs %} | ||
8 | + | ||
9 | + {{ block.super }} | ||
10 | + {% breadcrumb 'Edit' 'users:update_profile' %} | ||
11 | + | ||
12 | +{% endblock %} | ||
13 | + | ||
14 | +{% block content %} | ||
15 | + {% if messages %} | ||
16 | + {% for message in messages %} | ||
17 | + <div class="alert alert-success alert-dismissible" role="alert"> | ||
18 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
19 | + <span aria-hidden="true">×</span> | ||
20 | + </button> | ||
21 | + <p>{{ message }}</p> | ||
22 | + </div> | ||
23 | + {% endfor %} | ||
24 | + {% endif %} | ||
25 | + <div class="row"> | ||
26 | + <div class="col-md-12"> | ||
27 | + <div class="well well-lg"> | ||
28 | + <h2>Voce tem certeza que deseja remover esta conta?</h2> | ||
29 | + <p>Todos os seus dados serão removidos e não haverá como recupera-los posteriormente.</p> | ||
30 | + <div class="row"> | ||
31 | + <div class="col-md-3 col-sm-2 col-xs-2"> | ||
32 | + <a href="#" class="btn btn-raised btn-block btn-success" >{% trans 'Remove' %}</a> | ||
33 | + </div> | ||
34 | + <div class="col-md-3 col-sm-2 col-xs-2"> | ||
35 | + <a href="{% url 'users:profile' %}" class="btn btn-raised btn-block btn-danger" >{% trans 'Cancel' %}</a> | ||
36 | + </div> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | + </div> | ||
40 | + </div> | ||
41 | + | ||
42 | + | ||
43 | + <br clear="all" /> | ||
44 | +{% endblock %} |
users/urls.py
@@ -12,5 +12,6 @@ urlpatterns = [ | @@ -12,5 +12,6 @@ urlpatterns = [ | ||
12 | # | 12 | # |
13 | url(r'^profile/update/$', views.UpdateProfile.as_view(), name='update_profile'), | 13 | url(r'^profile/update/$', views.UpdateProfile.as_view(), name='update_profile'), |
14 | url(r'^profile/change_password/$', views.Change_password.as_view(), name='change_password'), | 14 | url(r'^profile/change_password/$', views.Change_password.as_view(), name='change_password'), |
15 | + url(r'^profile/remove_account/$', views.Remove_account.as_view(), name='remove_account'), | ||
15 | url(r'^profile/delete/$', views.DeleteUser.as_view(), name='delete_profile'), | 16 | url(r'^profile/delete/$', views.DeleteUser.as_view(), name='delete_profile'), |
16 | ] | 17 | ] |
users/views.py
@@ -105,6 +105,10 @@ def delete(request,username): | @@ -105,6 +105,10 @@ def delete(request,username): | ||
105 | class Change_password(generic.TemplateView): | 105 | class Change_password(generic.TemplateView): |
106 | template_name = 'users/change_password.html' | 106 | template_name = 'users/change_password.html' |
107 | 107 | ||
108 | +class Remove_account(generic.TemplateView): | ||
109 | + template_name = 'users/remove_account.html' | ||
110 | + | ||
111 | + | ||
108 | class UpdateProfile(LoginRequiredMixin, generic.edit.UpdateView): | 112 | class UpdateProfile(LoginRequiredMixin, generic.edit.UpdateView): |
109 | 113 | ||
110 | allowed_roles = ['student'] | 114 | allowed_roles = ['student'] |