Bugs fix, smartphone screen optimisation, …

This commit is contained in:
Gregory Trullemans 2024-01-29 16:14:51 +01:00
parent 5d17606d7a
commit 97660e6797
5 changed files with 38 additions and 30 deletions

View File

@ -589,11 +589,11 @@ class Intensity(Markdownizable, Seasonisable):
@property
def difficulty_quality(self):
return (self.difficulty_asked / self.difficulty) * 100
return (self.difficulty / self.difficulty_asked) * 100
@property
def quantity_of_skill_quality(self):
return (self.quantity_of_skill_asked / self.quantity_of_skill) * 100
return (self.quantity_of_skill / self.quantity_of_skill_asked) * 100
@property
def number_of_passes_quality(self):

View File

@ -14,7 +14,7 @@
{% csrf_token %}
<div class="form-group row ">
<label for="id_date" class="col-4 col-sm-3 col-form-label">Gymnast <span class="text-danger"><b>*</b></span></label>
<div class="col-sm-8 col-md-6 col-lg-6 col-xl-6 {% if form.jumper.errors %}has-danger{% endif %}">
<div class="col-8 col-sm-8 col-md-6 col-lg-6 col-xl-6 {% if form.jumper.errors %}has-danger{% endif %}">
{% if request.user|has_group:"trainer" %}
{{ form.gymnast }}
{{ form.gymnast_related }}
@ -27,14 +27,14 @@
</div>
<div class="form-group row ">
<label for="id_date" class="col-4 col-sm-3 col-form-label">{{ form.date.label }} <span class="text-danger"><b>*</b></span></label>
<div class="col-sm-3 col-md-4 col-lg-4 col-xl-4 {% if form.date.errors %}has-danger{% endif %}">
<div class="col-4 col-sm-3 col-md-4 col-lg-4 col-xl-4 {% if form.date.errors %}has-danger{% endif %}">
{{ form.date }}
{% if form.date.errors %}<span class="btn btn-sm btn-danger-outline">{% for error in form.date.errors %}{{ error }}{% endfor %}</span>{% endif %}
</div>
</div>
<div class="form-group row ">
<label for="id_skill" class="col-4 col-sm-3 col-form-label">Skill</label>
<div class="col-sm-8 col-md-6 col-lg-6 col-xl-6 {% if form.skill.errors %}has-danger{% endif %}">
<div class="col-8 col-sm-8 col-md-6 col-lg-6 col-xl-6 {% if form.skill.errors %}has-danger{% endif %}">
{{ form.skill }}
{{ form.skill_related }}
{% if form.skill.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.skill.errors %}{{ error }}{% endfor %}</span>{% endif %}
@ -42,21 +42,21 @@
</div>
<div class="form-group row ">
<label for="id_mechanism" class="col-4 col-sm-3 col-form-label">{{ form.mechanism.label }} <span class="text-danger"><b>*</b></span></label>
<div class="col-5 col-sm-3 col-md-4 col-lg-4 col-xl-4 {% if form.mechanism.errors %}has-danger{% endif %}">
<div class="col-4 col-sm-3 col-md-4 col-lg-4 col-xl-4 {% if form.mechanism.errors %}has-danger{% endif %}">
{{ form.mechanism }}
{% if form.mechanism.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.mechanism.errors %}{{ error }}{% endfor %}</span>{% endif %}
</div>
</div>
<div class="form-group row ">
<label for="id_injury_type" class="col-4 col-sm-3 col-form-label">{{ form.injury_type.label }}<span class="text-danger"><b>*</b></span></label>
<div class="col-sm-8 col-md-6 col-lg-6 col-xl-6 {% if form.injury_type.errors %}has-danger{% endif %}">
<div class="col-8 col-sm-6 col-md-8 col-lg-6 col-xl-8 {% if form.injury_type.errors %}has-danger{% endif %}">
{{ form.injury_type }}
{% if form.injury_type.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.injury_type.errors %}{{ error }}{% endfor %}</span>{% endif %}
</div>
</div>
<div class="form-group row ">
<label for="id_location" class="col-4 col-sm-3 col-form-label">{{ form.location.label }}<span class="text-danger"><b>*</b></span></label>
<div class="col-sm-8 col-md-6 col-lg-6 col-xl-6 {% if form.location.errors %}has-danger{% endif %}">
<div class="col-8 col-sm-5 col-md-6 col-lg-6 col-xl-6 {% if form.location.errors %}has-danger{% endif %}">
{{ form.location }}
{% if form.location.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.location.errors %}{{ error }}{% endfor %}</span>{% endif %}
</div>
@ -70,20 +70,16 @@
</div>
<div class="form-group row ">
<label for="id_nb_week_off" class="col-4 col-sm-3 col-form-label"># Week off</label>
<div class="col-sm-3 col-md-4 col-lg-2 {% if form.nb_week_off.errors %}has-danger{% endif %}">
<div class="col-3 col-sm-2 col-md-4 col-lg-2 col-xl-3 {% if form.nb_week_off.errors %}has-danger{% endif %}">
{{ form.nb_week_off }}
{% if form.nb_week_off.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.nb_week_off.errors %}{{ error }}{% endfor %}</span>{% endif %}
</div>
</div>
<div class="form-group row ">
<label for="id_diagnosis" class="col-4 col-sm-3 col-form-label">{{ form.diagnosis.label }}</label>
<div class="col-sm-9 col-md-9 col-lg-9 col-xl-9 {% if form.id_diagnosis.errors %}has-danger{% endif %}">
{{ form.diagnosis }}
</div>
</div>
<div class="form-group row ">
<label for="id_informations" class="col-4 col-sm-3 col-form-label">Commentaires</label>
<div class="col-sm-9 col-md-9 col-lg-9 col-xl-9 {% if form.informations.errors %}has-danger{% endif %}">
</div>
<div class="form-group row">
<div class="col-12 {% if form.id_informations.errors %}has-danger{% endif %}">
{{ form.informations }}
</div>
</div>

View File

@ -8,7 +8,7 @@
<div class="card-header">
<h4 class="mb-0"><a href="{% url 'gymnast_details_tab' injury.gymnast.id 'physiological' %}">{{ injury.gymnast }}</a> injuried on {{ injury.date | date:"j N Y" }}</h4>
</div>
<div class="card-body">
<div class="card-body pb-0">
{{ form.injury_type }} {{ injury.get_mechanism_display }} at {{ injury.get_location_display }} ({{ injury.get_body_side_display }}) {% if injury.skill %} injuried on <i>{{ injury.skill.notation }}</i>{% endif %}<br />
{% if injury.nb_week_off %}
Gymnast {{ injury.nb_week_off }} week(s) off.<br />
@ -17,15 +17,25 @@
<br />
{{ injury.to_markdown | safe }}
{% endif %}
</div>
<div class="card-footer pl-0 pb-0">
<div class="card-footer row">
<div class="col-6">
<a href="{% url 'injuries_list' %}">
<button type="submit" value="add" class="btn btn-icon btn-warning">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="tim-icons icon-double-left"></i>
</button>
</a>
</div>
<div class="col-6 col-1 ml-auto text-right">
<a href="{% url 'injury_update' injury.id %}">
<button type="submit" value="update" class="btn btn-icon btn-warning">
<i class="tim-icons icon-pencil"></i>
</button>
</a>
</div>
</div>
</div>
</div>
</div>

View File

@ -15,16 +15,16 @@
method="post" class="form-horizontal" id="formulaire" name="formulaire">
{% csrf_token %}
<div class="form-group row ">
<label for="id_date" class="col-4 col-sm-2 col-md-2 col-lg-3 col-xl-2 col-form-label pr-0">Gymnast <span class="text-danger"><b>*</b></span></label>
<div class="col-8 col-sm-9 col-md-9 col-lg-6 col-lg-8 col-xl-8 {% if form.jumper.errors %}has-danger{% endif %}">
<label for="id_date" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-2 col-form-label pr-0">Gymnast <span class="text-danger"><b>*</b></span></label>
<div class="col-8 col-sm-9 col-md-9 col-lg-9 col-lg-8 col-xl-8 {% if form.jumper.errors %}has-danger{% endif %}">
{{ form.gymnast }}
{{ form.gymnast_related }}
{% if form.gymnast.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.gymnast.errors %}{{ error }}{% endfor %}</span>{% endif %}
</div>
</div>
<div class="form-group row ">
<label for="id_date" class="col-4 col-sm-2 col-md-2 col-lg-3 col-xl-2 col-form-label pr-0">Date <span class="text-danger"><b>*</b></span></label>
<div class="col-5 col-sm-3 col-md-3 col-lg-4 col-xl-3 {% if form.date.errors %}has-danger{% endif %}">
<label for="id_date" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-2 col-form-label pr-0">Date <span class="text-danger"><b>*</b></span></label>
<div class="col-5 col-sm-3 col-md-4 col-lg-4 col-xl-3 {% if form.date.errors %}has-danger{% endif %}">
{{ form.date }}
{% if form.date.errors %}<span class="btn btn-sm btn-danger-outline">{% for error in form.date.errors %}{{ error }}{% endfor %}</span>{% endif %}
</div>
@ -36,8 +36,7 @@
{{ form.time }}
{% if form.time.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.time.errors %}{{ error }}{% endfor %}</span>{% endif %}
</div>
<label for="id_theorical_time" class="col-4 col-sm-3 col-md-3 col-lg-3 col-xl-2 col-form-label pl-0 pr-0">Theorical time <span class="text-danger"><b>*</b></span></label>
<label for="id_theorical_time" class="col-4 col-sm-3 col-md-3 col-lg-3 col-xl-3 col-form-label pl-0 pr-0">Theorical time <span class="text-danger"><b>*</b></span></label>
<div class="col-5 col-sm-2 col-md-3 col-lg-3 {% if form.theorical_time.errors %}has-danger{% endif %}">
{{ form.theorical_time }}
{% if form.theorical_time.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.theorical_time.errors %}{{ error }}{% endfor %}</span>{% endif %}
@ -50,8 +49,7 @@
{{ form.difficulty }}
{% if form.difficulty.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.difficulty.errors %}{{ error }}{% endfor %}</span>{% endif %}
</div>
<label for="id_difficulty_asked" class="col-4 col-sm-3 col-md-3 col-lg-3 col-xl-2 col-form-label pl-0 pr-0">Difficulty asked <span class="text-danger"><b>*</b></span></label>
<label for="id_difficulty_asked" class="col-4 col-sm-3 col-md-3 col-lg-3 col-xl-3 col-form-label pl-0 pr-0">Difficulty asked <span class="text-danger"><b>*</b></span></label>
<div class="col-5 col-sm-2 col-md-3 col-lg-3 {% if form.difficulty_asked.errors %}has-danger{% endif %}">
{{ form.difficulty_asked }}
{% if form.difficulty_asked.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.difficulty_asked.errors %}{{ error }}{% endfor %}</span>{% endif %}
@ -65,7 +63,7 @@
{% if form.quantity_of_skill.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.quantity_of_skill.errors %}{{ error }}{% endfor %}</span>{% endif %}
</div>
<label for="id_quantity_of_skill_asked" class="col-4 col-sm-3 col-md-3 col-lg-3 col-xl-2 col-form-label pl-0 pr-0"># skill asked <span class="text-danger"><b>*</b></span></label>
<label for="id_quantity_of_skill_asked" class="col-4 col-sm-3 col-md-3 col-lg-3 col-xl-3 col-form-label pl-0 pr-0"># skill asked <span class="text-danger"><b>*</b></span></label>
<div class="col-5 col-sm-2 col-md-3 col-lg-3 {% if form.quantity_of_skill_asked.errors %}has-danger{% endif %}">
{{ form.quantity_of_skill_asked }}
{% if form.quantity_of_skill_asked.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.quantity_of_skill_asked.errors %}{{ error }}{% endfor %}</span>{% endif %}
@ -79,7 +77,7 @@
{% if form.number_of_passes.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.number_of_passes.errors %}{{ error }}{% endfor %}</span>{% endif %}
</div>
<label for="id_number_of_passes_asked" class="col-4 col-sm-3 col-md-3 col-lg-3 col-xl-2 col-form-label pl-0 pr-0"># passes asked <span class="text-danger"><b>*</b></span></label>
<label for="id_number_of_passes_asked" class="col-4 col-sm-3 col-md-3 col-lg-3 col-xl-3 col-form-label pl-0 pr-0"># passes asked <span class="text-danger"><b>*</b></span></label>
<div class="col-5 col-sm-2 col-md-3 col-lg-3 {% if form.number_of_passes_asked.errors %}has-danger{% endif %}">
{{ form.number_of_passes_asked }}
{% if form.number_of_passes_asked.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.number_of_passes_asked.errors %}{{ error }}{% endfor %}</span>{% endif %}
@ -96,7 +94,9 @@
<div class="form-group row ">
<label for="id_information" class="col-4 col-sm-2 col-md-2 col-lg-2 col-xl-2 col-form-label">Informations</label>
<div class="col-5 col-sm-10 col-md-10 col-lg-10 col-xl-10 {% if form.id_informations.errors %}has-danger{% endif %}">
</div>
<div class="form-group row">
<div class="col-12 {% if form.id_informations.errors %}has-danger{% endif %}">
{{ form.informations }}
</div>
</div>

View File

@ -92,6 +92,7 @@
<div class="col-12 text-center"><b>Statistics</b></div>
<div class="col-4 col-sm-3 pr-0">Diff/passe</div>
<div class="col-2 text-right pl-0"><b>{{ intensity.mean_difficulty_by_passe_in_unit | floatformat:3 }}</b></div>
<div class="col-sm-2 d-none d-sm-block"></div>
<div class="col-4 col-sm-3 pr-0">Skill/passe</div>
<div class="col-2 text-right pl-0">
<b>
@ -107,6 +108,7 @@
<div class="col-4 col-sm-3 pr-0">Diff/Skill</div>
<div class="col-2 text-right pl-0"><b>{{ intensity.mean_difficulty_by_skill_in_unit | floatformat:3 }}</b></div>
<div class="col-sm-2 d-none d-sm-block"></div>
<div class="col-4 col-sm-3 pr-0">Skill/time</div>
<div class="col-2 text-right pl-0">
<b>