2023-04-25 17:06:14 +02:00
|
|
|
{% 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">
|
2024-02-04 08:34:31 +01:00
|
|
|
<h4 class="">
|
2024-04-07 19:45:39 +02:00
|
|
|
{% if gymnast %}
|
2024-04-19 11:01:23 +02:00
|
|
|
{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
|
|
|
|
<a href="{% url 'gymnast_details_tab' gymnast.id 'routine' %}">
|
|
|
|
{% endif %}
|
|
|
|
{{ gymnast }}
|
|
|
|
{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
|
|
|
|
</a>
|
|
|
|
{% endif %}'s
|
|
|
|
{% endif %} routine done
|
2024-02-04 08:34:31 +01:00
|
|
|
</h4>
|
2023-04-25 17:06:14 +02:00
|
|
|
</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>
|
2024-04-07 19:45:39 +02:00
|
|
|
<td class="text-center">
|
|
|
|
{{ routine_done.date | date:"d-m-Y"}}
|
|
|
|
</td>
|
|
|
|
<td class="text-center">
|
|
|
|
{{ routine_done.get_routine_type_display }}
|
|
|
|
</td>
|
2023-04-25 17:06:14 +02:00
|
|
|
<td class="text-left">
|
|
|
|
{% if routine_done.routine %}
|
2024-04-19 11:01:23 +02:00
|
|
|
<a href="{% url 'combination_details' routine_done.routine.id %}">
|
|
|
|
{{ routine_done.routine.long_label }}
|
|
|
|
</a>
|
2023-04-25 17:06:14 +02:00
|
|
|
{% else %}
|
2024-04-19 11:01:23 +02:00
|
|
|
-
|
2023-04-25 17:06:14 +02:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
2024-04-07 19:45:39 +02:00
|
|
|
<td class="text-center">
|
|
|
|
{{ routine_done.number_of_try }}
|
|
|
|
</td>
|
|
|
|
<td class="text-center">
|
|
|
|
{{ routine_done.number_of_successes }}
|
|
|
|
</td>
|
2023-04-25 17:06:14 +02:00
|
|
|
</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 },
|
|
|
|
},
|
2024-05-05 12:58:50 +02:00
|
|
|
dateFormat : "ddmmyyyy",
|
2023-04-25 17:06:14 +02:00
|
|
|
sortList: [[1, 1]]
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#routine_done_table').DataTable({
|
2024-01-25 16:04:30 +01:00
|
|
|
scrollY: '50vh',
|
2023-04-25 17:06:14 +02:00
|
|
|
scrollCollapse: true,
|
|
|
|
paging: false,
|
|
|
|
searching: false,
|
|
|
|
ordering: false,
|
|
|
|
// "bInfo" : false,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|