Jarvis/jarvis/followup/templates/injuries/list.html

116 lines
5.0 KiB
HTML
Raw Normal View History

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">
2024-04-20 16:47:16 +02:00
<div class="col-8">
2024-04-19 11:01:23 +02:00
<h4 class="">
{% if gymnast %}
{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
<a href="{% url 'gymnast_details_tab' gymnast.id 'physiological' %}">
{% endif %}
{{ gymnast }}
{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
</a>
{% endif %}'s
{% endif %} injuries
</h4>
2023-04-25 17:06:14 +02:00
</div>
2024-04-20 16:47:16 +02:00
<div class="col-4 ml-auto">
2023-04-25 17:06:14 +02:00
<div class="text-right">
2024-04-20 16:47:16 +02:00
<h3 class="mb-0"><a href="{% url 'injury_create' %}">
<i class="fas fa-plus text-warning"></i>
</a></h3>
2023-04-25 17:06:14 +02:00
</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">
2024-04-09 19:32:01 +02:00
{% if injury_list %}
2023-07-06 23:37:07 +02:00
<table class="table tablesorter table-striped" data-sort="table" id="injury_table">
2023-04-25 17:06:14 +02:00
<thead class="text-primary">
<tr>
<th style="width: 3%"></th>
2023-07-06 23:37:07 +02:00
<th class="header text-left" style="width: 8%">Date</th>
2024-04-09 19:32:01 +02:00
{% if not gymnast %}
<th class="header text-left" style="width: 20%">Gymnast</th>
{% endif %}
2023-07-06 23:37:07 +02:00
<th class="header text-left" style="width: 9%">Mechanism</th>
<th class="header text-left" style="width: 20%">Location</th>
<th class="header text-left" style="width: 8%">Side</th>
<th style="width: 20%">Skill</th>
2023-07-06 23:37:07 +02:00
<th style="width: 8%"># Week off</th>
2023-04-25 17:06:14 +02:00
</tr>
</thead>
<tbody>
2024-04-09 19:32:01 +02:00
{% for injury in injury_list %}
2023-04-25 17:06:14 +02:00
<tr role="row" class="{% cycle 'odd' 'even' %}">
<td>
2023-07-06 23:37:07 +02:00
<a href="{% url 'injury_update' injury.id %}">
2023-04-25 17:06:14 +02:00
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
2024-02-06 11:00:21 +01:00
<td class="text-left"><a href="{% url 'injury_details' injury.id %}">{{ injury.date | date:"j-n-Y" }}</a></td>
2024-04-09 19:32:01 +02:00
{% if not gymnast %}
<td class="text-left">
2024-04-19 11:01:23 +02:00
{% if injury.gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
<a href="{% url 'gymnast_details_tab' injury.gymnast.id 'physiological' %}">
{% endif %}
{{ injury.gymnast }}
{% if injury.gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
</a>
{% endif %}
2024-04-09 19:32:01 +02:00
</td>
{% endif %}
2023-07-06 23:37:07 +02:00
<td class="text-left">{{ injury.get_mechanism_display }}</td>
2024-01-21 15:12:50 +01:00
<td class="text-left">{{ injury.get_location_display }}</td>
2023-07-06 23:37:07 +02:00
<td class="text-left">{{ injury.get_body_side_display }}</td>
2023-04-25 17:06:14 +02:00
<td class="text-left">
2023-07-06 23:37:07 +02:00
{% if injury.skill %}
<a href="{% url 'skill_details' injury.skill.id %}">{{ injury.skill }}</a>
2023-04-25 17:06:14 +02:00
{% else %}
-
{% endif %}
</td>
<td class="text-right">
2023-07-06 23:37:07 +02:00
{% if injury.nb_week_off %}
{{ injury.nb_week_off }}
2023-04-25 17:06:14 +02:00
{% else %}
-
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
2023-07-06 23:37:07 +02:00
<p class="muted-text">There are no injury 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 () {
2023-07-06 23:37:07 +02:00
$('#injury_table').tablesorter({
2023-04-25 17:06:14 +02:00
headers: {
0: { sorter: false }, // disable first column
},
dateFormat: "uk",
sortList: [[1, 1]]
});
2023-07-06 23:37:07 +02:00
$('#injury_table').DataTable({
2024-01-25 17:51:07 +01:00
scrollY: '50vh',
2023-04-25 17:06:14 +02:00
paging: false,
searching: false,
ordering: false,
"bInfo": false,
});
});
</script>
{% endblock %}