2023-04-25 17:06:14 +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">
|
|
|
|
<div class="col-8">
|
2023-10-11 12:13:33 +02:00
|
|
|
<h4 class="">Height/Weight list {% if gymnast %}for <a href="{% url 'gymnast_details_tab' gymnast.id 'physiological' %}"><i>{{ gymnast }}</i></a>{% endif %}</h4>
|
2023-04-25 17:06:14 +02:00
|
|
|
</div>
|
|
|
|
<div class="col-1 ml-auto">
|
|
|
|
<div class="text-right">
|
|
|
|
{% if request.user|has_group:"trainer" %}
|
|
|
|
<a href="{% if gymnast %}{% url 'heightweight_create_for_gymnast' gymnast.id %}{% else %}{% url 'heightweight_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 heightweight_list %}
|
|
|
|
<table class="table tablesorter table-striped mb-0" data-sort="table" id="heightweight_table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th class="header text-left">Date</th>
|
|
|
|
<th class="header text-left">Gymnast</th>
|
|
|
|
<th class="header text-left">Height</th>
|
|
|
|
<th class="header text-left">Hips height</th>
|
|
|
|
<th class="header text-left">Weight</th>
|
2023-11-21 09:10:28 +01:00
|
|
|
<th class="header text-left">BMI</th>
|
2023-04-25 17:06:14 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for heightweight in heightweight_list %}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<a href="{% url 'heightweight_update' heightweight.id %}">
|
|
|
|
<span class="tim-icons icon-pencil text-warning"></span>
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td class="text-left">{{ heightweight.date | date:"d-m-Y" }}</td>
|
|
|
|
<td class="text-left"><a href="{% url 'gymnast_details' heightweight.gymnast.id %}">{{ heightweight.gymnast }}</a></td>
|
|
|
|
<td>{{ heightweight.height }}</td>
|
2023-11-21 10:23:06 +01:00
|
|
|
<td>{% if heightweight.hips_height == None %}-{% else %}{{ heightweight.hips_height }}{% endif %}</td>
|
2023-04-25 17:06:14 +02:00
|
|
|
<td>{{ heightweight.weight }}</td>
|
2023-11-21 11:24:48 +01:00
|
|
|
<td>
|
|
|
|
{% if gymnast %}
|
|
|
|
{% if gymnast.gender == 0 %}
|
2023-11-21 11:28:26 +01:00
|
|
|
{% if heightweight.bmi < 19 %}
|
2023-11-21 11:24:48 +01:00
|
|
|
<span class="text-danger"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
|
|
|
|
{% elif heightweight.bmi < 21 %}
|
2023-11-21 11:28:26 +01:00
|
|
|
<span class="text-warning"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
|
2023-11-21 11:24:48 +01:00
|
|
|
{% elif heightweight.bmi < 23 %}
|
2023-11-21 11:28:26 +01:00
|
|
|
<span class="text-success"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
|
2023-11-21 11:24:48 +01:00
|
|
|
{% elif heightweight.bmi < 25 %}
|
2023-11-21 11:28:26 +01:00
|
|
|
<span class="text-warning"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
|
2023-11-21 11:24:48 +01:00
|
|
|
{% else %}
|
|
|
|
<span class="text-danger"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
2023-11-21 11:28:26 +01:00
|
|
|
{% if heightweight.bmi < 21 %}
|
2023-11-21 11:24:48 +01:00
|
|
|
<span class="text-danger"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
|
|
|
|
{% elif heightweight.bmi < 23 %}
|
2023-11-21 11:28:26 +01:00
|
|
|
<span class="text-warning"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
|
2023-11-21 11:24:48 +01:00
|
|
|
{% elif heightweight.bmi < 25 %}
|
2023-11-21 11:28:26 +01:00
|
|
|
<span class="text-success"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
|
2023-11-21 11:24:48 +01:00
|
|
|
{% elif heightweight.bmi < 27 %}
|
2023-11-21 11:28:26 +01:00
|
|
|
<span class="text-warning"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
|
2023-11-21 11:24:48 +01:00
|
|
|
{% else %}
|
|
|
|
<span class="text-danger"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
<b>{{ heightweight.bmi | floatformat:2 }}</b>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
2023-04-25 17:06:14 +02:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{% else %}
|
|
|
|
<p class="text-muted">There are no scores 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]]
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#heightweight_table').DataTable({
|
|
|
|
scrollY: 500,
|
|
|
|
scrollCollapse: true,
|
|
|
|
paging: false,
|
|
|
|
searching: false,
|
|
|
|
ordering: false,
|
2023-11-21 09:10:28 +01:00
|
|
|
"bInfo" : false,
|
2023-04-25 17:06:14 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|