90 lines
3.4 KiB
HTML
90 lines
3.4 KiB
HTML
|
{% extends "listing.html" %}
|
||
|
|
||
|
{% block datacontent %}
|
||
|
<div class="card mb-0">
|
||
|
<div class="card-header">
|
||
|
<div class="row">
|
||
|
<div class="col-md-4">
|
||
|
<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="fas fa-plus"></i>
|
||
|
</button>
|
||
|
</a>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="card-body">
|
||
|
<div class="table-responsive">
|
||
|
{% if accident_list %}
|
||
|
<table class="table tablesorter table-striped" data-sort="table" id="accident_table">
|
||
|
<thead class="text-primary">
|
||
|
<tr>
|
||
|
<th style="width: 3%"></th>
|
||
|
<th class="header text-left" style="width: 10%">Date</th>
|
||
|
<th class="header text-left" style="width: 30%">Gymnast</th>
|
||
|
<th style="width: 30%">Skill</th>
|
||
|
<th style="width: 25%"># Week off</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
{% for accident in accident_list %}
|
||
|
<tr role="row" class="{% cycle 'odd' 'even' %}">
|
||
|
<td>
|
||
|
<a href="{% url 'accident_update' accident.id %}">
|
||
|
<span class="tim-icons icon-pencil text-warning"></span>
|
||
|
</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_tab' accident.gymnast.id 'physiological' %}">{{ accident.gymnast }}</a></td>
|
||
|
<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>
|
||
|
</tr>
|
||
|
{% endfor %}
|
||
|
</tbody>
|
||
|
</table>
|
||
|
{% else %}
|
||
|
<p class="muted-text">There are no accident corresponding to your criterias.</p>
|
||
|
{% endif %}
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
{% endblock %}
|
||
|
|
||
|
{% block footerscript %}
|
||
|
<script type="text/javascript">
|
||
|
$(document).ready(function () {
|
||
|
$('#accident_table').tablesorter({
|
||
|
headers: {
|
||
|
0: { sorter: false }, // disable first column
|
||
|
},
|
||
|
dateFormat: "uk",
|
||
|
sortList: [[1, 1]]
|
||
|
});
|
||
|
|
||
|
$('#accident_table').DataTable({
|
||
|
scrollY: 500,
|
||
|
paging: false,
|
||
|
searching: false,
|
||
|
ordering: false,
|
||
|
"bInfo": false,
|
||
|
});
|
||
|
});
|
||
|
</script>
|
||
|
{% endblock %}
|