Skip to content

Commit 4cc460a

Browse files
committed
Adding message if nothing to score
1 parent 2a693ac commit 4cc460a

3 files changed

Lines changed: 50 additions & 39 deletions

File tree

hackathon/templates/hackathon/judge_teams.html

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,56 @@
88
<div class="card">
99
<div class="card-body">
1010
<div class="card-text">
11-
{% for team in teams.all %}
12-
13-
<div class="card mb-2">
14-
<div class="card-body">
15-
<div class="card-title">{{team.display_name}}</div>
16-
<div class="card-text">
11+
{% if teams.all %}
12+
{% for team in teams.all %}
13+
14+
<div class="card mb-2">
15+
<div class="card-body">
16+
<div class="card-title">{{team.display_name}}</div>
17+
<div class="card-text">
1718

18-
{% if team.project %}
19-
{% with judge_scores=team.project.scores.all|filter_judge_scores:request.user %}
20-
<div class="row">
21-
<div class="col-md-12 col-lg-10 team-scores">
22-
{% if judge_scores %}
23-
24-
{% for score in judge_scores %}
25-
{% if forloop.counter > 1 %} / {% endif %}
26-
{{score.hack_project_score_category}}: <strong>{{score.score}}</strong>
27-
{% endfor %}
28-
{% else %}
29-
No scores submitted yet.
30-
{% endif %}
19+
{% if team.project %}
20+
{% with judge_scores=team.project.scores.all|filter_judge_scores:request.user %}
21+
<div class="row">
22+
<div class="col-md-12 col-lg-10 team-scores">
23+
{% if judge_scores %}
24+
25+
{% for score in judge_scores %}
26+
{% if forloop.counter > 1 %} / {% endif %}
27+
{{score.hack_project_score_category}}: <strong>{{score.score}}</strong>
28+
{% endfor %}
29+
{% else %}
30+
No scores submitted yet.
31+
{% endif %}
32+
</div>
33+
<div class="col-md-12 col-lg-2">
34+
{% if judge_scores %}
35+
<a role="button" class="btn btn-secondary btn-sm mt-2" href="/hackathon/{{team.hackathon.id}}/team/{{team.id}}/judging/?next=hackathon:judge_teams">Change Score</a>
36+
{% else %}
37+
<a role="button" class="btn btn-success btn-sm mt-2" href="/hackathon/{{team.hackathon.id}}/team/{{team.id}}/judging/?next=hackathon:judge_teams">Score Team</a>
38+
{% endif %}
39+
</div>
3140
</div>
32-
<div class="col-md-12 col-lg-2">
33-
{% if judge_scores %}
34-
<a role="button" class="btn btn-secondary btn-sm mt-2" href="/hackathon/{{team.hackathon.id}}/team/{{team.id}}/judging/?next=hackathon:judge_teams">Change Score</a>
35-
{% else %}
36-
<a role="button" class="btn btn-success btn-sm mt-2" href="/hackathon/{{team.hackathon.id}}/team/{{team.id}}/judging/?next=hackathon:judge_teams">Score Team</a>
37-
{% endif %}
38-
</div>
39-
</div>
40-
{% endwith %}
41-
{% else %}
42-
<p>
43-
This team has not submitted a project.
44-
</p>
45-
{% endif %}
46-
41+
{% endwith %}
42+
{% else %}
43+
<p>
44+
This team has not submitted a project.
45+
</p>
46+
{% endif %}
47+
48+
</div>
4749
</div>
4850
</div>
49-
</div>
50-
{% endfor %}
51+
{% endfor %}
52+
{% else %}
53+
<p>
54+
Nothing to judge yet. Teams have not been assigned.
55+
</p>
56+
<p class="mb-0">
57+
<a href="{% url "hackathon:view_hackathon" hackathon_id=hackathon.id %}"
58+
class="ci-link">Back To Hackathon</a>
59+
</p>
60+
{% endif %}
5161
</div>
5262
</div>
5363
</div>

hackathon/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
name='view_hackathon'),
2929
path("<int:hackathon_id>/update/", update_hackathon,
3030
name="update_hackathon"),
31-
path("<int:hackathon_id>/update_hackathon_status/", update_hackathon_status,
31+
path("<int:hackathon_id>/update_hackathon_status/", update_hackathon_status,
3232
name="update_hackathon_status"),
3333
path("<int:hackathon_id>/delete/", delete_hackathon,
3434
name="delete_hackathon"),
3535
path('enroll/', enroll_toggle, name='enroll_toggle'),
3636
path('<int:hackathon_id>/judge_teams/', judge_teams,
37-
name="judge_teams"),
37+
name="judge_teams"),
3838
path('<int:hackathon_id>/assign_mentors/', assign_mentors,
39-
name="assign_mentors"),
39+
name="assign_mentors"),
4040
]

hackathon/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ def judge_teams(request, hackathon_id):
498498
return redirect(reverse('home'))
499499

500500
return render(request, 'hackathon/judge_teams.html', {
501+
'hackathon': hackathon,
501502
'teams': hackathon.teams,
502503
})
503504

0 commit comments

Comments
 (0)