This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rough in UI for account cancelation; #54
Now that the three scripts involved in account cancelation have been moved to (tested) methods on Participant, we're ready to wire up the UI. This commit rebases the original work we did on the UI on top of the separate line of development we ended up pursuing for the Participant methods.
- Loading branch information
1 parent
956eb0b
commit 72dde08
Showing
9 changed files
with
95 additions
and
146 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Gittip.cancel = {}; | ||
|
||
Gittip.cancel.init = function() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from gittip.utils import get_participant | ||
[---] | ||
participant = get_participant(request, restrict=True) | ||
hero = "Cancel Account" | ||
title = participant.username # used in the title tag | ||
username = participant.username # used in footer shared with on/$platform/ | ||
# pages | ||
|
||
can_upstream = participant.get_dollars_receiving() > 0 | ||
can_downstream = participant.get_dollars_giving() > 0 | ||
|
||
if POST: | ||
final_disbursement_option = request.body['final_disbursement_option'] | ||
participant.cancel(final_disbursement_option) | ||
request.redirect('/') | ||
[---] text/html | ||
{% extends "templates/base.html" %} | ||
|
||
{% block heading %} | ||
<h2 class="top"><span>Cancel Account</span></h2> | ||
{% endblock %} | ||
|
||
{% block box %} | ||
<div class="on-form"> | ||
<form method="POST"> | ||
<div class="constrain-width group" style="margin-top: 35px;"> | ||
{% if participant.balance > 0 %} | ||
<p>You have a balance of ${{ participant.balance }}. | ||
What should we do with it?</p> | ||
|
||
<ul> | ||
<li><input type="radio" name="final_disbursement_option" id="r2" | ||
value="bank" checked /> | ||
<label for="r2">Send it to my bank account</label></li> | ||
<li><input type="radio" name="final_disbursement_option" id="r3" | ||
value="upstream" {{ 'disabled' if not can_upstream }} /> | ||
<label for="r3">Refund it to my patrons</label></li> | ||
<li><input type="radio" name="final_disbursement_option" id="r4" | ||
value="downstream" {{ 'disabled' if not can_downstream }} /> | ||
<label for="r4">Give it to my tippees</label></li> | ||
</ul> | ||
{% endif %} | ||
<p>Here's what we'll do when you cancel your account:</p> | ||
<ul> | ||
<li>Turn off all tips you are currently receiving.</li> | ||
<li>Zero out all tips you are currently receiving.</li> | ||
<li>Make it so there are no more you are currently receiving.</li> | ||
</ul> | ||
</div> | ||
<div class="nav level-1"> | ||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}"> | ||
<button class="selected larger cancel-account" id="save" | ||
type="submit">Cancel My Gittip Account</button> | ||
</div> | ||
</form> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters