diff --git a/jarvis/followup/models.py b/jarvis/followup/models.py index 24a14d7..bbb9845 100644 --- a/jarvis/followup/models.py +++ b/jarvis/followup/models.py @@ -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""" diff --git a/jarvis/followup/templates/intensities/details.html b/jarvis/followup/templates/intensities/details.html index 722ff33..b65e3db 100644 --- a/jarvis/followup/templates/intensities/details.html +++ b/jarvis/followup/templates/intensities/details.html @@ -6,7 +6,7 @@
-

{{ intensity.gymnast }}'s training intensity for the {{ intensity.date | date:"j F Y" }}

+

{{ intensity.gymnast }}'s training intensity for the {{ intensity.date | date:"j F Y" }}

Time
@@ -17,7 +17,7 @@
Difficulty
{{ intensity.difficulty }}
Average Diff/Skill
-
{{ intensity.mean_difficulty_by_skill | floatformat:3 }}
+
{{ intensity.mean_difficulty_by_skill_in_unit | floatformat:3 }}
Skill quantity
{{ intensity.quantity_of_skill }}
diff --git a/jarvis/followup/templates/intensities/list.html b/jarvis/followup/templates/intensities/list.html index 60adc24..8d718e0 100644 --- a/jarvis/followup/templates/intensities/list.html +++ b/jarvis/followup/templates/intensities/list.html @@ -53,7 +53,7 @@ {{ intensity.time }} - {{ intensity.difficulty }} + {{ intensity.difficulty_in_unit }} {{ intensity.quantity_of_skill }} {{ intensity.number_of_passes }} {{ intensity.mean_difficulty_by_passe | floatformat:2 }} diff --git a/jarvis/people/templates/gymnasts/tabs/tab_events_and_notes.html b/jarvis/people/templates/gymnasts/tabs/tab_events_and_notes.html index bba73af..6a38f4b 100644 --- a/jarvis/people/templates/gymnasts/tabs/tab_events_and_notes.html +++ b/jarvis/people/templates/gymnasts/tabs/tab_events_and_notes.html @@ -76,12 +76,9 @@ - {% if not note.status %} - {{ note.date | date:"j-m-Y" }} - {% else %} - {{ note.date | date:"j-m-Y" }} - {% endif %} -    + {% if not note.status %}{{ note.date | date:"j-m-Y" }} + {% else %}{{ note.date | date:"j-m-Y" }}{% endif %} +