Skip to content

Commit

Permalink
DL fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Sep 9, 2019
1 parent 8121c36 commit 70bb11b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion app/grants/templates/grants/fund.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,17 @@ <h2 class="font-title-lg my-4">{% trans "Fund Grant" %}</h2>
<img src="{% static "v2/images/grants/signal.png" %}" style="max-width:40rem; height: 7rem">
<br>
<br>
<a href="?toggle_phantom_fund=1" class="button button--primary button--full">
<form method=POST>
{%csrf_token%}
<input type=hidden name=toggle_phantom_fund value=1 />
<input class="btn btn-gc-blue" type=submit name=submit value="
{% if is_phantom_funding_this_grant %}
{% trans "STOP Signaling for Grant" %}
{% else %}
{% trans "Signal for Grant" %}
{% endif %}
" />
</form>
</a>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/grants/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,12 @@ def grant_fund(request, grant_id, grant_slug):
fund_reward = None
round_number = 3
can_phantom_fund = request.user.is_authenticated and request.user.groups.filter(name='phantom_funders').exists()
phantom_funds = PhantomFunding.objects.filter(profile=request.user.profile, grant=grant, round_number=round_number)
is_phantom_funding_this_grant = can_phantom_fund and request.user.is_authenticated and phantom_funds.exists()
phantom_funds = PhantomFunding.objects.filter(profile=request.user.profile, grant=grant, round_number=round_number) if request.user.is_authenticated else PhantomFunding.objects.none()
is_phantom_funding_this_grant = can_phantom_fund and phantom_funds.exists()
show_tweet_modal = False
if can_phantom_fund:
active_tab = 'phantom'
if can_phantom_fund and request.GET.get('toggle_phantom_fund'):
if can_phantom_fund and request.POST.get('toggle_phantom_fund'):
if is_phantom_funding_this_grant:
msg = "You are no longer signaling for this grant."
phantom_funds.delete()
Expand Down

0 comments on commit 70bb11b

Please sign in to comment.