diff --git a/pastebin/templates/pastebin/geometry_create.html b/pastebin/templates/pastebin/geometry_create.html index bdd870e..42fb355 100644 --- a/pastebin/templates/pastebin/geometry_create.html +++ b/pastebin/templates/pastebin/geometry_create.html @@ -37,37 +37,11 @@ $(document).ready(function() {
-
- {% csrf_token %} -
- {% for field in form %} -
- {{ field.label_tag }} - {{ field }} - {{ field.errors }} -
- {% endfor %} -
- - -
-
-
+ {% include 'form.html' with button_text='upload' form_enctype='multipart/form-data' %}
-
-

Latest uploads

-
    - {% for geometry in latest_geometries %} -
  • - - {{geometry.name}} - - {{geometry.date}} -
  • - {% endfor %} -
-
+ {% include 'pastebin/latest_geometries.html' %}
diff --git a/pastebin/templates/pastebin/latest_geometries.html b/pastebin/templates/pastebin/latest_geometries.html new file mode 100644 index 0000000..adfa660 --- /dev/null +++ b/pastebin/templates/pastebin/latest_geometries.html @@ -0,0 +1,12 @@ +
+

Latest uploads

+ +
\ No newline at end of file diff --git a/templates/base.html b/templates/base.html index dd21dd3..4540b8f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -34,6 +34,5 @@ {% block content %} {% endblock %} - \ No newline at end of file diff --git a/templates/form.html b/templates/form.html new file mode 100644 index 0000000..e6cd3f1 --- /dev/null +++ b/templates/form.html @@ -0,0 +1,17 @@ +
+ {% csrf_token %} +
+ {% for field in form %} +
+ {{ field.label_tag }} + {{ field }} + {{ field.errors }} +
+ {% endfor %} +
+ + +
+
+
\ No newline at end of file diff --git a/users/templates/users/check_confirmation.html b/users/templates/users/check_confirmation.html index e20614d..81d86c0 100644 --- a/users/templates/users/check_confirmation.html +++ b/users/templates/users/check_confirmation.html @@ -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 @@
-
-

Latest uploads

- -
+ {% include 'pastebin/latest_geometries.html' %}
diff --git a/users/templates/users/login.html b/users/templates/users/login.html index 5bae0f9..965e703 100644 --- a/users/templates/users/login.html +++ b/users/templates/users/login.html @@ -24,38 +24,12 @@ You are already logged in !
Did you mean: logout ? {% else %} -
- {% csrf_token %} -
- {% for field in form %} -
- {{ field.label_tag }} - {{ field }} - {{ field.errors }} -
- {% endfor %} -
- - -
-
-
+ {% include 'form.html' with button_text='Login' %} {% endif %}
-
-

Latest uploads

- -
+ {% include 'pastebin/latest_geometries.html' %}
diff --git a/users/templates/users/password_change.html b/users/templates/users/password_change.html new file mode 100644 index 0000000..ff86df9 --- /dev/null +++ b/users/templates/users/password_change.html @@ -0,0 +1,31 @@ +{% extends "base.html" %} + + +{% block title %} Change your password {% endblock %} + + +{% block headeraddons %} + + +{% endblock %} + + +{% block content %} +
+
+ +
+ +

Change password

+
+
+
+ {% include 'form.html' with button_text='change' %} +
+
+
+ {% include 'pastebin/latest_geometries.html' %} +
+
+
+{% endblock %} \ No newline at end of file diff --git a/users/templates/users/send_confirmation.html b/users/templates/users/send_confirmation.html index cf73e3e..ebf2a01 100644 --- a/users/templates/users/send_confirmation.html +++ b/users/templates/users/send_confirmation.html @@ -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 @@
-
-

Latest uploads

- -
+ {% include 'pastebin/latest_geometries.html' %}
diff --git a/users/templates/users/signup.html b/users/templates/users/signup.html index 883b8d0..6b5a73d 100644 --- a/users/templates/users/signup.html +++ b/users/templates/users/signup.html @@ -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 %} -
- {% csrf_token %} -
- {% for field in form %} -
- {{ field.label_tag }} - {{ field }} - {{ field.errors }} -
- {% endfor %} -
- - -
-
-
+ {% include 'form.html' with button_text='sign up' %} {% endif %}
-
-

Latest uploads

- -
+ {% include 'pastebin/latest_geometries.html' %}
diff --git a/users/templates/users/validate_email.txt b/users/templates/users/validate_email.txt deleted file mode 100644 index 0335d10..0000000 --- a/users/templates/users/validate_email.txt +++ /dev/null @@ -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 ! \ No newline at end of file diff --git a/users/urls.py b/users/urls.py index 9ed20d0..226883b 100644 --- a/users/urls.py +++ b/users/urls.py @@ -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'),) \ No newline at end of file + 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'), + ) \ No newline at end of file