Skip to content

Commit

Permalink
add submission to portal
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo-SF committed Oct 20, 2024
1 parent f26f42e commit adea1f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion portal/portal/hackathons/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def get(
"created",
):
if submission.content_object not in submissions:
submissions[submission.content_object] = submission
count = models.Submission.objects.filter(
content_type=submission.content_type,
object_id=submission.object_id,
).count()
submissions[submission.content_object] = (submission, count)

context = self.get_context_data(object=self.object, submissions=submissions)

Expand Down
4 changes: 3 additions & 1 deletion portal/portal/templates/hackathons/leaderboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ <h1>Leaderboard</h1>
<th scope="col">Team</th>
<th scope="col">Name</th>
<th scope="col">Score</th>
<th scope="col">Submissions</th>
</tr>
</thead>
<tbody>
Expand All @@ -28,7 +29,8 @@ <h1>Leaderboard</h1>
</th>
<td>{{ obj.hackathon_team_id }}</td>
<td>{{ obj.name }}</td>
<td>{{ submission.score|floatformat:3 }}</td>
<td>{{ submission.0.score|floatformat:3 }}</td>
<td>{{ submission.1 }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit adea1f0

Please sign in to comment.