Compare commits
No commits in common. "dcf587e2f94faf0bfef354b38b5c04392f70ff25" and "a4fd5c4350f672ebfc39d9640c70b936c0d3d0b4" have entirely different histories.
dcf587e2f9
...
a4fd5c4350
|
@ -30,23 +30,23 @@ $(function(){
|
|||
});
|
||||
|
||||
$('#id_rotation, #id_twist').keyup(function(){
|
||||
set_difficulty();
|
||||
set_level();
|
||||
set_notation();
|
||||
setDifficulty();
|
||||
setLevel();
|
||||
setNotation();
|
||||
});
|
||||
|
||||
$('#id_position').change(function(){
|
||||
set_difficulty();
|
||||
set_level();
|
||||
set_notation();
|
||||
setDifficulty();
|
||||
setLevel();
|
||||
setNotation();
|
||||
});
|
||||
|
||||
$('#id_rotation_type').change(function(){
|
||||
set_notation();
|
||||
setNotation();
|
||||
});
|
||||
|
||||
$('#difficulty').change(function(){
|
||||
set_level();
|
||||
setLevel();
|
||||
});
|
||||
|
||||
$('#id_level').keyup(function(){
|
||||
|
@ -103,11 +103,12 @@ $(function(){
|
|||
});
|
||||
|
||||
|
||||
const set_difficulty = function()
|
||||
const setDifficulty = function()
|
||||
{
|
||||
if(typeof($('#id_rotation').val()) === "undefined" || typeof($('#id_twist').val()) === "undefined")
|
||||
return
|
||||
|
||||
// console.log('------------------------------------------------------------------------------------------')
|
||||
var sum = 0;
|
||||
var position = $('#id_position').val();
|
||||
var nb_twist = parseInt($('#id_twist').val());
|
||||
|
@ -132,7 +133,7 @@ $(function(){
|
|||
};
|
||||
|
||||
|
||||
const set_level = function()
|
||||
const setLevel = function()
|
||||
{
|
||||
var level = 0;
|
||||
|
||||
|
@ -148,7 +149,7 @@ $(function(){
|
|||
}
|
||||
|
||||
|
||||
const set_notation = function()
|
||||
const setNotation = function()
|
||||
{
|
||||
var rotation_type = parseInt($('#id_rotation_type').children(':selected').val());
|
||||
var nb_rotation = parseInt($('#id_rotation').val());
|
||||
|
|
|
@ -46,26 +46,6 @@
|
|||
{% if form.email.errors %} <span class="btn btn-sm btn-danger-outline">{% for error in form.email.errors %}{{error}}{% endfor %}</span>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row {% if form.orientation.errors %}has-error has-feedback{% endif %}">
|
||||
<label for="id_orientation" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 col-form-label">Orientation <span class="text-danger"><b>*</b></span></label>
|
||||
<div class="col-8 col-sm-3 col-md-3 col-lg-2 col-xl-2">
|
||||
{{ form.orientation }}
|
||||
{% if form.orientation.errors %} <span class="btn btn-sm btn-danger-outline">{% for error in form.orientation.errors %}{{ error }}{% endfor %}</span>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="id_year_of_practice" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 col-form-label">Year of practice <span class="text-danger"><b>*</b></span></label>
|
||||
<div class="col-8 col-sm-3 col-md-3 col-lg-2 col-xl-2">
|
||||
<div class="form-group {% if form.year_of_practice.errors %}has-error{% endif %}">
|
||||
{{ form.year_of_practice }}
|
||||
{% if form.year_of_practice.errors %}
|
||||
<label id="id_year_of_practice-error" class="text-danger" for="id_year_of_practice">
|
||||
{% for error in form.year_of_practice.errors %}{{ error }}{% endfor %}
|
||||
</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row ">
|
||||
<label for="id_club" class="col-4 col-sm-3 col-form-label">Club <span class="text-danger"><b>*</b></span></label>
|
||||
<div class="col-8 col-md-9 col-lg-6 {% if form.club.errors %}has-danger{% endif %}">
|
||||
|
@ -90,7 +70,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<label for="id_hours_by_week" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 col-form-label">Hours by week <span class="text-danger"><b>*</b></span></label>
|
||||
<div class="col-8 col-sm-3 col-md-3 col-lg-2 col-xl-2">
|
||||
<div class="col-8 col-sm-3 col-md-3 col-lg-3 col-xl-3">
|
||||
<div class="form-group {% if form.hours_by_week.errors %}has-error{% endif %}">
|
||||
{{ form.hours_by_week }}
|
||||
{% if form.hours_by_week.errors %}
|
||||
|
|
|
@ -11,9 +11,10 @@
|
|||
<h4 class=""><i class="icon-primary fal fa-laugh-wink"></i> Hi {{ user.username }} !</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
Welcome to Ultron v0.63 <span class="text-muted">(last update : 31-10-2022)</span><br />
|
||||
Welcome to Ultron v0.61 <span class="text-muted">(last update : 29-10-2022)</span><br />
|
||||
This application is here to help us to manage the gymnasts (evolution, evaluation, routines, scores, …).
|
||||
This tool is not perfect so feel free to make improvement proposals, bug reports, … by sending me an <a href="mailto:gregory@flyingacrobaticstrampoline.be">email</a>.<br />
|
||||
This tool is not perfect so feel free to make improvement proposals, bug reports, … by sending me an <a
|
||||
href="mailto:gregory@flyingacrobaticstrampoline.be">email</a>.<br />
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -71,14 +72,10 @@
|
|||
{% for event in event_list %}
|
||||
<tr>
|
||||
<td class="text-left"><a href="{% url 'event_details' event.id %}">{{ event.name }}</a></td>
|
||||
<td>
|
||||
{% if event.number_of_week_from_today < 0 %}
|
||||
{{event.number_of_week_from_today}}
|
||||
{% else %}
|
||||
<span class="text-{% if event.number_of_week_from_today > 12 %}success{% elif event.number_of_week_from_today > 9 %}info{% elif event.number_of_week_from_today > 6 %}warning{% else %}danger{% endif %}">
|
||||
<b>{{event.number_of_week_from_today}}</b></span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{% if event.number_of_week_from_today < 0 %}{{event.number_of_week_from_today}}{% else
|
||||
%}<span
|
||||
class="text-{% if event.number_of_week_from_today > 12 %}success{% elif event.number_of_week_from_today > 9 %}info{% elif event.number_of_week_from_today > 6 %}warning{% else %}danger{% endif %}">
|
||||
<b>{{event.number_of_week_from_today}}</b></span>{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
@ -143,7 +140,8 @@
|
|||
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="gymnast_table">
|
||||
{% for gymnast in birthday_list %}
|
||||
<tr>
|
||||
<td class="text-left"><a href="{% url 'gymnast_details' gymnast.id %}">{{ gymnast.first_name }}</a></td>
|
||||
<td class="text-left"><a href="{% url 'gymnast_details' gymnast.id %}">{{ gymnast.first_name
|
||||
}}</a></td>
|
||||
<td class="">{{ gymnast.birthdate | date:"j M"}}</td>
|
||||
<td class="text-right">{{ gymnast.next_age }} years</td>
|
||||
</tr>
|
||||
|
|
|
@ -9,24 +9,18 @@ class Educative(Markdownizable):
|
|||
Classe `mère` educative. En trampoline tout est un éducatif : un saut, un enchainement, une
|
||||
série de compétition, ….
|
||||
|
||||
Level (skill) :
|
||||
Toutes les figures appartiennent à un niveau. Un niveau peut contenir plusieurs
|
||||
figures. Par défaut, le niveau d'une figure est son coéficient de difficulté (exprimé en 10ème
|
||||
pour avoir des nombres entiers) auquel on ajoute 1 pour les positions tendue.
|
||||
Exemple :
|
||||
- saut groupé, saut carpé joint et saut écart ==> niveau 5
|
||||
- salto avant groupé, salto arrière groupé ==> niveau 10
|
||||
- salto avant carpé, barani groupé, salto arrière carpé ==> niveau 11
|
||||
- salto avant tendu, barani carpé, salto arrière tendu ==> niveau 12
|
||||
|
||||
En plus de cela, il y a une limite minimum pour un niveau : le niveau d’une figure ne peut pas
|
||||
être plus petit que le niveau maximum de ses prérequis.
|
||||
Level : Toutes les figures appartiennent à un niveau. Un niveau peut contenir plusieurs
|
||||
figures.
|
||||
Exemple : les trois sauts de base (saut groupé, saut carpé joint et saut écart)
|
||||
sont dans le même niveau, salto avant groupé et salto arrière groupé appartiennent au même
|
||||
niveau.
|
||||
Le niveau d’une figure est calculé par rapport aux prérequis : par défaut le niveau
|
||||
d’une figure est égal au niveau maximum de ses prérequis.
|
||||
Le niveau, avec le rang, ont pour but d’aider les coaches à planifier l’évolution et
|
||||
l’apprentissage des figures les unes par rapport aux autres.
|
||||
|
||||
|
||||
Rank (skill) :
|
||||
Le rang permet, en plus du `level` (niveau), de classer les figures entre elles, de leur
|
||||
Rank : Le rang permet, en plus du `level` (niveau), de classer les figures entre elles, de leur
|
||||
donner un ordre (informatif). Le rang d’une figure est calculé par rapport aux prérequis et au
|
||||
niveau : par défaut le rang d’une figure est le maximum entre le niveau maximum de ses
|
||||
prérequis plus un et le niveau de la figure.
|
||||
|
|
|
@ -24,14 +24,12 @@ class GymnastAdmin(admin.ModelAdmin):
|
|||
"birthdate",
|
||||
"gender",
|
||||
# "email",
|
||||
"is_active",
|
||||
"orientation",
|
||||
"year_of_practice",
|
||||
"club",
|
||||
"email_trainer",
|
||||
"trainings_by_week",
|
||||
"hours_by_week",
|
||||
"informations",
|
||||
"is_active",
|
||||
)
|
||||
|
||||
list_display = ("last_name", "first_name", "age", "is_active") # , 'club'
|
||||
|
|
|
@ -17,8 +17,6 @@ class GymnastForm(forms.ModelForm):
|
|||
"birthdate",
|
||||
"gender",
|
||||
"is_active",
|
||||
"orientation",
|
||||
"year_of_practice",
|
||||
"club",
|
||||
"email_trainer",
|
||||
"trainings_by_week",
|
||||
|
@ -51,10 +49,6 @@ class GymnastForm(forms.ModelForm):
|
|||
"is_active": forms.CheckboxInput(
|
||||
attrs={"class": "form-control form-check-input ml-0 mt-0"}
|
||||
),
|
||||
"orientation": forms.Select(attrs={"class": "form-control selectpicker"}),
|
||||
"year_of_practice": forms.TextInput(
|
||||
attrs={"class": "form-control", "placeholder": "3"}
|
||||
),
|
||||
"informations": forms.Textarea(
|
||||
attrs={
|
||||
"class": "form-control",
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
# Generated by Django 4.1.1 on 2022-10-31 13:40
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("people", "0004_gymnast_email_trainer"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="gymnast",
|
||||
name="orientation",
|
||||
field=models.PositiveSmallIntegerField(
|
||||
blank=True,
|
||||
choices=[(None, "Unknown"), (0, "Left"), (1, "Right")],
|
||||
null=True,
|
||||
verbose_name="Twist side",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gymnast",
|
||||
name="year_of_practice",
|
||||
field=models.PositiveSmallIntegerField(default=0),
|
||||
),
|
||||
]
|
|
@ -1,22 +0,0 @@
|
|||
# Generated by Django 4.1.1 on 2022-10-31 13:48
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("people", "0005_gymnast_orientation_gymnast_year_of_practice"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="gymnast",
|
||||
name="created_at",
|
||||
field=models.DateTimeField(
|
||||
auto_now_add=True, default=django.utils.timezone.now
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
|
@ -30,7 +30,7 @@ class Gymnast(Markdownizable):
|
|||
verbose_name_plural = "Gymnasts"
|
||||
|
||||
GENDER_CHOICES = ((0, "Male"), (1, "Female"))
|
||||
ORIENTATION_CHOICES = ((None, "Unknown"), (0, "Left"), (1, "Right"))
|
||||
# CATEGORY_CHOICES = ((9, "I9"), (10, "I10"), (11, "A11"), (12, "A12"), (13, "A13-14"), (15, "A15-16"), (18, "Senior"))
|
||||
|
||||
user = models.OneToOneField(
|
||||
User, on_delete=models.SET_NULL, related_name="gymnast", blank=True, null=True
|
||||
|
@ -42,45 +42,19 @@ class Gymnast(Markdownizable):
|
|||
choices=GENDER_CHOICES, verbose_name="Sexe"
|
||||
)
|
||||
is_active = models.BooleanField(default=1, verbose_name="Active")
|
||||
year_of_practice = models.PositiveSmallIntegerField(default=0)
|
||||
orientation = models.PositiveSmallIntegerField(
|
||||
choices=ORIENTATION_CHOICES,
|
||||
null=True,
|
||||
blank=True,
|
||||
verbose_name="Twist side",
|
||||
club = models.ForeignKey(
|
||||
Club, null=True, on_delete=models.SET_NULL, related_name="gymnast"
|
||||
)
|
||||
# category = models.PositiveSmallIntegerField(
|
||||
# choices=CATEGORY_CHOICES, verbose_name="Category"
|
||||
# )
|
||||
email_trainer = models.EmailField(
|
||||
max_length=254, null=True, blank=True, verbose_name="Trainer's email"
|
||||
)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
#
|
||||
#
|
||||
# TODO: traingin_by_week and hours_by_week --> classe de saison
|
||||
# CATEGORY_CHOICES = (
|
||||
# (9, "I9"),
|
||||
# (10, "I10"),
|
||||
# (11, "A11"),
|
||||
# (12, "A12"),
|
||||
# (13, "A13-14"),
|
||||
# (15, "A Junior"),
|
||||
# (18, "A Senior"),
|
||||
# (21, "B11"),
|
||||
# (22, "B12"),
|
||||
# (23, "B13-14"),
|
||||
# (24, "B Junior"),
|
||||
# (25, "B Senior"),
|
||||
# )
|
||||
trainings_by_week = models.PositiveSmallIntegerField(
|
||||
verbose_name="# Training by week"
|
||||
)
|
||||
hours_by_week = models.PositiveSmallIntegerField(verbose_name="# Hours by week")
|
||||
# category = models.PositiveSmallIntegerField(
|
||||
# choices=CATEGORY_CHOICES, verbose_name="Category"
|
||||
# )
|
||||
club = models.ForeignKey(
|
||||
Club, null=True, on_delete=models.SET_NULL, related_name="gymnast"
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return "%s %s" % (self.first_name, self.last_name)
|
||||
|
|
Loading…
Reference in New Issue