91 lines
3.9 KiB
HTML
91 lines
3.9 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="">Routine done list {% if gymnast %}for <a href="{% url 'gymnast_details_tab' gymnast.id 'routine' %}"><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 'routinedone_create' %}">
|
||
|
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
||
|
<i class="fas fa-plus"></i>
|
||
|
</button>
|
||
|
</a>
|
||
|
{% endif %}
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="card-body">
|
||
|
{% if routine_done_list %}
|
||
|
<table class="table tablesorter table-striped" data-sort="table" id="routine_done_table">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th style="width: 5%"></th>
|
||
|
<th style="width: 15%" class="header text-center">Date</th>
|
||
|
<th style="width: 15%" class="header text-left">Type</th>
|
||
|
<th style="width: 30%" class="header text-center">Routine</th>
|
||
|
<th style="width: 15%" class="header text-center"># Try</th>
|
||
|
<th style="width: 15%" class="header text-center"># Success</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
{% for routine_done in routine_done_list %}
|
||
|
<tr>
|
||
|
<td>
|
||
|
<a href="{% url 'routinedone_update' routine_done.id %}">
|
||
|
<span class="tim-icons icon-pencil text-warning"></span>
|
||
|
</a>
|
||
|
</td>
|
||
|
<td class="text-center">{{ routine_done.date | date:"d-m-Y"}}</td>
|
||
|
<td class="text-center">{{ routine_done.get_routine_type_display }}</td>
|
||
|
<td class="text-left">
|
||
|
{% if routine_done.routine %}
|
||
|
<a href="{% url 'routine_details' routine_done.routine.id %}">{{ routine_done.routine.long_label }}</a>
|
||
|
{% else %}
|
||
|
-
|
||
|
{% endif %}
|
||
|
</td>
|
||
|
<td class="text-center">{{ routine_done.number_of_try }}</td>
|
||
|
<td class="text-center">{{ routine_done.number_of_successes }}</td>
|
||
|
</tr>
|
||
|
{% endfor %}
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
{% else %}
|
||
|
<p class="text-muted">There are no routine's statistics associated to this gymnast.</p>
|
||
|
{% 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, 1]]
|
||
|
});
|
||
|
|
||
|
$('#routine_done_table').DataTable({
|
||
|
scrollY: 500,
|
||
|
scrollCollapse: true,
|
||
|
paging: false,
|
||
|
searching: false,
|
||
|
ordering: false,
|
||
|
// "bInfo" : false,
|
||
|
});
|
||
|
});
|
||
|
</script>
|
||
|
{% endblock %}
|