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

110 lines
5.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="">Well being 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 'wellbeing_create_for_gymnast' gymnast.id %}{% else %}{% url 'wellbeing_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 wellbeing_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-center">Mindstate</th>
<th class="header text-center">Sleep</th>
<th class="header text-center">Stress</th>
<th class="header text-center">Fatigue</th>
<th class="header text-center">Muscle soreness</th>
</tr>
</thead>
<tbody>
{% for wellbeing in wellbeing_list %}
<tr>
<td>
<a href="{% url 'wellbeing_update' wellbeing.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
<td class="text-left"><a href="{% url 'wellbeing_details' wellbeing.id %}">{{ wellbeing.date | date:"d-m-Y" }}</a></td>
<td class="text-left">
<a href="{% url 'gymnast_details_tab' wellbeing.gymnast.id 'physiological' %}">
{{ wellbeing.gymnast }}</td>
<td class="text-right">
{% if wellbeing.mindstate < 5%}<b><span class="text-danger">{% endif %}
{{ wellbeing.mindstate }}
{% if wellbeing.mindstate < 5%}</b></span>{% endif %}
</td>
<td class="text-right">
{% if wellbeing.sleep < 5%}<b><span class="text-danger">{% endif %}
{{ wellbeing.sleep }}
{% if wellbeing.sleep < 5%}</b></span>{% endif %}
</td>
<td class="text-right">
{% if wellbeing.stress > 5%}<b><span class="text-danger">{% endif %}
{{ wellbeing.stress }}
{% if wellbeing.stress > 5%}</b></span>{% endif %}
</td>
<td class="text-right">
{% if wellbeing.fatigue > 5%}<b><span class="text-danger">{% endif %}
{{ wellbeing.fatigue }}
{% if wellbeing.fatigue > 5%}</b></span>{% endif %}
</td>
<td class="text-right">
{% if wellbeing.muscle_soreness > 5%}<b><span class="text-danger">{% endif %}
{{ wellbeing.muscle_soreness }}
{% if wellbeing.muscle_soreness > 5%}</b></span>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="text-muted">There are no well being 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 %}