2021-11-18 21:36:15 +01:00
|
|
|
{% extends "listing.html" %}
|
|
|
|
|
|
|
|
{% block datacontent %}
|
|
|
|
<div class="card mb-0">
|
|
|
|
<div class="card-header">
|
2021-12-01 07:56:54 +01:00
|
|
|
<div class="row">
|
2021-12-16 08:27:06 +01:00
|
|
|
<div class="col-md-4">
|
2021-12-01 07:56:54 +01:00
|
|
|
<h4 class=""> Accidents Listing</h4>
|
|
|
|
</div>
|
|
|
|
<div class="col-1 ml-auto">
|
|
|
|
<div class="text-right">
|
|
|
|
<a href="{% url 'accident_create' %}">
|
|
|
|
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
|
|
|
<i class="tim-icons icon-simple-add"></i>
|
|
|
|
</button>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-11-18 21:36:15 +01:00
|
|
|
</div>
|
2021-11-19 13:11:25 +01:00
|
|
|
<div class="card-body">
|
|
|
|
<div class="table-responsive">
|
2021-11-26 14:52:16 +01:00
|
|
|
{% if accident_list %}
|
2021-12-29 22:26:40 +01:00
|
|
|
<table class="table tablesorter table-striped" data-sort="table" id="accident_table">
|
2021-11-18 21:36:15 +01:00
|
|
|
<thead class="text-primary">
|
|
|
|
<tr>
|
|
|
|
<th style="width: 3%"></th>
|
2021-11-21 10:45:55 +01:00
|
|
|
<th class="header text-left" style="width: 10%">Date</th>
|
2021-11-28 15:05:00 +01:00
|
|
|
<th class="header text-left" style="width: 30%">Gymnast</th>
|
|
|
|
<th style="width: 30%">Skill</th>
|
|
|
|
<th style="width: 25%"># Week off</th>
|
2021-11-18 21:36:15 +01:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for accident in accident_list %}
|
2021-12-29 22:26:40 +01:00
|
|
|
<tr role="row" class="{% cycle 'odd' 'even' %}">
|
2021-11-18 21:36:15 +01:00
|
|
|
<td>
|
|
|
|
<a href="{% url 'accident_update' accident.id %}">
|
2021-12-29 22:26:40 +01:00
|
|
|
<span class="tim-icons icon-pencil text-warning"></span>
|
2021-11-18 21:36:15 +01:00
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td class="text-left"><a href="{% url 'accident_details' accident.id %}">{{ accident.date | date:"d-m-Y" }}</a></td>
|
|
|
|
<td class="text-left"><a href="{% url 'gymnast_details' accident.gymnast.id %}">{{ accident.gymnast }}</a></td>
|
2021-11-28 15:05:00 +01:00
|
|
|
<td class="text-left">
|
|
|
|
{% if accident.skill %}
|
|
|
|
<a href="{% url 'skill_details' accident.skill.id %}">{{ accident.skill }}</a>
|
|
|
|
{% else %}
|
|
|
|
-
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td class="text-right">
|
|
|
|
{% if accident.nb_week_off %}
|
|
|
|
{{ accident.nb_week_off }}
|
|
|
|
{% else %}
|
|
|
|
-
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
2021-11-18 21:36:15 +01:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{% else %}
|
2021-12-29 22:26:40 +01:00
|
|
|
<p class="muted-text">There are no accident corresponding to your criterias.</p>
|
2021-11-18 21:36:15 +01:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block footerscript %}
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
2021-12-29 22:26:40 +01:00
|
|
|
$('#accident_table').tablesorter({
|
2021-11-18 21:36:15 +01:00
|
|
|
headers: {
|
|
|
|
0: { sorter: false }, // disable first column
|
|
|
|
},
|
|
|
|
dateFormat: "uk",
|
|
|
|
sortList: [[1,1]]
|
2021-12-29 22:26:40 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$('#accident_table').DataTable({
|
|
|
|
paging: false,
|
|
|
|
searching: false,
|
|
|
|
ordering: false,
|
|
|
|
"bInfo" : false,
|
|
|
|
});
|
2021-11-18 21:36:15 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|