Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Simplify verification landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Feb 28, 2017
1 parent 8ec4a01 commit 1d6915c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 46 deletions.
2 changes: 1 addition & 1 deletion tests/py/test_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_post_with_looooong_address_is_400(self):

def test_verify_email_without_adding_email(self):
response = self.verify_email('', 'sample-nonce')
assert 'Missing Info' in response.body
assert 'Bad Info' in response.body

def test_verify_email_wrong_nonce(self):
self.hit_email_spt('add-email', '[email protected]')
Expand Down
15 changes: 0 additions & 15 deletions tests/ttw/test_verify_email.py

This file was deleted.

41 changes: 11 additions & 30 deletions www/~/%username/emails/verify.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ if participant == user.participant:
suppress_sidebar = True
[-----------------------------------------------------------------------------]
{% extends "templates/base.html" %}

{% block scripts %}
<script>
$(document).ready(function() {
$('button.resend').on('click', Gratipay.emails.post);
});
</script>
{{ super() }}
{% endblock %}

{% block content %}
{% if user.ANON %}
<h1>{{ _("Please Sign In") }}</h1>
Expand All @@ -58,31 +48,22 @@ suppress_sidebar = True
{% else %}
{% if result == email.VERIFICATION_SUCCEEDED %}
<h1>{{ _("Success!") }}</h1>
<p>{{ _("Your email address {0} is now connected to your Gratipay account.",
("<b>%s</b>"|safe) % email) }}</p>
<p>{{ _( "{email_address} is now connected to your Gratipay account."
, email_address=("<b>%s</b>"|safe) % email_address
) }}</p>
{% elif result == email.VERIFICATION_STYMIED %}
<h1>{{ _("Address Taken") }}</h1>
<p>{{ _("The email address {0} is already connected to a different Gratipay account.",
("<b>%s</b>"|safe) % email_address) }}</p>
<p>{{ _( "{email_address} is already connected to a different Gratipay account."
, email_address=("<b>%s</b>"|safe) % email_address
) }}</p>
{% elif result == email.VERIFICATION_REDUNDANT %}
<h1>{{ _("Already Verified") }}</h1>
<p>{{ _("Your email address {0} is already connected to your Gratipay account.",
("<b>%s</b>"|safe) % email_address) }}</p>
{% elif result == email.VERIFICATION_MISSING %}
<h1>{{ _("Missing Info") }}</h1>
<p>{{ _("Sorry, that's a bad link. You'll need to view your email addresses "
"and start over.") }}</p>
<p>{{ _( "{email_address} is already connected to your Gratipay account."
, email_address=("<b>%s</b>"|safe) % email_address
) }}</p>
{% else %}
{% if result == email.VERIFICATION_EXPIRED %}
<h1>{{ _("Expired") }}</h1>
<p>{{ _("The verification code for {0} has expired.",
("<b>%s</b>"|safe) % email_address) }}</p>
{% elif result == email.VERIFICATION_FAILED %}
<h1>{{ _("Failure") }}</h1>
<p>{{ _("The verification code for {0} is bad.",
("<b>%s</b>"|safe) % email_address) }}</p>
{% endif %}
<p data-email="{{ email_address }}"><button class="resend">{{ _("Resend verification email") }}</button></p>
<h1>{{ _("Bad Info") }}</h1>
<p>{{ _("Sorry, that's a bad or expired link. You'll need to start over.") }}</p>
{% endif %}
<a href="/{{ participant.username }}/emails/">{{ _("View your email addresses") }}.</a>
{% endif %}
Expand Down

0 comments on commit 1d6915c

Please sign in to comment.