2023-04-25 17:06:14 +02:00
|
|
|
{% extends "listing.html" %}
|
|
|
|
|
|
|
|
{% block datacontent %}
|
|
|
|
<div class="card mb-0">
|
|
|
|
<div class="card-header">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-8">
|
2024-02-04 08:34:31 +01:00
|
|
|
<h4 class="">
|
2024-04-19 11:01:23 +02:00
|
|
|
{% if gymnast %}
|
|
|
|
{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
|
|
|
|
<a href="{% url 'gymnast_details_tab' gymnast.id 'event' %}">
|
|
|
|
{% endif %}
|
|
|
|
{{ gymnast }}
|
|
|
|
{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
|
|
|
|
</a>
|
|
|
|
{% endif %}'s
|
|
|
|
{% endif %} notes
|
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">
|
|
|
|
<a href="{% if gymnast %}{% url 'note_create_for_gymnast' gymnast.id %}{% else %}{% url 'note_create' %}{% endif %}">
|
|
|
|
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
|
|
|
<i class="fas fa-plus"></i>
|
|
|
|
</button>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-04-20 20:00:53 +02:00
|
|
|
<div class="card-body pt-0 pb-0">
|
|
|
|
<div class="table-responsive pb-0">
|
2023-04-25 17:06:14 +02:00
|
|
|
{% if note_list %}
|
|
|
|
<table class="table table-striped tablesorter" id="chrono_table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th style="width: 5%"> </th>
|
|
|
|
<th style="width: 10%" class="header">Date</th>
|
2024-04-07 18:53:32 +02:00
|
|
|
<th style="width: 35%" class="header text-left">Title</th>
|
|
|
|
{% if not gymnast %}
|
|
|
|
<th style="width: 15%" class="header text-left">Gymnast</th>
|
|
|
|
{% endif %}
|
|
|
|
<th style="width: 15%" class="header text-left">Coach</th>
|
2023-04-25 17:06:14 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for note in note_list %}
|
|
|
|
<tr role="row" class="{% cycle 'odd' 'even' %}">
|
2024-04-07 18:53:32 +02:00
|
|
|
<td class="text-left">
|
|
|
|
<a href="{% url 'note_update' note.id %}">
|
|
|
|
<span class="tim-icons icon-pencil text-warning"></span>
|
|
|
|
</a>
|
2023-04-25 17:06:14 +02:00
|
|
|
</td>
|
|
|
|
<td>
|
2024-04-07 18:53:32 +02:00
|
|
|
<a href="{% url 'note_details' note.id %}">
|
|
|
|
{{ note.created_at | date:"d-m-Y" }}
|
|
|
|
</a>
|
2023-04-25 17:06:14 +02:00
|
|
|
</td>
|
2024-04-07 18:53:32 +02:00
|
|
|
<td>{{ note.title }}</td>
|
|
|
|
{% if not gymnast %}
|
|
|
|
<td class="text-left">
|
|
|
|
{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
|
|
|
|
<a href="{% url 'gymnast_details' note.gymnast.id %}">
|
|
|
|
{% endif %}
|
|
|
|
{{ note.gymnast}}
|
|
|
|
{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
{% endif %}
|
2023-04-25 17:06:14 +02:00
|
|
|
<td class="text-left">{{ note.coach }}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{% else %}
|
2024-04-07 18:53:32 +02:00
|
|
|
<p class="text-muted">There are no chronos corresponding to your criterias.</p>
|
2023-04-25 17:06:14 +02:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block footerscript %}
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function () {
|
|
|
|
$('#chrono_table').tablesorter({
|
|
|
|
headers: {
|
|
|
|
0: { sorter: false },
|
|
|
|
},
|
|
|
|
dateFormat: "uk",
|
2024-04-07 18:53:32 +02:00
|
|
|
{% if not gymnast %}
|
|
|
|
sortList: [[1, 1], [3, 1], [2, 1]],
|
|
|
|
{% else %}
|
|
|
|
sortList: [[1, 1], [2, 1]],
|
|
|
|
{% endif %}
|
2023-04-25 17:06:14 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
$('#chrono_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,
|
2024-04-23 11:40:36 +02:00
|
|
|
"bInfo": false,
|
2023-04-25 17:06:14 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|