2023-07-05 10:51:49 +02:00
{% 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" >
2024-01-25 10:56:59 +01:00
< div class = "col-10 pr-0" >
2024-02-04 08:34:31 +01:00
< h4 class = "" >
2024-02-11 12:18:11 +01:00
{% if gymnast %}< i > {% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}< a href = "{% url 'gymnast_details_tab' gymnast.id 'physiological' %}" > < i > {% endif %}{{ gymnast }}< / i > < / a > 's {% endif %} Well being list
2024-02-04 08:34:31 +01:00
< / h4 >
2023-07-05 10:51:49 +02:00
< / div >
2024-01-25 10:56:59 +01:00
< div class = "col-2 ml-auto pl-0" >
2023-07-05 10:51:49 +02:00
< 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 >
2024-01-25 10:56:59 +01:00
{% if not gymnast %}
2023-07-05 10:51:49 +02:00
< th class = "header text-left" > Gymnast< / th >
2024-01-25 10:56:59 +01:00
{% endif %}
2023-07-05 10:51:49 +02:00
< 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 >
2024-01-25 10:56:59 +01:00
< td class = "text-left" >
2024-02-11 12:18:11 +01:00
{% if wellbeing.gymnast.id in request.session.available_gymnast or request.user.is_superuser %}< a href = "{% url 'wellbeing_details' wellbeing.id %}" > {% endif %}{{ wellbeing.date | date:"j-n-Y" }}< / a >
2024-01-25 10:56:59 +01:00
< / td >
{% if not gymnast %}
2023-10-11 12:12:01 +02:00
< td class = "text-left" >
2024-02-11 12:18:11 +01:00
{% if wellbeing.gymnast.id in request.session.available_gymnast or request.user.is_superuser %}< a href = "{% url 'gymnast_details_tab' wellbeing.gymnast.id 'physiological' %}" > {% endif %}
2024-01-25 10:56:59 +01:00
{{ wellbeing.gymnast }}
< / a >
< / td >
{% endif %}
2023-10-11 12:12:01 +02:00
< 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" >
2023-10-12 12:31:34 +02:00
{% if wellbeing.stress > 5%}< b > < span class = "text-danger" > {% endif %}
2023-10-11 12:12:01 +02:00
{{ wellbeing.stress }}
2023-10-12 12:31:34 +02:00
{% if wellbeing.stress > 5%}< / b > < / span > {% endif %}
2023-10-11 12:12:01 +02:00
< / td >
< td class = "text-right" >
2023-10-12 12:31:34 +02:00
{% if wellbeing.fatigue > 5%}< b > < span class = "text-danger" > {% endif %}
2023-10-11 12:12:01 +02:00
{{ wellbeing.fatigue }}
2023-10-12 12:31:34 +02:00
{% if wellbeing.fatigue > 5%}< / b > < / span > {% endif %}
2023-10-11 12:12:01 +02:00
< / td >
< td class = "text-right" >
2023-10-12 12:31:34 +02:00
{% if wellbeing.muscle_soreness > 5%}< b > < span class = "text-danger" > {% endif %}
2023-10-11 12:12:01 +02:00
{{ wellbeing.muscle_soreness }}
2023-10-12 12:31:34 +02:00
{% if wellbeing.muscle_soreness > 5%}< / b > < / span > {% endif %}
2023-10-11 12:12:01 +02:00
< / td >
2023-07-05 10:51:49 +02:00
< / 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({
2024-01-25 16:04:30 +01:00
scrollY: '50vh',
2023-07-05 10:51:49 +02:00
scrollCollapse: true,
paging: false,
searching: false,
ordering: false,
2023-11-13 15:05:31 +01:00
"bInfo" : false,
2023-07-05 10:51:49 +02:00
});
});
< / script >
{% endblock %}