Skip to content

Commit

Permalink
update fund button on landing page based on funder
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed May 22, 2019
1 parent 755ddc0 commit 04716f9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
21 changes: 14 additions & 7 deletions app/retail/templates/home/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,30 @@
<h1>{% trans "Crowdfunding and freelance developers for your software projects" %}</h1>
<p>
{% blocktrans %}
<b>Builders/Project Managers: </b><br>
Leverage our global, on-demand workforce. Find expert freelance developers to design, test, code, and build your project teams today. Save time via direct Github integration. Crowdfund for your open source startup or project to increase your budget and bring in more developers.
<b>Builders/Project Managers: </b><br>
Leverage our global, on-demand workforce. Find expert freelance developers to design,\
test, code, and build your project teams today. Save time via direct Github integration.
Crowdfund for your open source startup or project to increase your budget and bring in
more developers.
{% endblocktrans %}
<span class="d-flex mt-3 content-links">
<a href="https://gitcoin.co/bounties/funder" class="mr-3">Fund an Issue/Project</a>
<a href="https://gitcoin.co/grants/">Grants</a>
<a href="{% url "funder_bounties" %}" class="mr-3">Fund an Issue/Project</a>
<a href="{% url "grants:grants" %}">Grants</a>
</span>
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
<b>Coders/Software Developers: </b><br>
Get paid in crypto for freelance jobs, building features, and solving bug bounties! Work with top open source projects and get paid out fast.
{% endblocktrans %}<br>
<span class="d-flex mt-3 content-links"><a href="https://gitcoin.co/onboard/contributor/">{% trans "Bug Bounties" %}</a></span>
<span class="d-flex mt-3 content-links"><a href="/onboard/contributor/">{% trans "Bug Bounties" %}</a></span>
</p>
<div class="buttons">
<a class="btn btn-gc-green mr-2" href="{% url "new_bounty" %}">{% trans "Fund an Issue" %}</a>
{% if is_new_funder %}
<a class="btn btn-gc-green mr-2" href="/onboard/funder/">{% trans "Become a Funder" %}</a>
{% else %}
<a class="btn btn-gc-green mr-2" href="{% url "quickstart" %}">{% trans "Fund an Issue" %}</a>
{% endif %}
<a class="btn btn-outline-white ml-2" href="{% url "products" %}">{% trans "See Our Products" %}</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/retail/templates/shared/top_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<img src="{% static "v2/images/top-bar/kudos-logo.svg" %}" height="22" alt="" class="d-md-block d-none">
<img src="{% static "v2/images/top-bar/kudos-symbol.svg" %}" height="22" alt="" class="d-md-none">
</a>
<a class="{% if request.path|matches:'^\/((grants.*))$' %}selected{% endif %}" href="/grants">
<a class="{% if request.path|matches:'^\/((grants.*))$' %}selected{% endif %}" href="{% url "grants:grants" %}">
<img src="{% static "v2/images/top-bar/grants-logo.svg" %}" height="22" alt="" class="d-md-block d-none">
<img src="{% static "v2/images/top-bar/grants-symbol.svg" %}" height="22" alt="" class="d-md-none">
</a>
Expand Down
14 changes: 12 additions & 2 deletions app/retail/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

from app.utils import get_default_network
from cacheops import cached_as, cached_view, cached_view_as
from dashboard.models import Activity, Profile
from dashboard.models import Activity, Bounty, Profile
from dashboard.notifications import amount_usdt_open_work, open_bounties
from economy.models import Token
from marketing.mails import new_funding_limit_increase_request, new_token_request
Expand Down Expand Up @@ -66,6 +66,15 @@ def get_activities(tech_stack=None, num_activities=15):


def index(request):

user = request.user.profile if request.user.is_authenticated else None
is_new_funder = True

if user:
funded_bounties = Bounty.objects.filter(bounty_owner_github_username=user).count()
if funded_bounties > 0:
is_new_funder = False

products = [
{
'group' : 'grow_oss',
Expand Down Expand Up @@ -199,6 +208,7 @@ def index(request):
]

context = {
'is_new_funder': is_new_funder,
'products': products,
'know_us': know_us,
'press': press,
Expand Down Expand Up @@ -556,7 +566,7 @@ def contributor_bounties(request, tech_stack):
{ 'link': "/design", 'text': "Design"},
{ 'link': "/html", 'text': "HTML"},
{ 'link': "/ruby", 'text': "Ruby"},
{ 'link': "/css", 'text': "CSS"},
{ 'link': "/css", 'text': "CSS"},
]
}

Expand Down

0 comments on commit 04716f9

Please sign in to comment.