Skip to content

Commit

Permalink
Info page also tells how many users are new
Browse files Browse the repository at this point in the history
  • Loading branch information
dlareau committed Oct 5, 2018
1 parent feb038d commit 2da8fcf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion huntserver/staff_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,17 +326,26 @@ def hunt_info(request):
curr_hunt = Hunt.objects.get(is_current_hunt=True)
teams = curr_hunt.real_teams
people = []
new_people = []
for team in teams:
people = people + list(team.person_set.all())
try:
old_hunt = Hunt.objects.get(hunt_number=curr_hunt.hunt_number-1)
new_people = [p for p in people if p.user.date_joined > old_hunt.start_date]
except:
new_people = people

need_teams = teams.filter(location="need_a_room") | teams.filter(location="needs_a_room")
have_teams = teams.exclude(location="need_a_room").exclude(location="needs_a_room").exclude(location="off_campus")
offsite_teams = teams.filter(location="off_campus")

context = {'curr_hunt': curr_hunt,
'people': people,
'new_people': new_people,
'need_teams': need_teams.all(),
'have_teams': have_teams.all(),
'offsite_teams': offsite_teams.all()}
'offsite_teams': offsite_teams.all(),
}
return render(request, 'staff_hunt_info.html', context)


Expand Down
2 changes: 1 addition & 1 deletion huntserver/templates/staff_hunt_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1>Hunt Info</h1>
</table>
</div>
<div class="col-xs-12 col-sm-4 col-lg-7">
<b>{{ people|length }} People</b><br><br>
<b>{{ people|length }} People ({{ new_people|length }} new)</b><br><br>

<b> Allergies/Preferences: </b>
</br>
Expand Down

0 comments on commit 2da8fcf

Please sign in to comment.