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

Commit

Permalink
Notify user of PayPal update in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Apr 27, 2017
1 parent 77d2aa2 commit b186161
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tests/ttw/test_package_claiming.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ def test_that_claimed_packages_can_be_given_to(self):
'Thank you so much for supporting foo!'


def test_visiting_verify_link_shows_packages_newly_claimed(self):
def test_visiting_verify_link_shows_helpful_information(self):
self.make_package()
self.check()

link = pickle.loads(self.db.one('select context from email_queue'))['link']
link = link[len(self.base_url):] # strip because visit will add it back

self.sign_in('alice')
self.visit(link)
assert self.css('.withdrawal-notice a').text == 'update'
assert self.css('.withdrawal-notice b').text == '[email protected]'
assert self.css('.listing-name').text == 'foo'
19 changes: 17 additions & 2 deletions www/~/%username/emails/verify.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,24 @@ suppress_sidebar = True
<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>

<p><a href="/{{ participant.username }}/emails/">
{{ _("View your email addresses") }}.</a>
</p>

{% if paypal_updated %}
<h2>{{ _("Withdrawals") }}</h2>
<p class="withdrawal-notice">
{{ _( "We will send your money via PayPal to {email_address} ({a}update{_a})."
, email_address=("<b>%s</b>"|safe) % email_address
, a='<a href="../routes/paypal">'|safe
, _a='</a>'|safe
) }}
</p>
{% endif %}

{% if project_list %}
<h2>{{ _("Your New Projects") }}</h2>
<h2>{{ _("New Projects") }}</h2>
<table class="listing">
{% include "templates/project-listing.html" %}
</table>
Expand Down

0 comments on commit b186161

Please sign in to comment.