Jarvis/jarvis/people/templates/gymnasts/list.html

93 lines
3.9 KiB
HTML

{% extends "listing.html" %}
{% load has_group %}
{% block datacontent %}
<div class="card mb-0">
<div class="card-header">
<div class="row">
<div class="col-4">
<h4 class=""> Gymnast Listing</h4>
</div>
<div class="col-1 ml-auto">
<div class="text-right">
{% if request.user|has_group:"trainer" %}
<a href="{% url 'gymnast_create' %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="fas fa-plus"></i>
</button>
</a>
{% endif %}
</div>
</div>
</div>
</div>
<div class="card-body pt-0">
<div class="table-responsive">
{% if season_information_list %}
<table class="table tablesorter table-striped" data-sort="table" id="gymnast_table">
<thead>
<tr>
{% if request.user|has_group:"trainer" %}
<th style="width: 3%"></th>
{% endif %}
<th class="header text-left" style="width: 20%">Lastname</th>
<th class="header text-left" style="width: 20%">Firstname</th>
<th class="header text-left" style="width: 10%">Gender</th>
<th class="header text-left" style="width: 10%">Age</th>
<th class="header text-left" style="width: 10%">Category</th>
<th class="header text-left" style="width: 25%">Club</th>
</tr>
</thead>
<tbody>
{% for season_information in season_information_list %}
<tr role="row" class="{% cycle 'odd' 'even' %}">
{% if request.user|has_group:"trainer" %}
<td>
<a href="{% url 'gymnast_update' season_information.gymnast.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
{% endif %}
<td class="text-left"><a href="{% url 'gymnast_details' season_information.gymnast.id %}">{{ season_information.gymnast.last_name }}</a></td>
<td class="text-left"><a href="{% url 'gymnast_details' season_information.gymnast.id %}">{{ season_information.gymnast.first_name }}</a></td>
<td class="text-left">{{ season_information.gymnast.get_gender_display }}</td>
<td class="text-left">{{ season_information.gymnast.age }}</td>
<td class="text-left">{{ season_information.get_category_display }}</td>
<td class="text-left">{{ season_information.club.name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
There are no gymnast corresponding to your criterias.
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% block footerscript %}
<script type="text/javascript">
$(document).ready(function () {
$('#gymnast_table').tablesorter({
{% if request.user|has_group:"trainer" %}
headers: {
0: { sorter: false }, // disable first column
},
sortList: [[1, 0], [2, 0]],
{% else %}
sortList: [[0, 0], [1, 0]],
{% endif %}
});
$('#gymnast_table').DataTable({
scrollY: 500,
scrollCollapse: true,
paging: false,
searching: false,
ordering: false,
// "bInfo" : false,
});
});
</script>
{% endblock %}