Added password reset
This commit is contained in:
parent
6cdf84b71c
commit
504773e01e
|
@ -40,7 +40,9 @@
|
|||
border-style: solid;
|
||||
border-color: #eeeeee;
|
||||
border-radius: 3px;
|
||||
background-color: #eee; }
|
||||
background-color: #eee;
|
||||
padding-top: 4px;
|
||||
padding-left: 4px; }
|
||||
.textcontainer .uploads-list {
|
||||
list-style: none; }
|
||||
.textcontainer .uploads-list a {
|
||||
|
@ -53,6 +55,9 @@
|
|||
color: #e9322d; }
|
||||
.textcontainer .pure-form .browsebutton {
|
||||
font-size: 85%; }
|
||||
.textcontainer .resetlink {
|
||||
font-size: 75%;
|
||||
text-decoration: none; }
|
||||
|
||||
.button-green {
|
||||
background-color: #1CB841;
|
||||
|
|
|
@ -53,6 +53,10 @@
|
|||
@include gridcontainer;
|
||||
@include roundconers(#eee,6px);
|
||||
background-color: #eee;
|
||||
padding:{
|
||||
top: 4px;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
.uploads-list {
|
||||
list-style: none;
|
||||
|
@ -77,6 +81,11 @@
|
|||
font-size: 85%;
|
||||
}
|
||||
}
|
||||
|
||||
.resetlink {
|
||||
font-size: 75%;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -21,10 +21,11 @@
|
|||
<div class="pure-u-2-3">
|
||||
<div class="textcontainer">
|
||||
{% if user.is_authenticated %}
|
||||
You are already logged in !<br/>
|
||||
Did you mean: <a href="{% url 'logout' %}">logout</a> ?
|
||||
You are already logged in !<br/>
|
||||
Did you mean: <a href="{% url 'logout' %}">logout</a> ?
|
||||
{% else %}
|
||||
{% include 'form.html' with button_text='Login' %}
|
||||
{% include 'form.html' with button_text='Login' %}<br/>
|
||||
<a href="{% url 'password_reset' %}" class="resetlink">Oh well, I fogot my password ...</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
|
||||
{% block title %} Reset password {% endblock %}
|
||||
|
||||
|
||||
{% block headeraddons %}
|
||||
<script src="{{STATIC_URL}}js/jquery-1.10.2.min.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div id="content">
|
||||
<div id="prompt">
|
||||
<!-- if IE without GCF, prompt goes here -->
|
||||
</div>
|
||||
|
||||
<h1>Reset password</h1>
|
||||
<div class="pure-g-r">
|
||||
<div class="pure-u-2-3">
|
||||
<div class="textcontainer">
|
||||
{% if user.is_authenticated %}
|
||||
You are already logged in !<br/>
|
||||
Why would you want to reset your password if you still can log in ?<br/>
|
||||
Please <a href="{% url 'logout' %}">log out</a> first.</br>
|
||||
{% else %}
|
||||
Please provide email address you signed up with.<br/>
|
||||
</br>
|
||||
{% include 'form.html' with button_text='Reset' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="pure-u-1-3">
|
||||
{% include 'pastebin/latest_geometries.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -0,0 +1,39 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
|
||||
{% block title %} Login {% endblock %}
|
||||
|
||||
|
||||
{% block headeraddons %}
|
||||
<script src="{{STATIC_URL}}js/jquery-1.10.2.min.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div id="content">
|
||||
<div id="prompt">
|
||||
<!-- if IE without GCF, prompt goes here -->
|
||||
</div>
|
||||
|
||||
<h1>Reset password</h1>
|
||||
<div class="pure-g-r">
|
||||
<div class="pure-u-2-3">
|
||||
<div class="textcontainer">
|
||||
{% if user.is_authenticated %}
|
||||
You are already logged in !<br/>
|
||||
Why would you want to reset your password if you still can log in ?<br/>
|
||||
Please <a href="{% url 'logout' %}">log out</a> first.</br>
|
||||
{% else %}
|
||||
Please set a new password.<br/>
|
||||
</br>
|
||||
{% include 'form.html' with button_text='Reset' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="pure-u-1-3">
|
||||
{% include 'pastebin/latest_geometries.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -0,0 +1,34 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
|
||||
{% block title %} Password reset email sent {% endblock %}
|
||||
|
||||
|
||||
{% block headeraddons %}
|
||||
<script src="{{STATIC_URL}}js/jquery-1.10.2.min.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div id="content">
|
||||
<div id="prompt">
|
||||
<!-- if IE without GCF, prompt goes here -->
|
||||
</div>
|
||||
|
||||
<h1>Reset email sent </h1>
|
||||
<div class="pure-g-r">
|
||||
<div class="pure-u-2-3">
|
||||
<div class="textcontainer">
|
||||
You should have received an email containg password reset link.
|
||||
<br/>
|
||||
<br/>
|
||||
<a class="pure-button button-green" href="/todo/">Okay</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pure-u-1-3">
|
||||
{% include 'pastebin/latest_geometries.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -3,7 +3,7 @@ from django.core.urlresolvers import reverse_lazy
|
|||
|
||||
from pastebin.models import Geometry
|
||||
|
||||
from views import UserCreateView, UserUpdateView, SendConfirmationView, CheckConfirmationView
|
||||
from views import *
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^signup/$', UserCreateView.as_view(), name='signup'),
|
||||
|
@ -12,12 +12,26 @@ urlpatterns = patterns('',
|
|||
|
||||
url(r'^update/(?P<user_id>\d+)/$', UserUpdateView.as_view(), name='user_update'),
|
||||
|
||||
url(r'^password/reset/$', 'django.contrib.auth.views.password_reset', {'extra_context' : {'latest_geometries' : Geometry.get_latest()},
|
||||
'template_name' : 'users/password_reset.html',
|
||||
'post_reset_redirect' : reverse_lazy('password_reset_sent')},
|
||||
name='password_reset'),
|
||||
|
||||
url(r'^password/reset/(?P<uidb36>[0-9A-Za-z]+)/(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm', {'extra_context' : {'latest_geometries' : Geometry.get_latest()},
|
||||
'template_name' : 'users/password_reset_confirm.html',
|
||||
'post_reset_redirect' : reverse_lazy('login')},
|
||||
name='password_reset_confirm'),
|
||||
|
||||
url(r'^password/reset/sent/$', 'django.contrib.auth.views.password_reset_done', {'extra_context' : {'latest_geometries' : Geometry.get_latest()},
|
||||
'template_name' : 'users/password_reset_sent.html',},
|
||||
name='password_reset_sent'),
|
||||
|
||||
|
||||
url(r'^login/$', 'django.contrib.auth.views.login', {'extra_context' : {'latest_geometries' : Geometry.get_latest()},
|
||||
'template_name' : 'users/login.html'},
|
||||
name='login'),
|
||||
|
||||
url(r'^logout/$', 'django.contrib.auth.views.logout',{'extra_context' : {'latest_geometries' : Geometry.get_latest()},
|
||||
'next_page' : reverse_lazy('login')},
|
||||
name='logout'),
|
||||
|
||||
|
||||
)
|
|
@ -101,4 +101,4 @@ class CheckConfirmationView(TemplateView, LastesGeometriesMixin):
|
|||
|
||||
print "Acitvating %s" % user.username
|
||||
|
||||
return super(CheckConfirmationView,self).get(self, request, *args, **kwargs)
|
||||
return super(CheckConfirmationView,self).get(self, request, *args, **kwargs)
|
||||
|
|
Loading…
Reference in New Issue