Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ASSIGNED status to Sponsorships #17

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def gen_sponsorship_chart(sponsorships, hackathon):
for sp in sponsorships:
if sp.status in [Sponsorship.CONFIRMED, Sponsorship.PAID]:
confirmed_count += 1
elif sp.status in [Sponsorship.CONTACTED, Sponsorship.RESPONDED]:
elif sp.status in [Sponsorship.ASSIGNED, Sponsorship.CONTACTED, Sponsorship.RESPONDED]:
progress_count += 1
elif sp.status in [Sponsorship.DENIED, Sponsorship.GHOSTED]:
dead_count += 1
Expand Down
2 changes: 2 additions & 0 deletions hackathons/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ class Meta:


class Sponsorship(models.Model):
ASSIGNED = "assigned"
CONTACTED = "contacted"
RESPONDED = "responded"
CONFIRMED = "confirmed"
DENIED = "denied"
GHOSTED = "ghosted"
PAID = "paid"
STATUSES = (
(ASSIGNED, "Assigned"),
(CONTACTED, "Contacted"),
(RESPONDED, "Responded"),
(CONFIRMED, "Confirmed"),
Expand Down
2 changes: 2 additions & 0 deletions hackathons/templates/cards/sponsorship_status.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<span style="white-space: nowrap">
{% if not sponsorship %}
<span class="status-icon bg-gray-dark"></span> Uncontacted
{% elif sponsorship.status == 'assigned' %}
<span class="status-icon bg-cyan"></span> Assigned
{% elif sponsorship.status == 'contacted' %}
<span class="status-icon bg-orange"></span> Contacted
{% elif sponsorship.status == 'responded' %}
Expand Down
2 changes: 1 addition & 1 deletion hackathons/templates/cards/sponsorship_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h3 class="card-title">{{ card_title }}</h3>
<td>
{% if faked %}
<a class="tag tag-red float-right" href="{% url 'hackathons:sponsorships:new' h.pk %}?company={{ s.company.pk }}">
Mark Contacted
Start Tracking
</a>
{% else %}
<a class="icon" href="{% url 'hackathons:sponsorships:edit' h.pk s.company.pk %}">
Expand Down
4 changes: 2 additions & 2 deletions hackathons/templates/sponsorship_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h2> {{ company.name }} </h2>
{% else %}
<div class="col text-right h2">
<a class="button" href="{% url 'hackathons:sponsorships:new' h.pk %}?company={{ company.pk }}">
<button class="btn btn-primary ml-auto">Mark Contacted</button>
<button class="btn btn-primary ml-auto">Start Tracking</button>
</a>
</div>
{% endif %}
Expand All @@ -34,7 +34,7 @@ <h2 class="col card-title">Status: &nbsp;
<div class="col-sm-8 text-center" style="font-size: 14px">
<i class="fe fe-alert-triangle" style="color: red"></i>
<b style="font-size: 16px; color: red">This company has not been contacted for the current hackathon.</b><br />
Press "Mark Contacted" to begin tracking this company as a potential sponsor.
Press "Start Tracking" to begin tracking this company as a potential sponsor.
</div>
{% elif no_contacted_employees %}
<div class="col-sm-8 text-center" style="font-size: 14px">
Expand Down
2 changes: 1 addition & 1 deletion hackathons/templates/sponsorships_summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</a>
{% if faked %}
<a class="tag tag-red" style="position: absolute; top: 15px; right: 15px" href="{% url 'hackathons:sponsorships:new' h.pk %}?company={{ s.company.pk }}">
Mark Contacted
Start Tracking
</a>
{% else %}
<a class="icon" href="{% url 'hackathons:sponsorships:edit' h.pk s.company.pk %}" style="position: absolute; top: 15px; right: 15px">
Expand Down
2 changes: 1 addition & 1 deletion hackathons/views/sponsorships.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def fake_sponsorship(company):
return [Sponsorship(pk=0, company=c, tier=None, contribution=0) for c in company]

confirmed = sponsorship_wrapper("confirmed", [Sponsorship.CONFIRMED, Sponsorship.PAID])
in_progress = sponsorship_wrapper("in_progress", [Sponsorship.CONTACTED, Sponsorship.RESPONDED])
in_progress = sponsorship_wrapper("in_progress", [Sponsorship.ASSIGNED, Sponsorship.CONTACTED, Sponsorship.RESPONDED])
dead = sponsorship_wrapper("dead", [Sponsorship.GHOSTED, Sponsorship.DENIED])
uncontacted = company_wrapper("uncontacted")

Expand Down