khana/templates/chrono_list.html

70 lines
2.7 KiB
HTML

{% extends "listing.html" %}
{% load format %}
{% block datacontent %}
<div class="card mb-0">
<div class="card-header">
<h4 class="card-title"> Chronos' Listing</h4>
</div>
<div class="card-body pb-0">
<div class="table-responsive pb-0">
{% if chrono_list.count >= 1 %}
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="maintable">
<thead>
<tr>
<th style="width: 3%"></th>
<th class="header text-center" style="width: 10%">Date</th>
<th class="header text-left" style="width: 35%">Gymnast</th>
<th class="header text-center" style="width: 8%">Score</th>
<th class="header text-left" style="width: 28%">Routine</th>
<th class="header text-center" style="width: 8%">Type</th>
</tr>
</thead>
<tbody>
{% for chrono in chrono_list %}
<tr>
<td>
<a href="{% url 'chrono_update' chrono.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
<td class="text-left">{{ chrono.date | date:"d-m-Y" }}</a></td>
<td class="text-left"><a href="{% url 'gymnast_details' chrono.gymnast.id %}">{{ chrono.gymnast }}</a></td>
<td class="text-center">{{ chrono.score }}</td>
<td class="text-left"><a href="{% url 'routine_details' chrono.routine.id %}">{{ chrono.routine }}</a></td>
<td class="text-center">{{ chrono.get_routine_type_display }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
There are no chronos corresponding to your criterias
{% endif %}
</div>
</div>
<div class="card-footer text-right text-muted pt-0">
<a href="{% url 'chrono_create' %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="tim-icons icon-simple-add"></i>
</button>
</a>
</div>
</div>
{% endblock %}
{% block footerscript %}
<script type="text/javascript">
$(document).ready(function() {
$('[data-sort="table"]').tablesorter({
headers: {
0: { sorter: false },
},
dateFormat: "uk",
sortList: [[1,0]]
})
});
</script>
{% endblock %}