# HG changeset patch # User Brian Neal # Date 1468374260 18000 # Node ID 6dd1f0065859ec925a6fdf2b8438ee339690df4e # Parent f27986c11ddfbe1ea378b824607fb22309424754 Convert registration views to V3 design. diff -r f27986c11ddf -r 6dd1f0065859 accounts/views.py --- a/accounts/views.py Tue Jul 12 19:38:54 2016 -0500 +++ b/accounts/views.py Tue Jul 12 20:44:20 2016 -0500 @@ -34,7 +34,10 @@ else: form = RegisterForm() - return render(request, 'accounts/register.html', {'form': form}) + return render(request, 'accounts/register.html', { + 'form': form, + 'V3_DESIGN': True, + }) ####################################################################### @@ -43,7 +46,9 @@ if request.user.is_authenticated(): return redirect(settings.LOGIN_REDIRECT_URL) - return render(request, 'accounts/register1.html') + return render(request, 'accounts/register1.html', { + 'V3_DESIGN': True, + }) ####################################################################### @@ -63,7 +68,10 @@ else: form = RegisterCodeForm() - return render(request, 'accounts/register2.html', {'form': form}) + return render(request, 'accounts/register2.html', { + 'form': form, + 'V3_DESIGN': True, + }) ####################################################################### @@ -81,7 +89,9 @@ if request.user.is_authenticated(): return redirect(settings.LOGIN_REDIRECT_URL) - return render(request, 'accounts/register_thanks.html') + return render(request, 'accounts/register_thanks.html', { + 'V3_DESIGN': True, + }) ####################################################################### @@ -97,22 +107,26 @@ try: pending_user = PendingUser.objects.get(username = username) except PendingUser.DoesNotExist: - logger.error('Accounts register_confirm [%s]: user does not exist: %s', ip, username) - return render(request, - 'accounts/register_failure.html', - {'username': username}) + logger.error('Accounts register_confirm [%s]: user does not exist: %s', + ip, username) + return render(request, 'accounts/register_failure.html', { + 'username': username, + 'V3_DESIGN': True, + }) if pending_user.key != key: logger.error('Accounts register_confirm [%s]: key error: %s', ip, username) - return render(request, - 'accounts/register_failure.html', - {'username': username}) + return render(request, 'accounts/register_failure.html', { + 'username': username, + 'V3_DESIGN': True, + }) create_new_user(pending_user, ip) - return render(request, - 'accounts/register_success.html', - {'username': username}) + return render(request, 'accounts/register_success.html', { + 'username': username, + 'V3_DESIGN': True, + }) ####################################################################### diff -r f27986c11ddf -r 6dd1f0065859 sg101/templates/accounts/register.html --- a/sg101/templates/accounts/register.html Tue Jul 12 19:38:54 2016 -0500 +++ b/sg101/templates/accounts/register.html Tue Jul 12 20:44:20 2016 -0500 @@ -1,9 +1,10 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}New User Registration{% endblock %} {% block content %}

New User Registration

Thank you for your interest in become a member of our community. Please keep the following in mind when registering for your account here:

+
-
+
+
We are really sorry about all the crazy questions in the registration form. We are forced to do this to reduce the number of automated registrations by spammers. Hopefully this will be a small inconvenience for you and you will @@ -22,9 +24,76 @@ this...
{% csrf_token %} - - {{ form.as_table }} - -
 
+ {{ form.non_field_errors }} + {{ form.username.errors }} +
+
+ +
+
+ {{ form.email.errors }} +
+
+ +
+
+ {{ form.password1.errors }} +
+
+ +
+
+ {{ form.password2.errors }} +
+
+ +
+
+ {{ form.agree_age.errors }} + {{ form.agree_tos.errors }} + {{ form.agree_privacy.errors }} +
+
+ {{ form.agree_age }} + {{ form.agree_tos }} + {{ form.agree_privacy }} +
+
+ {{ form.question1.errors }} +
+
+ +
+
+ {{ form.question2.errors }} +
+
+ +
+
+ {{ form.question3.errors }} +
+
+ +
+
+
+ +
{% endblock %} diff -r f27986c11ddf -r 6dd1f0065859 sg101/templates/accounts/register1.html --- a/sg101/templates/accounts/register1.html Tue Jul 12 19:38:54 2016 -0500 +++ b/sg101/templates/accounts/register1.html Tue Jul 12 20:44:20 2016 -0500 @@ -1,11 +1,8 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% load static from staticfiles %} -{% block custom_js %} - -{% endblock %} {% block title %}New User Registration Step 2{% endblock %} {% block content %} -

New User Registration Step 2

+

New User Registration Step 2

Thank you! You are almost finished with your registration! Just one more step.

@@ -13,16 +10,22 @@ Please remember or write down the following code as we will ask you to type it on the next page.

-

- - Please wait for the registration code to appear... - -

+
+

+ Please wait for the registration code to appear... +

+

Got the code memorized or written down? Go to the next page and enter it.

- +
+ +
{% endblock %} +{% block custom_js %} + +{% endblock %} diff -r f27986c11ddf -r 6dd1f0065859 sg101/templates/accounts/register2.html --- a/sg101/templates/accounts/register2.html Tue Jul 12 19:38:54 2016 -0500 +++ b/sg101/templates/accounts/register2.html Tue Jul 12 20:44:20 2016 -0500 @@ -1,14 +1,20 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}New User Registration Final Step{% endblock %} {% block content %} -

New User Registration Final Step

+

New User Registration Final Step

Please enter the registration code you received in the previous step.

{% csrf_token %} - - {{ form.as_table }} - -
 
+ {{ form.non_field_errors }} + {{ form.code.errors }} +
+
+ +
+
+
{% endblock %} diff -r f27986c11ddf -r 6dd1f0065859 sg101/templates/accounts/register_failure.html --- a/sg101/templates/accounts/register_failure.html Tue Jul 12 19:38:54 2016 -0500 +++ b/sg101/templates/accounts/register_failure.html Tue Jul 12 20:44:20 2016 -0500 @@ -1,9 +1,16 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}Registration Error{% endblock %} {% block content %}

Registration Error

-

We're sorry, but 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. Sorry for the inconvenience.

-

If you keep seeing this message, please contact the site staff for assistance.

+
+ 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. +
+

+ If you continue to have problems, please + contact + the site staff for assistance. +

{% endblock %} diff -r f27986c11ddf -r 6dd1f0065859 sg101/templates/accounts/register_success.html --- a/sg101/templates/accounts/register_success.html Tue Jul 12 19:38:54 2016 -0500 +++ b/sg101/templates/accounts/register_success.html Tue Jul 12 20:44:20 2016 -0500 @@ -1,8 +1,20 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}Registration Confirmed{% endblock %} {% block content %} -

Congratulations, Your Account Has Been Created

-

Your registration of the user {{ username }} has been successful. Welcome to the site!

-

Please proceed to the login page to log into the site -with your username {{ username }} and the password you registered with.

+

Account Created

+
+ + Welcome to SurfGuitar101.com {{ username }}! + Your account was successfully created. +
+

+ Please proceed to the + login page and sign + in with your username {{ username }} and the + password you registered with. +

+

+ Login Now +

{% endblock %} diff -r f27986c11ddf -r 6dd1f0065859 sg101/templates/accounts/register_thanks.html --- a/sg101/templates/accounts/register_thanks.html Tue Jul 12 19:38:54 2016 -0500 +++ b/sg101/templates/accounts/register_thanks.html Tue Jul 12 20:44:20 2016 -0500 @@ -1,8 +1,15 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}Registration Complete{% endblock %} {% block content %}

Thanks for Registering!

-

A confirmation email has just been sent to the email address you provided. To complete -the registration process, please follow the instructions in the confirmation email.

-

If you do not receive the email, please check any spam folders.

+
+ + A confirmation email has just been sent to the email address you provided. + To complete the registration process, please follow the instructions in the + confirmation email. +
+
+ + If you do not receive the email, please check any spam folders. +
{% endblock %}