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

80 lines
3.2 KiB
HTML

{% extends "listing.html" %}
{% load has_group %}
{% block datacontent %}
<div class="row justify-content-center">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
<div class="card">
<div class="card-header row">
<div class="col-8">
<h4 class="">Mind State list {% if gymnast %}for <a href="{% url 'gymnast_details_tab' gymnast.id 'physiological' %}"><i>{{ gymnast }}</i></a>{% endif %}</h4>
</div>
<div class="col-1 ml-auto">
<div class="text-right">
{% if request.user|has_group:"trainer" %}
<a href="{% if gymnast %}{% url 'mindstate_create_for_gymnast' gymnast.id %}{% else %}{% url 'mindstate_create' %}{% endif %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="fas fa-plus"></i>
</button>
</a>
{% endif %}
</div>
</div>
</div>
<div class="card-body">
{% if mindstate_list %}
<table class="table tablesorter table-striped mb-0" data-sort="table" id="mindstate_table">
<thead>
<tr>
<th></th>
<th class="header text-left">Date</th>
<th class="header text-left">Gymnast</th>
<th class="header text-left">Score</th>
</tr>
</thead>
<tbody>
{% for state in mindstate_list %}
<tr>
<td>
<a href="{% url 'mindstate_update' state.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
<td class="text-left">{{ state.date | date:"d-m-Y" }}</td>
<td class="text-left"><a href="{% url 'gymnast_details_tab' state.gymnast.id 'physiological' %}">{{ state.gymnast }}</a></td>
<td>{{ state.score }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="text-muted">There are no mindstates corresponding to your criterias</p>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}
{% block footerscript %}
<script type="text/javascript">
$(document).ready(function () {
$('[data-sort="table"]').tablesorter({
headers: {
0: { sorter: false },
},
dateFormat: "uk",
sortList: [[1, 1]]
});
$('#mindstate_table').DataTable({
scrollY: 500,
scrollCollapse: true,
paging: false,
searching: false,
ordering: false,
// "bInfo" : false,
});
});
</script>
{% endblock %}