Ultron/templates/followup/scores/list.html

95 lines
4.4 KiB
HTML

{% extends "listing.html" %}
{% load has_group %}
{% 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 row">
<div class="col-8">
<h4 class="">Scores listing {% if gymnast %}for <a href="{% url 'gymnast_details_tab' gymnast.id 'scores' %}"><i>{{ gymnast }}</i></a>{% endif %}</h4>
</div>
<div class="col-1 ml-auto">
<div class="text-right">
{% if request.user|has_group:"trainer" %}
<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>
{% endif %}
</div>
</div>
</div>
<div class="card-body">
{% if score_list %}
<table class="table tablesorter table-striped mb-0" data-sort="table" id="score_table">
<thead>
<tr>
<th></th>
<th class="header text-left">Gymnast</th>
<th class="header text-left">Event</th>
<th class="header text-left">Date</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.event.date_begin | date:"d-m-Y" }}</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 }}{% else %}-{% endif %}</td>
<td class="text-right"><b>{{ score.total }}</b></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
There are no scores corresponding to your criterias
{% endif %}
</div>
</div>
</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], [3,1], [4,0]]
});
$('#score_table').DataTable({
scrollY: 500,
scrollCollapse: true,
paging: false,
searching: false,
ordering: false,
// "bInfo" : false,
});
});
</script>
{% endblock %}