Added password change

Cleaned up templates
This commit is contained in:
Sebastian 2013-11-03 15:56:26 +01:00
parent 457d95ec64
commit 93fe541717
11 changed files with 78 additions and 120 deletions

View File

@ -37,37 +37,11 @@ $(document).ready(function() {
<div class="pure-g-r">
<div class="pure-u-2-3">
<div class="textcontainer">
<form enctype="multipart/form-data" method="post" class="pure-form pure-form-aligned">
{% csrf_token %}
<fieldset>
{% for field in form %}
<div class="pure-control-group">
{{ field.label_tag }}
{{ field }}
{{ field.errors }}
</div>
{% endfor %}
<div class="pure-control-group">
<label for="submitbutton" >... and </label>
<input class="pure-button button-green" id="submitbutton" type="submit" value="Upload" />
</div>
</fieldset>
</form>
{% include 'form.html' with button_text='upload' form_enctype='multipart/form-data' %}
</div>
</div>
<div class="pure-u-1-3">
<div class="textcontainer">
<h2><i class="icon-upload-alt"></i> Latest uploads</h2>
<ul class="uploads-list">
{% for geometry in latest_geometries %}
<li>
<i class="icon-file"></i>
<a href="{{geometry.get_absolute_url}}">{{geometry.name}}</a>
- {{geometry.date}}
</li>
{% endfor %}
</ul>
</div>
{% include 'pastebin/latest_geometries.html' %}
</div>
</div>
</div>

View File

@ -0,0 +1,12 @@
<div class="textcontainer">
<h2><i class="icon-upload-alt"></i> Latest uploads</h2>
<ul class="uploads-list">
{% for geometry in latest_geometries %}
<li>
<i class="icon-file"></i>
<a href="{{geometry.get_absolute_url}}">{{geometry.name}}</a>
- {{geometry.date}}
</li>
{% endfor %}
</ul>
</div>

View File

@ -34,6 +34,5 @@
{% block content %}
{% endblock %}
</body>
</html>

17
templates/form.html Normal file
View File

@ -0,0 +1,17 @@
<form {% if form_enctype %}enctype="{{form_enctype}}"{% endif %}
method="post" class="pure-form pure-form-aligned">
{% csrf_token %}
<fieldset>
{% for field in form %}
<div class="pure-control-group">
{{ field.label_tag }}
{{ field }}
{{ field.errors }}
</div>
{% endfor %}
<div class="pure-control-group">
<label for="submitbutton" >... and </label>
<input class="pure-button button-green" id="submitbutton" type="submit" value="{{button_text}}" />
</div>
</fieldset>
</form>

View File

@ -1,7 +1,7 @@
{% extends "base.html" %}
{% block title %} New paste {% endblock %}
{% block title %} Checking your confirmation token{% endblock %}
{% block headeraddons %}
@ -25,18 +25,7 @@
</div>
</div>
<div class="pure-u-1-3">
<div class="textcontainer">
<h2><i class="icon-upload-alt"></i> Latest uploads</h2>
<ul class="uploads-list">
{% for geometry in latest_geometries %}
<li>
<i class="icon-file"></i>
<a href="{{geometry.get_absolute_url}}">{{geometry.name}}</a>
- {{geometry.date}}
</li>
{% endfor %}
</ul>
</div>
{% include 'pastebin/latest_geometries.html' %}
</div>
</div>
</div>

View File

@ -24,38 +24,12 @@
You are already logged in !<br/>
Did you mean: <a href="{% url 'logout' %}">logout</a> ?
{% else %}
<form method="post" class="pure-form pure-form-aligned">
{% csrf_token %}
<fieldset>
{% for field in form %}
<div class="pure-control-group">
{{ field.label_tag }}
{{ field }}
{{ field.errors }}
</div>
{% endfor %}
<div class="pure-control-group">
<label for="submitbutton" >... and </label>
<input class="pure-button button-green" id="submitbutton" type="submit" value="Login" />
</div>
</fieldset>
</form>
{% include 'form.html' with button_text='Login' %}
{% endif %}
</div>
</div>
<div class="pure-u-1-3">
<div class="textcontainer">
<h2><i class="icon-upload-alt"></i> Latest uploads</h2>
<ul class="uploads-list">
{% for geometry in latest_geometries %}
<li>
<i class="icon-file"></i>
<a href="{{geometry.get_absolute_url}}">{{geometry.name}}</a>
- {{geometry.date}}
</li>
{% endfor %}
</ul>
</div>
{% include 'pastebin/latest_geometries.html' %}
</div>
</div>
</div>

View File

@ -0,0 +1,31 @@
{% extends "base.html" %}
{% block title %} Change your 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>Change password</h1>
<div class="pure-g-r">
<div class="pure-u-2-3">
<div class="textcontainer">
{% include 'form.html' with button_text='change' %}
</div>
</div>
<div class="pure-u-1-3">
{% include 'pastebin/latest_geometries.html' %}
</div>
</div>
</div>
{% endblock %}

View File

@ -1,7 +1,7 @@
{% extends "base.html" %}
{% block title %} New paste {% endblock %}
{% block title %} Confirm your email address{% endblock %}
{% block headeraddons %}
@ -29,18 +29,7 @@
</div>
</div>
<div class="pure-u-1-3">
<div class="textcontainer">
<h2><i class="icon-upload-alt"></i> Latest uploads</h2>
<ul class="uploads-list">
{% for geometry in latest_geometries %}
<li>
<i class="icon-file"></i>
<a href="{{geometry.get_absolute_url}}">{{geometry.name}}</a>
- {{geometry.date}}
</li>
{% endfor %}
</ul>
</div>
{% include 'pastebin/latest_geometries.html' %}
</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
{% extends "base.html" %}
{% block title %} New paste {% endblock %}
{% block title %} Sign up{% endblock %}
{% block headeraddons %}
@ -22,38 +22,12 @@
{% if user.is_authenticated %}
You are alerady logged in, why in the world would you want to sign up ?
{% else %}
<form method="post" class="pure-form pure-form-aligned">
{% csrf_token %}
<fieldset>
{% for field in form %}
<div class="pure-control-group">
{{ field.label_tag }}
{{ field }}
{{ field.errors }}
</div>
{% endfor %}
<div class="pure-control-group">
<label for="submitbutton" >... and </label>
<input class="pure-button button-green" id="submitbutton" type="submit" value="sign up" />
</div>
</fieldset>
</form>
{% include 'form.html' with button_text='sign up' %}
{% endif %}
</div>
</div>
<div class="pure-u-1-3">
<div class="textcontainer">
<h2><i class="icon-upload-alt"></i> Latest uploads</h2>
<ul class="uploads-list">
{% for geometry in latest_geometries %}
<li>
<i class="icon-file"></i>
<a href="{{geometry.get_absolute_url}}">{{geometry.name}}</a>
- {{geometry.date}}
</li>
{% endfor %}
</ul>
</div>
{% include 'pastebin/latest_geometries.html' %}
</div>
</div>
</div>

View File

@ -1,7 +0,0 @@
Hello {{user.username}},
and thank you for registering an account at {{site_name}}.
To validate your email address and complete the registration you need to visit this link:
{{validation_link}}
Have fun !

View File

@ -15,4 +15,10 @@ urlpatterns = patterns('',
name='login'),
url(r'^logout/$', 'django.contrib.auth.views.logout',{'extra_context' : {'latest_geometries' : Geometry.get_latest()},
'next_page' : reverse_lazy('login')},
name='logout'),)
name='logout'),
url(r'^password/change/$', 'django.contrib.auth.views.password_change',{'extra_context' : {'latest_geometries' : Geometry.get_latest()},
'template_name' : 'users/password_change.html',
'post_change_redirect' : reverse_lazy('login')},
name='password_change'),
)