# HG changeset patch # User Brian Neal # Date 1468377069 18000 # Node ID d613d25a021e65664b8527947fc8e1c85681ce21 # Parent 6dd1f0065859ec925a6fdf2b8438ee339690df4e Convert login, logout, and lost username views to V3 design. diff -r 6dd1f0065859 -r d613d25a021e accounts/urls.py --- a/accounts/urls.py Tue Jul 12 20:44:20 2016 -0500 +++ b/accounts/urls.py Tue Jul 12 21:31:09 2016 -0500 @@ -20,11 +20,17 @@ urlpatterns += [ url(r'^login/$', auth_views.login, - kwargs={'template_name': 'accounts/login.html'}, + kwargs={ + 'template_name': 'accounts/login.html', + 'extra_context': {'V3_DESIGN': True}, + }, name='accounts-login'), url(r'^logout/$', auth_views.logout, - kwargs={'template_name': 'accounts/logout.html'}, + kwargs={ + 'template_name': 'accounts/logout.html', + 'extra_context': {'V3_DESIGN': True}, + }, name='accounts-logout'), url(r'^password/$', auth_views.password_change, @@ -56,6 +62,6 @@ accounts.views.username_query, name='accounts-username_query'), url(r'^username/sent/$', - TemplateView.as_view(template_name='accounts/username_sent.html'), + accounts.views.UsernameSentView.as_view(), name='accounts-username_sent'), ] diff -r 6dd1f0065859 -r d613d25a021e accounts/views.py --- a/accounts/views.py Tue Jul 12 20:44:20 2016 -0500 +++ b/accounts/views.py Tue Jul 12 21:31:09 2016 -0500 @@ -8,6 +8,7 @@ from django.http import HttpResponse from django.shortcuts import render, redirect from django.conf import settings +from django.views.generic import TemplateView from accounts.models import PendingUser from accounts.forms import RegisterForm @@ -143,4 +144,16 @@ else: form = ForgotUsernameForm() - return render(request, 'accounts/username_query.html', {'form': form}) + return render(request, 'accounts/username_query.html', { + 'form': form, + 'V3_DESIGN': True, + }) + + +class UsernameSentView(TemplateView): + template_name = 'accounts/username_sent.html' + + def get_context_data(self, **kwargs): + context = super(UsernameSentView, self).get_context_data(**kwargs) + context['V3_DESIGN'] = True + return context diff -r 6dd1f0065859 -r d613d25a021e sg101/templates/accounts/login.html --- a/sg101/templates/accounts/login.html Tue Jul 12 20:44:20 2016 -0500 +++ b/sg101/templates/accounts/login.html Tue Jul 12 21:31:09 2016 -0500 @@ -1,21 +1,46 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}Login{% endblock %} {% block content %}

Login

{% csrf_token %} - -{{ form.as_table }} - -
 
- + {{ form.non_field_errors }} + {{ form.username.errors }} +
+
+ +
+
+ {{ form.password.errors }} +
+
+ +
+
+ +
- +
+
+
+
    +
  • Forgot your username? You can recover it + here.
  • +
  • Forgot your password? You can reset it + here.
  • +
  • Don't have an account? Why don't you + register?
  • +
  • Having problems? Please + contact us. +
  • +
+
+
+
{% endblock %} diff -r 6dd1f0065859 -r d613d25a021e sg101/templates/accounts/logout.html --- a/sg101/templates/accounts/logout.html Tue Jul 12 20:44:20 2016 -0500 +++ b/sg101/templates/accounts/logout.html Tue Jul 12 21:31:09 2016 -0500 @@ -1,7 +1,14 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}Logged Out{% endblock %} {% block content %}

Logged Out

-

You are now logged out of SurfGuitar101.com. Thanks for spending some quality time with us today. Tell all your -friends about us and we hope we see you soon!

+
+ You are now logged out of SurfGuitar101.com. Thanks for spending some + quality time with us today. Tell all your friends about us and we hope + we see you soon! +
+

+ I need more surf music, I want to login again. +

{% endblock %} diff -r 6dd1f0065859 -r d613d25a021e sg101/templates/accounts/register_failure.html --- a/sg101/templates/accounts/register_failure.html Tue Jul 12 20:44:20 2016 -0500 +++ b/sg101/templates/accounts/register_failure.html Tue Jul 12 21:31:09 2016 -0500 @@ -3,7 +3,7 @@ {% block content %}

Registration Error

- We're sorry, we don't have any registration information available for the + We're sorry, we don't have any registration information available for the user {{ username }}. Registration information is only good for 24 hours, and it may have expired. If you think this may have happened, please register again. diff -r 6dd1f0065859 -r d613d25a021e sg101/templates/accounts/username_query.html --- a/sg101/templates/accounts/username_query.html Tue Jul 12 20:44:20 2016 -0500 +++ b/sg101/templates/accounts/username_query.html Tue Jul 12 21:31:09 2016 -0500 @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}Forgotten Username{% endblock %} {% block content %}

Forgotten Username

@@ -7,7 +7,19 @@ register with the site below and we'll send your username to you.

{% csrf_token %} - {{ form.as_p }} -

+ {{ form.non_field_errors }} + {{ form.email.errors }} +
+
+ +
+
+
+

+ Can't remember what email address you used, or maybe it is no longer valid? + Please contact us. +

{% endblock %} diff -r 6dd1f0065859 -r d613d25a021e sg101/templates/accounts/username_sent.html --- a/sg101/templates/accounts/username_sent.html Tue Jul 12 20:44:20 2016 -0500 +++ b/sg101/templates/accounts/username_sent.html Tue Jul 12 21:31:09 2016 -0500 @@ -1,9 +1,12 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}Username Sent{% endblock %} {% block content %}

Username Sent

+
+ Thank you. We have emailed the username to the email address you + provided. If the message doesn't arrive, please check your spam folders. +

-Thank you. We have emailed the associated username to the email address you -provided. + Login

{% endblock %}