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

96 lines
3.9 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">
<div class="col-md-4">
2023-07-06 23:37:07 +02:00
<h4 class=""> Injuries Listing</h4>
2023-04-25 17:06:14 +02:00
</div>
<div class="col-1 ml-auto">
<div class="text-right">
2023-07-06 23:37:07 +02:00
<a href="{% url 'injury_create' %}">
2023-04-25 17:06:14 +02:00
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="fas fa-plus"></i>
</button>
</a>
</div>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
2023-07-06 23:37:07 +02:00
{% if injuries_list %}
<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>
<th class="header text-left" style="width: 20%">Gymnast</th>
<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>
2023-07-06 23:37:07 +02:00
{% for injury in injuries_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>
2023-07-06 23:37:07 +02:00
<td class="text-left"><a href="{% url 'injury_details' injury.id %}">{{ injury.date | date:"d-m-Y" }}</a></td>
<td class="text-left"><a href="{% url 'gymnast_details_tab' injury.gymnast.id 'physiological' %}">{{ injury.gymnast }}</a></td>
<td class="text-left">{{ injury.get_mechanism_display }}</td>
<td class="text-left">{{ injury.location }}</td>
<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({
2023-04-25 17:06:14 +02:00
scrollY: 500,
paging: false,
searching: false,
ordering: false,
"bInfo": false,
});
});
</script>
{% endblock %}