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 #1

Merged
merged 5 commits into from
Dec 20, 2020
Merged
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
80 changes: 41 additions & 39 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
50 changes: 50 additions & 0 deletions docs/environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Environment Variables

## Production

`PRODUCTION` set to `true` for sane defaults when running in production.

`DEBUG` enables [Django debug mode](https://docs.djangoproject.com/en/2.0/ref/settings/#std:setting-DEBUG) .
Set when `PRODUCTION` is not set.

`SECRET_KEY` a random value for cryptographic signing by [Django](https://docs.djangoproject.com/en/2.0/ref/settings/#std:setting-SECRET_KEY) .

`REGISTRATION_TOKEN` a random string used to prevent registration by random people.
If set, users cannot access the registration page without knowing the token.
It must be set as the GET parameter `token` when opening the registration page.

E.g. if the token for `hackerforce.example.com` is `mytoken`, then new users
would register at `hackerforce.example.com/register/?token=mytoken` .

If not set, anyone can register from the home page.

## Emails

`FROM_EMAIL` the address emails HackerForce sends appear to come from.

`REPLY_TO_EMAIL` the address responses to your emails are sent to.

`BCC_EMAIL` An address all emails you send are sent to.

### Sending Emails

`SENDGRID_API_KEY` set if you want to send emails through [SendGrid](https://sendgrid.com/) .

`AWS_ACCESS_KEY_ID` set if you want to send emails through [AWS Simple Email Service](https://aws.amazon.com/ses/) .

## Database

`DATABASE_URL` the location of the database used by HackerForce.
Consumed by [dj_database_url](https://github.com/jacobian/dj-database-url) .

## Sponsorship Packet

`SPONSORSHIP_PACKET_URL`
The URL for the sponsorship packet, to download if `SPONSORSHIP_PACKET_FILE`
does not exist in the filesystem.

`SPONSORSHIP_PACKET_FILE`
The local name of the sponsorship packet, to be stored in the website/static
folder. If this file exists, it will be used. Otherwise, it will be
re-downloaded from `SPONSORSHIP_PACKET_URL`.
Must be set regardless of whether `SPONSORSHIP_PACKET_URL` is set.
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