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

Commit

Permalink
Use goal < 0 to mean "no tips, please"; #893
Browse files Browse the repository at this point in the history
This doesn't enforce no tipping throughout the app but at least enables
turning it off in the UI.
  • Loading branch information
chadwhitacre committed May 2, 2013
1 parent e1857db commit 65c2b41
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/participant.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h2>{{ participant.username }}
</tr>
</table>

{% if participant != user %}
{% if participant != user and participant.goal >= 0 %}
<div class="nav level-1">
{% if locked %}

Expand Down
13 changes: 12 additions & 1 deletion templates/profile-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ <h2>Funding Goal
Gittip.
{% elif user.goal == 0 %}
<span class="i-m">{{ I_M }}</span> here as a patron.
{% elif user.goal < 0 %}
<span class="i-m">{{ I_M }}</span> here as a patron, and politely
decline to receive tips.
{% else %}
<span class="i-m">{{ I_M }}</span> grateful for gifts, but
don't have a specific funding goal.
Expand All @@ -91,7 +94,7 @@ <h2>Funding Goal
<label for="goal-yes"><span class="my">{{ MY }}</span> goal is to
receive $</label><input
name="goal_custom" id="goal-custom"
{% if (user.goal is None) or (user.goal == 0) %}
{% if (user.goal is None) or (user.goal <= 0) %}
{% else %}
value="{{ locale.format("%.2f", user.goal, grouping=True) }}"
{% end %} />
Expand All @@ -111,6 +114,14 @@ <h2>Funding Goal
<label for="goal-0"><span class="i-m">{{ I_M }}</span> here as a
patron.</label>

<br />

<input tabindex="406" type="radio" name="goal" id="goal-negative"
value="-1"
{% if user.goal < 0 %} checked="true"{% end %}/>
<label for="goal-negative"><span class="i-m">{{ I_M }}</span> here
as a patron, and politely decline to receive tips.</label>

</td></tr></table>
</form>

Expand Down
2 changes: 1 addition & 1 deletion www/assets/%version/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ $(document).ready(function()
newtext += $(label.get(1)).html();
}

if (d.goal !== '0.00')
if (parseFloat(d.goal) > 0)
$('INPUT[name=goal_custom]').val(d.goal);
$('.goal DIV.view').html(newtext);
finish_editing_goal();
Expand Down

0 comments on commit 65c2b41

Please sign in to comment.