diff --git a/jarvis/followup/admin.py b/jarvis/followup/admin.py index 5487722..ebbb497 100644 --- a/jarvis/followup/admin.py +++ b/jarvis/followup/admin.py @@ -121,21 +121,14 @@ class InjuryAdmin(admin.ModelAdmin): "mechanism", "nb_week_off", "informations", - ) + ) # educative readonly_fields = ("season", "week_number", "created_at", "updated_at") - list_display = ( - "date", - "gymnast", - "mechanism", - "location", - "body_side", - "nb_week_off", - ) + list_display = ("date", "gymnast", "skill") # educative list_filter = ( ("gymnast", RelatedDropdownFilter), - ("mechanism", DropdownFilter), ("location", RelatedDropdownFilter), ("body_side", DropdownFilter), + ("mechanism", DropdownFilter), ) date_hierarchy = "date" search_fields = ("date", "gymnast") # educative diff --git a/jarvis/followup/forms.py b/jarvis/followup/forms.py index a4c8393..79cfdd3 100644 --- a/jarvis/followup/forms.py +++ b/jarvis/followup/forms.py @@ -192,7 +192,6 @@ class InjuryForm(forms.ModelForm): "location", "body_side", "nb_week_off", - "diagnosis", "informations", ) widgets = { @@ -212,16 +211,10 @@ class InjuryForm(forms.ModelForm): "nb_week_off": forms.NumberInput( attrs={"class": "form-control", "placeholder": "xx"} ), - "diagnosis": forms.Textarea( - attrs={ - "class": "form-control", - "placeholder": "Informations about diagnosis", # pylint: disable=line-too-long - } - ), "informations": forms.Textarea( attrs={ "class": "form-control", - "placeholder": "Informations about injury: consequencies, re-education exercices, …", # pylint: disable=line-too-long + "placeholder": "Informations about injury: context (why, where, …), consequencies, re-education exercices, …", # pylint: disable=line-too-long } ), } diff --git a/jarvis/followup/migrations/0052_injury_location.py b/jarvis/followup/migrations/0052_injury_location.py index d901d06..c54285b 100644 --- a/jarvis/followup/migrations/0052_injury_location.py +++ b/jarvis/followup/migrations/0052_injury_location.py @@ -15,6 +15,7 @@ class Migration(migrations.Migration): model_name="injury", name="location", field=models.ForeignKey( + # default=1, on_delete=django.db.models.deletion.CASCADE, related_name="injuries", to="followup.injurylocation", @@ -23,5 +24,6 @@ class Migration(migrations.Migration): null=True, blank=True, ), + # preserve_default=False, ), ] diff --git a/jarvis/followup/migrations/0056_alter_injury_location.py b/jarvis/followup/migrations/0056_alter_injury_location.py deleted file mode 100644 index e16777a..0000000 --- a/jarvis/followup/migrations/0056_alter_injury_location.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 4.2 on 2023-07-08 17:53 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ("followup", "0055_alter_injury_body_side"), - ] - - operations = [ - migrations.AlterField( - model_name="injury", - name="location", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="injuries", - to="followup.injurylocation", - verbose_name="Location", - ), - ), - ] diff --git a/jarvis/followup/migrations/0057_injury_diagnosis.py b/jarvis/followup/migrations/0057_injury_diagnosis.py deleted file mode 100644 index 1746ac9..0000000 --- a/jarvis/followup/migrations/0057_injury_diagnosis.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 4.2 on 2023-07-08 18:06 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("followup", "0056_alter_injury_location"), - ] - - operations = [ - migrations.AddField( - model_name="injury", - name="diagnosis", - field=models.TextField( - blank=True, - help_text="Only normal text is authorized", - null=True, - verbose_name="Diagnosis", - ), - ), - ] diff --git a/jarvis/followup/models.py b/jarvis/followup/models.py index ff27f4c..d04d619 100644 --- a/jarvis/followup/models.py +++ b/jarvis/followup/models.py @@ -223,12 +223,6 @@ class Injury(Markdownizable, Seasonisable): mechanism = models.PositiveSmallIntegerField( choices=INJURY_MECHANISM_CHOICE, verbose_name="Injury mechanism" ) - diagnosis = models.TextField( - null=True, - blank=True, - verbose_name="Diagnosis", - help_text="Only normal text is authorized", - ) nb_week_off = models.SmallIntegerField( blank=True, null=True, verbose_name="# week off" ) @@ -236,10 +230,10 @@ class Injury(Markdownizable, Seasonisable): updated_at = models.DateTimeField(auto_now=True) def __str__(self): - return f"{self.gymnast} ({self.date}): {self.mechanism} on {self.location} {self.body_side}" + return f"{self.gymnast} ({self.date})" def timeline_representation(self): - return f"
  • {self.date:%d %b %Y} - Injury ({self.skill}): {self.nb_week_off} (weeks off)
  • " + return f"
  • {self.date:%d %b %Y} - Accident ({self.skill}): {self.nb_week_off} (weeks off)
  • " class LearnedSkill(Seasonisable): diff --git a/jarvis/followup/templates/heightweight/create.html b/jarvis/followup/templates/heightweight/create.html index bc33c87..b02bb6e 100644 --- a/jarvis/followup/templates/heightweight/create.html +++ b/jarvis/followup/templates/heightweight/create.html @@ -7,7 +7,7 @@
    -

    {% if heightweight_id %}Edit{% else %}Add{% endif %} height & weight

    +

    {% if heightweight_id %}Edit{% else %}Add{% endif %} height/weight couple

    {% if form.errors %} diff --git a/jarvis/followup/templates/heightweight/list.html b/jarvis/followup/templates/heightweight/list.html index 51cd6ca..ac0dadd 100644 --- a/jarvis/followup/templates/heightweight/list.html +++ b/jarvis/followup/templates/heightweight/list.html @@ -7,7 +7,7 @@
    -

    Height & Weight list {% if gymnast %}for {{ gymnast }}{% endif %}

    +

    Height/Weight list {% if gymnast %}for {{ gymnast }}{% endif %}

    diff --git a/jarvis/followup/templates/injuries/list.html b/jarvis/followup/templates/injuries/list.html index 5cfc872..9af4dc4 100644 --- a/jarvis/followup/templates/injuries/list.html +++ b/jarvis/followup/templates/injuries/list.html @@ -30,7 +30,7 @@ Mechanism Location Side - Skill + Skill # Week off @@ -49,7 +49,7 @@ {{ injury.get_body_side_display }} {% if injury.skill %} - {{ injury.skill.notation }} + {{ injury.skill }} {% else %} - {% endif %} diff --git a/jarvis/followup/templates/wellbeing/create.html b/jarvis/followup/templates/wellbeing/create.html index af0f69c..f155115 100644 --- a/jarvis/followup/templates/wellbeing/create.html +++ b/jarvis/followup/templates/wellbeing/create.html @@ -54,8 +54,8 @@ {{ form.mindstate }} {% if form.mindstate.errors %} {% for error in form.mindstate.errors %}{{ error }}{% endfor %}{% endif %}
    -
    -

    (1: Very Bad - 10: Very Good)

    +
    +

    (1: Very Bad - 10: Very Good)

    @@ -65,7 +65,7 @@ {% if form.sleep.errors %} {% for error in form.sleep.errors %}{{ error }}{% endfor %}{% endif %}
    -

    (1: Very Bad - 10: Very Good)

    +

    (1: Very Bad - 10: Very Good)

    @@ -75,7 +75,7 @@ {% if form.stress.errors %} {% for error in form.stress.errors %}{{ error }}{% endfor %}{% endif %}
    -

    (1: Very Low - 10: Very High)

    +

    (1: Very Low - 10: Very High)

    @@ -85,7 +85,7 @@ {% if form.fatigue.errors %} {% for error in form.fatigue.errors %}{{ error }}{% endfor %}{% endif %}
    -

    (1: Very Low - 10: Very High)

    +

    (1: Very Low - 10: Very High)

    @@ -95,7 +95,7 @@ {% if form.muscle_soreness.errors %} {% for error in form.muscle_soreness.errors %}{{ error }}{% endfor %}{% endif %}
    -

    (1: Very Low - 10: Very High)

    +

    (1: Very Low - 10: Very High)

    diff --git a/jarvis/followup/views.py b/jarvis/followup/views.py index a9e18b1..68ffbcb 100644 --- a/jarvis/followup/views.py +++ b/jarvis/followup/views.py @@ -1471,7 +1471,9 @@ def season_information_create_or_update( ) ) else: - return render(request, "seasoninformations/create.html", {"form": form}) + return render( + request, "followup/seasoninformations/create.html", {"form": form} + ) form = SeasonInformationForm(instance=season_information, initial=data) context = {"form": form, "season_information_id": season_information_id} diff --git a/jarvis/people/templates/gymnasts/details.html b/jarvis/people/templates/gymnasts/details.html index 8bb0663..8919136 100644 --- a/jarvis/people/templates/gymnasts/details.html +++ b/jarvis/people/templates/gymnasts/details.html @@ -25,7 +25,7 @@

    {{ last_season_information.club.name }}
    - {{ gymnast.birthdate.year }} - {{ last_season_information.get_category_display }} + {{ last_season_information.get_category_display }}

    @@ -35,8 +35,7 @@ {% if height_weight %} {{ height_weight.0.height }}cm - {{ height_weight.0.weight }}kg ({{ height_weight.0.date | date:"d-m-Y" }})
    {% endif %} - Training: {{ last_season_information.number_of_training_sessions_per_week }}/week ({{ last_season_information.number_of_hours_per_week }} hours)
    - S&C: {{ last_season_information.number_of_s_and_c_sessions_per_week }}/week({{ last_season_information.number_of_s_and_c_hours_per_week }} hours)
    + {{ last_season_information.number_of_training_sessions_per_week }} training/week for {{ last_season_information.number_of_hours_per_week }} hours/week

    {% if user_is_trainer and gymnast.informations %}

    {{ gymnast.to_markdown | safe }}

    @@ -46,7 +45,7 @@ 10 | : {% if best_straightjump %}{{ best_straightjump.0.tof }} ({{ best_straightjump.0.date | date:"d-m-Y" }}){% else %} (no information){% endif %}
  • - Q1R1 : {% if best_routine %}{{ best_routine.0.tof }} ({{ best_routine.0.date | date:"d-m-Y" }}){% else %} (no information){% endif %} + Routine : {% if best_routine %}{{ best_routine.0.tof }} ({{ best_routine.0.date | date:"d-m-Y" }}){% else %} (no information){% endif %}
  • {% if user_is_trainer %} Add season details - diff --git a/jarvis/people/templates/gymnasts/tabs/tab_physiological.html b/jarvis/people/templates/gymnasts/tabs/tab_physiological.html index 234382f..72be306 100644 --- a/jarvis/people/templates/gymnasts/tabs/tab_physiological.html +++ b/jarvis/people/templates/gymnasts/tabs/tab_physiological.html @@ -3,7 +3,7 @@
    -

    Height & Weight

    +

    Height/Weight

    {% if height_weight_list %} @@ -77,7 +77,7 @@ Type Location Side - Skill + Skill # Week Off @@ -94,7 +94,7 @@ {{ injury.type }} {{ injury.location }} {{ injury.get_body_side_display }} - {% if injury.skill %}{{ injury.skill.notation }}{% else %}-{% endif %} + {% if injury.skill %}{{ injury.skill }}{% else %}-{% endif %} {{ injury.nb_week_off }} {% endfor %} @@ -236,19 +236,12 @@ gradient_stroke_green.addColorStop(0.5, 'rgba(75, 192, 192, 0.2)'); gradient_stroke_green.addColorStop(0.25, 'rgba(75, 192, 192, 0)'); - var border_color_blue = 'rgb(54, 162, 235)'; - var gradient_stroke_blue = ctx.createLinearGradient(0, 230, 0, 50); - gradient_stroke_blue.addColorStop(1, 'rgba(54, 162, 235, 0.4)'); - gradient_stroke_blue.addColorStop(0.75, 'rgba(54, 162, 235, 0.3)'); - gradient_stroke_blue.addColorStop(0.5, 'rgba(54, 162, 235, 0.2)'); - gradient_stroke_blue.addColorStop(0.25, 'rgba(54, 162, 235, 0)'); - - var border_color_yellow = 'rgb(255, 205, 86)'; - var gradient_stroke_yellow = ctx.createLinearGradient(0, 230, 0, 50); - gradient_stroke_yellow.addColorStop(1, 'rgba(255, 205, 86, 0.4)'); - gradient_stroke_yellow.addColorStop(0.75, 'rgba(255, 205, 86, 0.3)'); - gradient_stroke_yellow.addColorStop(0.5, 'rgba(255, 205, 86, 0.2)'); - gradient_stroke_yellow.addColorStop(0.25, 'rgba(255, 205, 86, 0)'); + var border_color_4 = 'rgb(54, 162, 235)'; + var gradient_stroke_4 = ctx.createLinearGradient(0, 230, 0, 50); + gradient_stroke_4.addColorStop(1, 'rgba(54, 162, 235, 0.4)'); + gradient_stroke_4.addColorStop(0.75, 'rgba(54, 162, 235, 0.3)'); + gradient_stroke_4.addColorStop(0.5, 'rgba(54, 162, 235, 0.2)'); + gradient_stroke_4.addColorStop(0.25, 'rgba(54, 162, 235, 0)'); var mindstate_values = [ {% for wellbeing in wellbeing_list %} @@ -327,21 +320,12 @@ { label: 'Fatigue', cubicInterpolationMode: 'monotone', - backgroundColor: gradient_stroke_blue, - borderColor: border_color_blue, - pointBackgroundColor: border_color_blue, + backgroundColor: gradient_stroke_4, + borderColor: border_color_4, + pointBackgroundColor: border_color_4, fill: true, data: fatigue_values, }, - { - label: 'Muscle', - cubicInterpolationMode: 'monotone', - backgroundColor: gradient_stroke_yellow, - borderColor: border_color_yellow, - pointBackgroundColor: border_color_yellow, - fill: true, - data: muscle_soreness_values, - }, ], };