websecmap/game/templates/game/contest_list.html
{% load humanize %}
<table class="table table-sm table-striped table-bordered table-hover">
<thead>
<tr>
<th width="10%"></th>
<th width="30%">Name</th>
<th width="5%">Teams</th>
<th width="5%">Urls</th>
<th width="10%">Info</th>
<th width="20%">From</th>
<th width="20%">Until</th>
</tr>
</thead>
<tbody>
{% for a_contest in contests %}
<tr style="{% if a_contest.name == contest.name %} font-weight: bold; background-color: #ddffdd {% endif %}">
<td style="text-align: center;"><form method="POST">{% csrf_token %}<input type="hidden" name="id" value="{{ a_contest.id }}">
<input type="submit" value="join" class="btn btn-primary btn-lg"></form></td>
<td><img class="country-select-flag" id="{{ a_contest.target_country }}" style="margin: 6px 4px 0" src="/static/flags/{{ a_contest.target_country }}.gif">
{{ a_contest.name }}</td>
<td>{{ a_contest.teams }}</td>
<td>{{ a_contest.urls }}</td>
<td><a href="/game/scores/?contest={{ a_contest.id }}">view scores</a></td>
<td><span title="{{ a_contest.from_moment }}">{{ a_contest.from_moment|naturaltime }}</span></td>
<td><span title="{{ a_contest.until_moment }}">{{ a_contest.until_moment|naturaltime }}</span></td>
</tr>
{% empty %}
<tr><td colspan="7">No currently open contests.</td></tr>
{% endfor %}
</tbody>
</table>