khana/templates/score_list.html

80 lines
3.5 KiB
HTML

{% extends "listing.html" %}
{% load format %}
{% block datacontent %}
<div class="row justify-content-center">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
<div class="card">
<div class="card-header">
<h4 class="card-title">Scores' list</h4>
</div>
<div class="card-body">
{% if score_list.count >= 1 %}
<table class="table tablesorter table-striped mb-0" data-sort="table" id="maintable">
<thead>
<tr>
<th></th>
<th class="header text-left">Gymnast</th>
<th class="header text-left">Event</th>
<th class="header text-left">Routine</th>
<th class="header text-center">Exe.</th>
<th class="header text-center">Dif.</th>
<th class="header text-center">ToF</th>
<th class="header text-center">HD</th>
<th class="header text-center">Pen.</th>
<th class="header text-center">Total</th>
</tr>
</thead>
<tbody>
{% for score in score_list %}
<tr>
<td>
<a href="{% url 'score_update' score.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
<td><a href="{% url 'gymnast_details' score.gymnast.id %}">{{ score.gymnast }}</a></td>
<td><a href="{% url 'event_details' score.event.id %}">{{ score.event.name }}</a></td>
<td>{{ score.get_routine_type_display }}</td>
<td class="text-right">{{ score.point_execution }}</td>
<td class="text-right">{{ score.point_difficulty }}</td>
<td class="text-right">{{ score.point_time_of_flight }}</td>
<td class="text-right">{{ score.point_horizontal_displacement }}</td>
<td class="text-right">{% if score.penality > 0 %}-{{ score.penality }}{% endif %}</td>
<td class="text-right">{{ score.total }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
There are no scores corresponding to your criterias
{% endif %}
</div>
<div class="card-footer text-right text-muted pt-0">
<a href="{% url 'score_create' %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="tim-icons icon-simple-add"></i>
</button>
</a>
</div>
</div>
</div>
</div>
{% endblock %}
{% block footerscript %}
<script type="text/javascript">
$(document).ready(function() {
$('[data-sort="table"]').tablesorter({
headers: {
0: { sorter: false },
5: { sorter: false },
},
// dateFormat: "uk",
sortList: [[1,0]]
})
});
</script>
{% endblock %}