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

109 lines
4.8 KiB
HTML

{% extends "listing.html" %}
{% block datacontent %}
<div class="card mb-0">
<div class="card-header">
<div class="row">
<div class="col-8">
<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 i{% else %}I{% endif %}njuries
</h4>
</div>
<div class="col-4 ml-auto">
<div class="text-right">
<h3 class="mb-0"><a href="{% url 'injury_create' %}">
<i class="fas fa-plus text-warning"></i>
</a></h3>
</div>
</div>
</div>
</div>
<div class="card-body pt-0 pb-0">
<div class="table-responsive pb-0">
{% if injury_list %}
<table class="table tablesorter table-striped" data-sort="table" id="injury_table">
<thead class="text-primary">
<tr>
<th style="width: 3%"></th>
<th class="header text-left" style="width: 8%">Date</th>
{% if not gymnast %}
<th class="header text-left" style="width: 20%">Gymnast</th>
{% endif %}
<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: 16%">Side</th>
<th style="width: 12%">Skill</th>
<th style="width: 8%"># Week off</th>
</tr>
</thead>
<tbody>
{% for injury in injury_list %}
<tr role="row" class="{% cycle 'odd' 'even' %}">
<td>
<a href="{% url 'injury_update' injury.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
<td class="text-left"><a href="{% url 'injury_details' injury.id %}">{{ injury.date | date:"j-n-Y" }}</a></td>
{% if not gymnast %}
<td class="text-left">
{% 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 %}
</td>
{% endif %}
<td class="text-left">{{ injury.get_mechanism_display }}</td>
<td class="text-left">{{ injury.get_location_display }}</td>
<td class="text-left">{{ injury.get_body_side_display }}</td>
<td class="text-left">
{% if injury.skill %}
<a href="{% url 'skill_details' injury.skill.id %}">{{ injury.skill.notation }}</a>
{% else %}
-
{% endif %}
</td>
<td class="text-right">
{% if injury.nb_week_off %}
{{ injury.nb_week_off }}
{% else %}
-
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="text-muted">There are no injury corresponding to your criterias.</p>
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% block footerscript %}
<script type="text/javascript">
$(document).ready(function () {
$('#injury_table').tablesorter({
headers: {
0: { sorter: false }, // disable first column
},
dateFormat : "ddmmyyyy",
sortList: [[1, 1]]
});
$('#injury_table').DataTable({
scrollY: '50vh',
paging: false,
searching: false,
ordering: false,
"bInfo": false,
});
});
</script>
{% endblock %}