Update periodical report

This commit is contained in:
Gregory Trullemans 2023-11-29 13:16:11 +01:00
parent daf9afec7d
commit 95226c4271
2 changed files with 49 additions and 0 deletions

View File

@ -57,6 +57,7 @@
{% endif %}
</div>
</div>
<br />
<div class="row">
<div class="col-4">
<h4 class="mb-1">Physiological</h4>
@ -162,6 +163,51 @@
No intensty for selected period.
{% endif %}
</div>
<div class="col-12">
<h4 class="mb-1">Intensity</h4>
{% if injuries_list %}
<table class="table" id="injury_table">
<thead class="text-primary">
<tr>
<th class="header text-left" style="width: 7%">Date</th>
<th class="header text-left" style="width: 20%">Gymnast</th>
<th class="header text-left" style="width: 10%">Mechanism</th>
<th class="header text-left" style="width: 20%">Location</th>
<th class="header text-left" style="width: 10%">Side</th>
<th style="width: 20%">Skill</th>
<th style="width: 8%"># Week off</th>
</tr>
</thead>
<tbody>
{% for injury in injuries_list %}
<tr role="row" class="{% cycle 'odd' 'even' %}">
<td class="text-left">{{ injury.date | date:"d-m-Y" }}</td>
<td class="text-left">{{ injury.gymnast }}</td>
<td class="text-left">{{ injury.get_mechanism_display }}</td>
<td class="text-left">{{ injury.location }}</td>
<td class="text-left">{{ injury.get_body_side_display }}</td>
<td class="text-left">
{% if injury.skill %}
{{ injury.skill }}
{% else %}
-
{% endif %}
</td>
<td class="text-right">
{% if injury.nb_week_off %}
{{ injury.nb_week_off }}
{% else %}
-
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="muted-text">There are no injury corresponding to your criterias.</p>
{% endif %}
</div>
</div>
<br />
<div class="row">

View File

@ -1003,6 +1003,8 @@ def generate_report_for_period(
max_number_of_passes_value=Max("number_of_passes"),
)
injury_list = gymnast.injuries.filter(date__gte=date_begin, date__lte=date_end)
# BEST TOF
number_of_tof_straightjump = Chrono.objects.filter(
gymnast=gymnast, date__gte=date_begin, date__lte=date_end, chrono_type=0
@ -1236,6 +1238,7 @@ def generate_report_for_period(
# MEDICAL INFORMATIONS
"wellbeing_score": wellbeing_score,
"height_weight_value": height_weight_value,
"injury_list": injury_list,
# INTENSITY
"intensity_value": intensity_value,
# TOF