Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Display ctf weight #43

Merged
merged 1 commit into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions ctfpad/templates/ctfpad/ctfs/list_ctfs.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{% load humanize %}
{% load ctfpad_filters %}

<div class="row">
<div class="col">
<h5>List of registered CTFs</h5>
{% if object_list %}
<div class="row">
<div class="col">
Expand All @@ -15,27 +17,30 @@
<thead>
<tr>
<th scope="col">CTF</th>
<th scope="col">Start</th>
<th scope="col">End</th>
<th scope="col"><abbr title="Hover to convert to your local time">Date (in UTC)</abbr></th>
<th scope="col">Duration</th>
<th scope="col">Weight</th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
{% for ctf in page_obj %}
<tr class="table-row" data-href="{% url 'ctfpad:ctfs-detail' ctf.id %}">
<th scope="row">{{ctf.name}}</td>
<td scope="row">
<a href="{% url 'ctfpad:ctfs-detail' ctf.id %}">{{ctf.name}}</a>
</td>
{% if ctf.is_permanent %}
<td>♾</td>
<td>♾</td>
{% else %}
<td>
<abbr title='Local time: {{ ctf.start_date | as_local_datetime_for_member:request.user.member | date:"Y/m/d H:i:s" }}'>{{ctf.start_date | date:"Y/m/d H:i:s"}}</abbr>
</td>
<td>
&nbsp;→&nbsp;
<abbr title='Local time: {{ ctf.end_date | as_local_datetime_for_member:request.user.member | date:"Y/m/d H:i:s" }}'>{{ctf.end_date | date:"Y/m/d H:i:s"}}</abbr>
</td>
<td>{% if ctf.duration == 0 %}♾{% else %}{{ ctf.duration | naturaltime}}{% endif %}</td>
{% endif %}
<td>{{ ctf.weight | floatformat }}</td>
<td><a href="{% url 'ctfpad:ctfs-edit' ctf.id %}" title="Edit"><i class="fas fa-edit"></i></a></td>
<td><a href="{% url 'ctfpad:ctfs-delete' ctf.id %}" title="Delete"><i class="fas fa-trash"></i></a></td>
</tr>
Expand Down
8 changes: 5 additions & 3 deletions ctfpad/templates/ctfpad/ctfs/list_ctftime_ctfs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@

<div class="row">
<div class="col-md-12">
<h5>List of current and future CTFs registered on CTFTime</h5>
<small>* All times are in UTC</small>
<h5>Current and future CTFs from CTFTime</h5>
<small>* All times are in UTC (hover for local time)</small>

<table class="table table-sm table-hover">
<thead>
<tr>
<th scope="col">CTF</th>
<th scope="col"><abbr title="Hover for showing the local time conversion">Date (in UTC)</abbr></th>
<th scope="col"><abbr title="Hover for local time">Date (in UTC)</abbr></th>
<th scope="col">Duration</th>
<th scope="col">Weight</th>
<th scope="col">Import</th>
</tr>
</thead>
Expand All @@ -29,6 +30,7 @@ <h5>List of current and future CTFs registered on CTFTime</h5>
<td>
{{ ctf.duration|naturaltime}}
</td>
<td>{{ ctf.weight | floatformat }}</td>
<td><a href="{% url 'ctfpad:ctfs-import' %}?ctftime_id={{ctf.id|urlencode}}"><i class="fas fa-file-import"></i></a></td>
</tr>
{% endfor %}
Expand Down