-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from clopedion/main
Pre-TMPP changes
- Loading branch information
Showing
11 changed files
with
168 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% extends "base.html" %} | ||
{% block nav %} | ||
» Edit Hunt | ||
{% endblock %} | ||
{% block main %} | ||
<h1>Edit Hunt</h1> | ||
<form method="post"> | ||
{% csrf_token %} | ||
{{ form.non_field_errors }} | ||
|
||
<table class="classic"> | ||
{{ form.as_table }} | ||
</table> | ||
<input type="submit" value="Submit"> | ||
</form> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{% extends "base.html" %} | ||
{% load duration %} | ||
{% block nav %} | ||
» <a href="{% url 'view_hunt' hunt.id hunt.slug %}">{{ hunt.name }}</a> | ||
» Leaderboard | ||
{% endblock %} | ||
{% block main %} | ||
<h1>Hunt: {{ hunt.name }} / Leaderboard</h1> | ||
|
||
{% if teams %} | ||
<table class="classic"> | ||
<tr><th>Team</th><th>Score</th><th>Solves</th><th>Team Creation Time (UTC)</th><th>Last Solve (UTC)</th><th>Total Solve Time</th></tr> | ||
{% for team in teams %} | ||
<tr> | ||
<td>{{ team.name }}</td> | ||
<td>{{ team.score }}</td> | ||
<td>{{ team.solve_count }}</td> | ||
<td>{{ team.creation_time|date:'Y-m-d H:i'}}</td> | ||
<td>{{ team.last_solve|date:'Y-m-d H:i'}}</td> | ||
<td>{{ team.solve_time|duration}}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% else %} | ||
No teams... | ||
{% endif %} | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django import template | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.filter | ||
def duration(td): | ||
seconds = int(td.total_seconds()) | ||
(days, seconds) = divmod(seconds, 3600 * 24) | ||
(hours, seconds) = divmod(seconds, 3600) | ||
(minutes, seconds) = divmod(seconds, 60) | ||
return "{} days {:02}:{:02}:{:02}".format(days, hours, minutes, seconds) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters