Update well being list

This commit is contained in:
Gregory Trullemans 2023-07-10 13:40:45 +02:00
parent 289492d486
commit 32c2fb0f0e
1 changed files with 19 additions and 11 deletions

View File

@ -7,12 +7,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>
<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="{% url 'wellbeing_create_for_gymnast' gymnast.id %}">
<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>
@ -23,32 +23,40 @@
</div>
<div class="card-body">
{% if wellbeing_list %}
<table class="table tablesorter table-striped mb-0" data-sort="table" id="wellbeing_table">
<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>
<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 state in wellbeing_list %}
{% for wellbeing in wellbeing_list %}
<tr>
<td>
<a href="{% url 'wellbeing_update' state.id %}">
<a href="{% url 'wellbeing_update' wellbeing.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>
<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 }}</a></td>
<td class="text-right">{{ wellbeing.mindstate }}</td>
<td class="text-right">{{ wellbeing.sleep }}</td>
<td class="text-right">{{ wellbeing.stress }}</td>
<td class="text-right">{{ wellbeing.fatigue }}</td>
<td class="text-right">{{ wellbeing.muscle_soreness }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="text-muted">There are no wellbeings corresponding to your criterias</p>
<p class="text-muted">There are no well being corresponding to your criterias</p>
{% endif %}
</div>
</div>
@ -67,7 +75,7 @@
sortList: [[1, 1]]
});
$('#wellbeing_table').DataTable({
$('#mindstate_table').DataTable({
scrollY: 500,
scrollCollapse: true,
paging: false,