Lots of minor improvements
This commit is contained in:
parent
cfef189b1c
commit
ab8bcb8d0d
|
@ -657,7 +657,8 @@
|
|||
<li>Le nombre de passages demandé (calculée sur base du programme, en général calculée sur base du programme : 21)</li>
|
||||
</ol>
|
||||
</p>
|
||||
<p>Vous pouvez (non obligatoire) ajouter des informations relatives à votre entraînement. Typiquement, indiquer si vous avez arrêté avant la fin de l’entraînement, pourquoi vous avez arrêté avant la fin, …</p>
|
||||
<p>Vous pouvez ajouter des informations relatives à votre entraînement. Typiquement, indiquer si vous avez arrêté avant la fin de l’entraînement, pourquoi vous avez arrêté avant la fin, … Ces informations deviennent <b class="text-danger">obligatoires</b> lorsque certains paramètres (qualités individuelles ou qualité globale) sont au dessus ou en dessous de certaines valeurs. Actuellement les limites inférieures sont de 70% individuellement et de 85% pour la qualité globale ; les limites supérieures sont de 105% pour les limites individuelles et de 110% pour la qualité globale.</p>
|
||||
|
||||
<br />
|
||||
|
||||
<p><u>Liste des intensités</u></p>
|
||||
|
@ -668,7 +669,7 @@
|
|||
<p>Dans les détails d'une intensité, vous trouverez les 4 données enregistrées précédemment : la durée, le nombre de passages, le nombre d'éléments et la difficulté cumulée. En outre, sur la droite, vous trouverez les 4 statistiques calculées : la difficulté moyenne par passage, la difficulté moyenne par élément, la quantité moyenne d'éléments, et la quantité moyenne d'éléments par passage.</p>
|
||||
<br />
|
||||
|
||||
<p class="gym_chronos"><b>Chronos</b></p>
|
||||
<p id="gym_chronos"><b>Chronos</b></p>
|
||||
<p class="text-center">
|
||||
<img src="{% static "img/help/gymnast_chronos_chart.png" %}" alt="" style="width: 25vw;">
|
||||
</p>
|
||||
|
|
|
@ -711,7 +711,7 @@ class IntensityForm(forms.ModelForm):
|
|||
"informations": forms.Textarea(
|
||||
attrs={
|
||||
"class": "form-control",
|
||||
"placeholder": "Informations about intensity: did you do your full program, did you stop before the end, why did you stop before the end, …", # pylint: disable=line-too-long
|
||||
"placeholder": "Informations about intensity: why did you do more/less than your program, did you stop before the end, why did you stop before the end, …", # pylint: disable=line-too-long
|
||||
}
|
||||
),
|
||||
}
|
||||
|
|
|
@ -10,10 +10,7 @@
|
|||
{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
|
||||
<a href="{% url 'gymnast_details_tab' gymnast.id 'scores' %}">
|
||||
{% endif %}
|
||||
{{ gymnast }}
|
||||
{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
|
||||
</a>
|
||||
{% endif %}'s
|
||||
{{ gymnast }}{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}</a>{% endif %}'s
|
||||
{% endif %} chronos
|
||||
</h4>
|
||||
</div>
|
||||
|
@ -86,7 +83,13 @@
|
|||
</canvas>
|
||||
</div>
|
||||
<div class="col-12 text-center">
|
||||
<p>{{ personnal_best.date | date:"l j F Y" }} : <b class="text-danger">{{ personnal_best.tof }}</b> (ToF) | <b>{{ personnal_best.score }}</b> sec</p>
|
||||
<p>{{ personnal_best_10.date | date:"l j F Y" }} : <b class="text-danger">{{ personnal_best_10.tof }}</b> (ToF) | <b>{{ personnal_best_10.score }}</b> sec</p>
|
||||
{% if personnal_best_q1r1 %}
|
||||
<p>{{ personnal_best_q1r1.date | date:"l j F Y" }} : <b class="text-danger">{{ personnal_best_q1r1.tof }}</b> (ToF) | <b>{{ personnal_best_q1r1.score }}</b> sec ({% widthratio personnal_best_q1r1.tof personnal_best_10.score 100 %}%)</p>
|
||||
{% endif %}
|
||||
{% if personnal_best_q1r2 %}
|
||||
<p>{{ personnal_best_q1r2.date | date:"l j F Y" }} : <b class="text-danger">{{ personnal_best_q1r2.tof }}</b> (ToF) | <b>{{ personnal_best_q1r2.score }}</b> sec ({% widthratio personnal_best_q1r2.tof personnal_best_10.score 100 %}%)</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
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-3 col-lg-3 col-xl-2 col-form-label pr-0">Gymnast <span class="text-danger"><b>*</b></span></label>
|
||||
<label for="id_date" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 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.gymnast.errors %}has-danger{% endif %}">
|
||||
{{ form.gymnast }}
|
||||
{{ form.gymnast_related }}
|
||||
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group row ">
|
||||
<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>
|
||||
<label for="id_date" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 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">{% for error in form.date.errors %}{{ error }}{% endfor %}</span>{% endif %}
|
||||
|
@ -31,7 +31,7 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group row ">
|
||||
<label for="id_time" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-2 col-form-label pr-0">Time <span class="text-danger"><b>*</b></span></label>
|
||||
<label for="id_time" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 col-form-label pr-0">Time <span class="text-danger"><b>*</b></span></label>
|
||||
<div class="col-5 col-sm-2 col-md-3 col-lg-3 {% if form.time.errors %}has-danger{% endif %}">
|
||||
{{ form.time }}
|
||||
{% if form.time.errors %} <span class="btn btn-sm">{% for error in form.time.errors %}{{ error }}{% endfor %}</span>{% endif %}
|
||||
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group row ">
|
||||
<label for="id_difficulty" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-2 col-form-label pr-0">Difficulty <span class="text-danger"><b>*</b></span></label>
|
||||
<label for="id_difficulty" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 col-form-label pr-0">Difficulty <span class="text-danger"><b>*</b></span></label>
|
||||
<div class="col-5 col-sm-2 col-md-3 col-lg-3 {% if form.difficulty.errors %}has-danger{% endif %}">
|
||||
{{ form.difficulty }}
|
||||
{% if form.difficulty.errors %} <span class="btn btn-sm">{% for error in form.difficulty.errors %}{{ error }}{% endfor %}</span>{% endif %}
|
||||
|
@ -57,7 +57,7 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group row ">
|
||||
<label for="id_quantity_of_skill" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-2 col-form-label pr-0"># skill <span class="text-danger"><b>*</b></span></label>
|
||||
<label for="id_quantity_of_skill" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 col-form-label pr-0"># skill <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.errors %}has-danger{% endif %}">
|
||||
{{ form.quantity_of_skill }}
|
||||
{% if form.quantity_of_skill.errors %} <span class="btn btn-sm">{% for error in form.quantity_of_skill.errors %}{{ error }}{% endfor %}</span>{% endif %}
|
||||
|
@ -71,7 +71,7 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group row ">
|
||||
<label for="id_number_of_passes" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-2 col-form-label pr-0"># passes <span class="text-danger"><b>*</b></span></label>
|
||||
<label for="id_number_of_passes" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 col-form-label pr-0"># passes <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.errors %}has-danger{% endif %}">
|
||||
{{ form.number_of_passes }}
|
||||
{% if form.number_of_passes.errors %} <span class="btn btn-sm">{% for error in form.number_of_passes.errors %}{{ error }}{% endfor %}</span>{% endif %}
|
||||
|
@ -85,7 +85,7 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group row ">
|
||||
<label for="id_number_of_gymnast" 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>
|
||||
<label for="id_number_of_gymnast" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 col-form-label pr-0"># gymnast <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_gymnast.errors %}has-danger{% endif %}">
|
||||
{{ form.number_of_gymnast }}
|
||||
{% if form.number_of_gymnast.errors %} <span class="btn btn-sm">{% for error in form.number_of_gymnast.errors %}{{ error }}{% endfor %}</span>{% endif %}
|
||||
|
@ -93,11 +93,11 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group text-center" id="informations_needed">
|
||||
<p class="text-danger"><b>Details required !</b></p>
|
||||
<p class="text-danger">Details required because at least one quality is above/under the limits.</p>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<label for="id_information" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 col-form-label">Informations <span id="informations_star" class="text-danger"><b>*</b></span></label>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-12 {% if form.id_informations.errors %}has-danger{% endif %}">
|
||||
|
@ -119,6 +119,7 @@
|
|||
{% block footerscript %}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#informations_star').hide();
|
||||
$("#informations_needed").hide();
|
||||
blackDashboard.initDateTimePicker();
|
||||
|
||||
|
@ -138,7 +139,6 @@
|
|||
|
||||
function is_informations_needed() {
|
||||
var time_quality = $('#id_theorical_time').val() / $('#id_time').val();
|
||||
alert(time_quality);
|
||||
var diff_quality = $('#id_difficulty_asked').val() / $('#id_difficulty').val();
|
||||
var skill_quality = $('#id_quantity_of_skill_asked').val() / $('#id_quantity_of_skils').val();
|
||||
var passe_quality = $('#id_number_of_passes_asked').val() / $('#id_number_of_passes').val();
|
||||
|
@ -164,19 +164,20 @@
|
|||
|
||||
function is_information_field_too_short() {
|
||||
information_length = $('#id_informations').val().length
|
||||
if(isNaN(information_length) || information_length < 15) {
|
||||
alert("Informations too shorts !");
|
||||
if(isNaN(information_length) || information_length < 15)
|
||||
return true;
|
||||
} else
|
||||
else
|
||||
return false;
|
||||
};
|
||||
|
||||
$('#id_time, #id_theorical_time, #id_difficulty, #id_difficulty_asked, #id_quantity_of_skill, #id_quantity_of_skill_asked, #id_number_of_passes, #id_number_of_passes_asked').keyup(function(){
|
||||
if(is_informations_needed() && is_information_field_too_short()) {
|
||||
$("#informations_needed").show();
|
||||
$('#informations_star').show();
|
||||
$("#div_submit").hide();
|
||||
} else {
|
||||
$("#informations_needed").hide();
|
||||
$('#informations_star').hide();
|
||||
$("#div_submit").show();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -147,16 +147,20 @@ def note_create_or_update(request, note_id=None, gymnast_id=None):
|
|||
url = request.build_absolute_uri(
|
||||
reverse("gymnast_details_tab", args=(new_note.gymnast.id, "event"))
|
||||
)
|
||||
receivers = [
|
||||
new_note.gymnast.user.email,
|
||||
new_note.gymnast.email_trainer,
|
||||
]
|
||||
receivers = []
|
||||
|
||||
if new_note.gymnast.user.email:
|
||||
receivers.append(new_note.gymnast.user.email)
|
||||
|
||||
if new_note.gymnast.email_trainer:
|
||||
receivers.append(new_note.gymnast.email_trainer)
|
||||
|
||||
title = f"{new_note.gymnast} : Nouvelle note"
|
||||
body = f"""<p>Bonjour,</p><p>Une nouvelle note vous a été envoyée. Vous pouvez la consulter en cliquant <a href='{url}'>ici</a>.</p>"""
|
||||
body = f"""<p>Bonjour {new_note.gymnast.first_name},</p><p>Une nouvelle note vous a été laissée par un de vos coaches. Vous pouvez la consulter en cliquant <a href='{url}'>ici</a>.</p>"""
|
||||
|
||||
send_mail(
|
||||
title,
|
||||
"Une nouvelle note vous a été envoyée",
|
||||
"Une nouvelle note vous a été laissée.",
|
||||
settings.EMAIL_HOST_USER,
|
||||
receivers,
|
||||
fail_silently=False,
|
||||
|
|
|
@ -394,8 +394,12 @@ def chrono_listing(request, gymnast_id=None):
|
|||
"chrono_rf": base_queryset.filter(chrono_type=3),
|
||||
}
|
||||
|
||||
personnal_best = Chrono.objects.filter(gymnast=gymnast_id).order_by("-tof").first()
|
||||
context["personnal_best"] = personnal_best
|
||||
personnal_best_10 = Chrono.objects.filter(gymnast=gymnast_id, chrono_type=0).order_by("-tof").first()
|
||||
personnal_best_q1r1 = Chrono.objects.filter(gymnast=gymnast_id, chrono_type=1).order_by("-tof").first()
|
||||
personnal_best_q1r2 = Chrono.objects.filter(gymnast=gymnast_id, chrono_type=2).order_by("-tof").first()
|
||||
context["personnal_best_10"] = personnal_best_10
|
||||
context["personnal_best_q1r1"] = personnal_best_q1r1
|
||||
context["personnal_best_q1r2"] = personnal_best_q1r2
|
||||
|
||||
else:
|
||||
context = {}
|
||||
|
|
Loading…
Reference in New Issue