Skip to content

Commit

Permalink
Last minute live changes 2019-04-23:1
Browse files Browse the repository at this point in the history
  • Loading branch information
dlareau committed Apr 23, 2020
1 parent 953c016 commit d5dc22b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions huntserver/hunt_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ def chat(request):
else:
if(team is None):
return render(request, 'access_error.html', {'reason': "team"})
if(team.hunt.is_locked):
return render(request, 'access_error.html', {'reason': "hunt"})
if request.is_ajax():
messages = Message.objects.filter(pk__gt=request.GET.get("last_pk"))
else:
Expand Down
3 changes: 2 additions & 1 deletion huntserver/info_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.contrib.auth.decorators import login_required
from django.db.models.functions import Lower
from django.shortcuts import render
from django.contrib import messages
import random
Expand Down Expand Up @@ -91,7 +92,7 @@ def registration(request):
return render(request, "registration.html",
{'registered_team': team, 'curr_hunt': curr_hunt})
else:
teams = curr_hunt.real_teams
teams = curr_hunt.real_teams.order_by(Lower('team_name'))
return render(request, "registration.html",
{'teams': teams, 'curr_hunt': curr_hunt})

Expand Down
3 changes: 2 additions & 1 deletion huntserver/staff_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from django.utils import timezone
from django.contrib import messages
from django.db.models import F
from django.db.models.functions import Lower
from huey.contrib.djhuey import result
import itertools
import json
Expand Down Expand Up @@ -386,7 +387,7 @@ def admin_chat(request):
if request.is_ajax() or request.method == 'POST':
return HttpResponse(json.dumps(context))
else:
teams = curr_hunt.team_set.order_by("team_name").all()
teams = curr_hunt.team_set.order_by(Lower("team_name")).all()
context['teams'] = teams
return render(request, 'staff_chat.html', add_apps_to_context(context, request))

Expand Down
4 changes: 2 additions & 2 deletions huntserver/templates/staff_chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<h1> Staff Chat </h1>
<div class="container">
<div class="row">
<div id="button_container" class="content col-sm-4 col-md-3">
<div id="button_container" class="content col-sm-5 col-md-4">
{% for team in teams %}
<button style="width:45%" data-id='{{ team.pk }}' data-full_name="{{ team.team_name }}" class="chatselect">
<button style="width:31%" data-id='{{ team.pk }}' data-full_name="{{ team.team_name }}" class="chatselect">
{{ team.team_name|truncatechars:12 }}
</button>

Expand Down

0 comments on commit d5dc22b

Please sign in to comment.