Jarvis/jarvis/objective/templates/combinations/list.html

101 lines
4.4 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-8">
<h4 class=""> {{ title }} Listing {% if gymnast_id %}for <i>{{ gymnast }}</i>{% endif %}</h4>
</div>
<div class="col-1 ml-auto">
<div class="text-right">
{% if request.user|has_group:"trainer" %}
<a href="{% url 'combination_create' %}">
<button type="submit" value="add" class="btn btn-icon btn-warning mb-0">
<i class="fas fa-plus"></i>
</button>
</a>
{% endif %}
</div>
</div>
</div>
</div>
<div class="card-body pt-0">
<div class="table-responsive">
{% if routine_list %}
<table class="table tablesorter table-striped" data-sort="table" id="routine_table">
<thead>
<tr>
{% if request.user|has_group:"trainer" %}
<th style="width: 3%"></th>
{% endif %}
<th class="header text-left" style="width: 35%">&nbsp;Long Label</th>
<th class="header text-left" style="width: 20%">&nbsp;Short Label</th>
<th class="text-center" style="width: 10%">Competitive ?</th>
<th class="header text-center"><i class="far fa-venus"></i></th>
<th class="header text-center"><i class="far fa-mars"></i></th>
<th class="header text-center" style="width: 7%">Diff.</th>
<th class="header text-center" style="width: 7%">Level</th>
<th class="header text-center" style="width: 7%">Rank</th>
</tr>
</thead>
<tbody>
{% for routine in routine_list %}
<tr role="row" class="{% cycle 'odd' 'even' %}">
{% if request.user|has_group:"trainer" %}
<td>
<a href="{% url 'combination_update' routine.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
{% endif %}
<td class="text-left"><a href="{% url 'combination_details' routine.id %}">{{ routine.long_label }}</a></td>
<td class="text-left"><a href="{% url 'combination_details' routine.id %}">{{ routine.short_label }}</a></td>
<td class="text-center">
{% if routine.is_competitive %}<i class="fa fa-check text-success" aria-hidden="true"></i>
{% else %}<i class="fa fa-times text-danger" aria-hidden="true"></i>
{% endif %}
</td>
<td class="text-center">{{ routine.age_girl_masterised }}</td>
<td class="text-center">{{ routine.age_boy_masterised }}</td>
<td class="text-center">{{ routine.difficulty }}</td>
<td class="text-center">{{ routine.level }}</td>
<td class="text-center">{{ routine.rank }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="muted-text">There are no {{ title|lower }} corresponding to your criterias.</p>
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% block footerscript %}
<script type="text/javascript">
$(document).ready(function () {
$('routine_table').tablesorter({
{% if request.user|has_group:"trainer" %}
headers: {
0: { sorter: false },
},
sortList: [[1, 0]],
{% else %}
sortList: [[0, 0]],
{% endif %}
});
$('#routine_table').DataTable({
scrollY: '50vh',
scrollCollapse: true,
paging: false,
searching: false,
ordering: false,
"bInfo": false,
});
});
</script>
{% endblock %}