Skip to content

Commit

Permalink
Adding message if nothing to score
Browse files Browse the repository at this point in the history
  • Loading branch information
stefdworschak committed Sep 1, 2021
1 parent 2a693ac commit 4cc460a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 39 deletions.
82 changes: 46 additions & 36 deletions hackathon/templates/hackathon/judge_teams.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,56 @@
<div class="card">
<div class="card-body">
<div class="card-text">
{% for team in teams.all %}

<div class="card mb-2">
<div class="card-body">
<div class="card-title">{{team.display_name}}</div>
<div class="card-text">
{% if teams.all %}
{% for team in teams.all %}

<div class="card mb-2">
<div class="card-body">
<div class="card-title">{{team.display_name}}</div>
<div class="card-text">

{% if team.project %}
{% with judge_scores=team.project.scores.all|filter_judge_scores:request.user %}
<div class="row">
<div class="col-md-12 col-lg-10 team-scores">
{% if judge_scores %}

{% for score in judge_scores %}
{% if forloop.counter > 1 %} / {% endif %}
{{score.hack_project_score_category}}: <strong>{{score.score}}</strong>
{% endfor %}
{% else %}
No scores submitted yet.
{% endif %}
{% if team.project %}
{% with judge_scores=team.project.scores.all|filter_judge_scores:request.user %}
<div class="row">
<div class="col-md-12 col-lg-10 team-scores">
{% if judge_scores %}

{% for score in judge_scores %}
{% if forloop.counter > 1 %} / {% endif %}
{{score.hack_project_score_category}}: <strong>{{score.score}}</strong>
{% endfor %}
{% else %}
No scores submitted yet.
{% endif %}
</div>
<div class="col-md-12 col-lg-2">
{% if judge_scores %}
<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>
{% else %}
<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>
{% endif %}
</div>
</div>
<div class="col-md-12 col-lg-2">
{% if judge_scores %}
<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>
{% else %}
<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>
{% endif %}
</div>
</div>
{% endwith %}
{% else %}
<p>
This team has not submitted a project.
</p>
{% endif %}

{% endwith %}
{% else %}
<p>
This team has not submitted a project.
</p>
{% endif %}

</div>
</div>
</div>
</div>
{% endfor %}
{% endfor %}
{% else %}
<p>
Nothing to judge yet. Teams have not been assigned.
</p>
<p class="mb-0">
<a href="{% url "hackathon:view_hackathon" hackathon_id=hackathon.id %}"
class="ci-link">Back To Hackathon</a>
</p>
{% endif %}
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions hackathon/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
name='view_hackathon'),
path("<int:hackathon_id>/update/", update_hackathon,
name="update_hackathon"),
path("<int:hackathon_id>/update_hackathon_status/", update_hackathon_status,
path("<int:hackathon_id>/update_hackathon_status/", update_hackathon_status,
name="update_hackathon_status"),
path("<int:hackathon_id>/delete/", delete_hackathon,
name="delete_hackathon"),
path('enroll/', enroll_toggle, name='enroll_toggle'),
path('<int:hackathon_id>/judge_teams/', judge_teams,
name="judge_teams"),
name="judge_teams"),
path('<int:hackathon_id>/assign_mentors/', assign_mentors,
name="assign_mentors"),
name="assign_mentors"),
]
1 change: 1 addition & 0 deletions hackathon/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ def judge_teams(request, hackathon_id):
return redirect(reverse('home'))

return render(request, 'hackathon/judge_teams.html', {
'hackathon': hackathon,
'teams': hackathon.teams,
})

Expand Down

0 comments on commit 4cc460a

Please sign in to comment.