Update Intensity table

This commit is contained in:
Gregory Trullemans 2023-11-14 09:34:33 +01:00
parent cb4c7b8f59
commit 1fc2d5e8d4
4 changed files with 14 additions and 9 deletions

View File

@ -572,6 +572,10 @@ class Intensity(Markdownizable, Seasonisable):
def __str__(self):
return f"{self.gymnast} - {self.date} : {self.time} - {self.difficulty} - {self.quantity_of_skill} - {self.number_of_passes}"
@property
def difficulty_in_unit(self):
return self.difficulty / 10
@property
def mean_difficulty_by_passe(self):
return self.difficulty / self.number_of_passes
@ -592,6 +596,10 @@ class Intensity(Markdownizable, Seasonisable):
def mean_difficulty_by_skill(self):
return self.difficulty / self.quantity_of_skill
@property
def mean_difficulty_by_skill_in_unit(self):
return (self.difficulty / 10) / self.quantity_of_skill
class SeasonInformation(models.Model):
"""Classe représentant l'intensité d'un entraînement"""

View File

@ -6,7 +6,7 @@
<div class="col-12 col-sm-8 col-md-6">
<div class="card">
<div class="card-header">
<h4 class="card-title mb-0"><a href="{% url 'gymnast_details_tab' intensity.gymnast.id 'physiological' %}">{{ intensity.gymnast }}</a>'s training intensity for the {{ intensity.date | date:"j F Y" }}</h4>
<h4 class="card-title mb-0"><a href="{% url 'gymnast_details_tab' intensity.gymnast.id 'routine' %}">{{ intensity.gymnast }}</a>'s training intensity for the {{ intensity.date | date:"j F Y" }}</h4>
</div>
<div class="card-body row">
<div class="col-3">Time</div>
@ -17,7 +17,7 @@
<div class="col-3">Difficulty</div>
<div class="col-3 text-right">{{ intensity.difficulty }}</div>
<div class="col-4"><b>Average Diff/Skill</b></div>
<div class="col-2 text-right"><b>{{ intensity.mean_difficulty_by_skill | floatformat:3 }}</b></div>
<div class="col-2 text-right"><b>{{ intensity.mean_difficulty_by_skill_in_unit | floatformat:3 }}</b></div>
<div class="col-3">Skill quantity</div>
<div class="col-3 text-right">{{ intensity.quantity_of_skill }}</div>

View File

@ -53,7 +53,7 @@
</a>
</td>
<td class="text-right">{{ intensity.time }}</td>
<td class="text-right">{{ intensity.difficulty }}</td>
<td class="text-right">{{ intensity.difficulty_in_unit }}</td>
<td class="text-right">{{ intensity.quantity_of_skill }}</td>
<td class="text-right">{{ intensity.number_of_passes }}</td>
<td class="text-right">{{ intensity.mean_difficulty_by_passe | floatformat:2 }}</td>

View File

@ -76,12 +76,9 @@
</a>
</td>
<td class="text-right">
{% if not note.status %}
<span class="text-danger">{{ note.date | date:"j-m-Y" }}</span>
{% else %}
{{ note.date | date:"j-m-Y" }}
{% endif %}
&nbsp;&nbsp;
{% if not note.status %}<span class="text-danger">{{ note.date | date:"j-m-Y" }}</span>
{% else %}{{ note.date | date:"j-m-Y" }}{% endif %}
&nbsp;
</td>
<td class="text-left">