Compare commits

..

16 Commits

Author SHA1 Message Date
Gregory Trullemans e7e70070d7 Update help page 2024-04-13 18:54:34 +02:00
Gregory Trullemans a62fd2ddee Bug fix in chrono listing 2024-04-13 07:40:29 +02:00
Gregory Trullemans e478bcd6a4 User manual improvement 2024-04-12 16:06:22 +02:00
Gregory Trullemans d3e64453be Improve help page 2024-04-11 20:43:35 +02:00
Gregory Trullemans 84bdffeee5 Improve help page 2024-04-11 19:51:19 +02:00
Gregory Trullemans 1574f3ce16 Add user manual for all user 2024-04-11 18:48:36 +02:00
Gregory Trullemans 4a8c483ac1 Update HTML listing 2024-04-11 16:46:44 +02:00
Gregory Trullemans 51932230f1 Align graph in listing 2024-04-11 16:41:15 +02:00
Gregory Trullemans c3d34fe174 Update chrono add and list management 2024-04-11 16:29:15 +02:00
Gregory Trullemans 514807204a Add graph into gymnast chrono listing 2024-04-11 12:18:14 +02:00
Gregory Trullemans 8612ea9087 Add BMI to height/weight graph 2024-04-11 08:42:03 +02:00
Gregory Trullemans adaa3fe0e3 Minor optimisation 2024-04-10 14:14:06 +02:00
Gregory Trullemans 222cf41a95 Update wellbeing listing for a gymnast 2024-04-10 14:02:46 +02:00
Gregory Trullemans c3cde290e9 New height/weight list for gymnast 2024-04-10 12:15:20 +02:00
Gregory Trullemans 9f889f27be Fix bug in records 10 straightjumps 2024-04-10 09:49:28 +02:00
Gregory Trullemans 6074f7b1a3 Minors improvements 2024-04-09 19:32:01 +02:00
49 changed files with 2132 additions and 1055 deletions

View File

@ -93,13 +93,13 @@
</li>
{% menuitem 'next_event_list' 'fal fa-calendar-alt' 'Events' %}
{% if request.user|has_group:"trainer" %}
{% menuitem 'injuries_list' 'fal fa-comment-alt-medical' 'Injuries' %}
{% menuitem 'injury_list' 'fal fa-comment-alt-medical' 'Injuries' %}
{% endif %}
{% menuitem 'place_list' 'fal fa-map-marked-alt' 'Places' %}
{% if request.user|has_group:"trainer" %}
{% menuitem 'chrono_list' 'fal fa-stopwatch' 'Chronos' %}
{% endif %}
{% menuitem 'report' 'fal fa-file-contract' 'Reports' %}
{% menuitem 'report_listing' 'fal fa-file-contract' 'Reports' %}
{% if request.user.is_staff %}
<li>
<a href="/admin/" target="_blank">
@ -163,10 +163,10 @@
<li class="nav-link">
<a href="{% url 'notification_update' %}" class="nav-item dropdown-item"><i class="fal fa-envelope"></i>&nbsp;Notifications</a>
</li>
{% endif %}
<li class="nav-link">
<a href="{% url 'help' %}" class="nav-item dropdown-item"><i class="fal fa-hands-helping"></i>&nbsp;User Manual</a>
</li>
{% endif %}
<li class="dropdown-divider"></li>
<li class="nav-link">
<a href="{% url 'logout' %}" class="nav-item dropdown-item"><i class="fal fa-sign-out-alt"></i>&nbsp;Log out</a>

File diff suppressed because it is too large Load Diff

View File

@ -50,7 +50,9 @@
</div>
<div class="col-6 pl-0">
{% for record in records_list %}
{% if record.score %}
<h3 class="ml-3">{{ record.score }} - {{ record.first_name }} {{ record.last_name }} ({{ record.date| date:"j M Y" }})</h3>
{% endif %}
{% endfor %}
</div>
<div class="col-6 pl-0">

View File

@ -7,8 +7,9 @@
{% block content %}
<div class="card mb-0">
{% if gymnast_list or skill_list or event_list or place_list or club_list %}
{% if gymnast_list %}
<div class="card-header">
<h2>Search results</h2>
{% if gymnast_list %}
<h4 class="mb-0"> Gymnasts results</h4>
</div>
<div class="card-body pt-0 pb-1">
@ -38,11 +39,9 @@
</tbody>
</table>
</div>
</div>
{% endif %}
{% if skill_list %}
<div class="card-header">
<h4 class="mb-0"> Skills results</h4>
</div>
<div class="card-body pt-0 pb-1">
@ -80,7 +79,6 @@
{% endif %}
{% if event_list %}
<div class="card-header">
<h4 class="mb-0"> Events results</h4>
</div>
<div class="card-body pt-0 pb-1">
@ -112,7 +110,6 @@
{% endif %}
{% if place_list %}
<div class="card-header">
<h4 class="mb-0"> Places results</h4>
</div>
<div class="card-body pt-0 pb-1">
@ -148,7 +145,6 @@
{% endif %}
{% if club_list %}
<div class="card-header">
<h4 class="mb-0"> Clubs results</h4>
</div>
<div class="card-body pt-0 pb-1">

View File

@ -20,7 +20,7 @@ urlpatterns = [
path(
r"core/report/",
report_listing,
name="report",
name="report_listing",
),
path(r"search/", search, name="global_search"),
path(r"login/", login, name="login"),

View File

@ -12,8 +12,6 @@ class Command(BaseCommand):
for intensity in intensity_list:
count += 1
# print(str(intensity.id) + " " + str(intensity))
print(intensity.id)
intensity.time_quality = 1
intensity.save()

View File

@ -235,6 +235,9 @@ class WellBeing(Markdownizable, Seasonisable):
Représente l'état psychologique/physique d'un gymnaste
"""
class Meta:
ordering = ["date", ]
gymnast = models.ForeignKey(
Gymnast, on_delete=models.CASCADE, default=None, related_name="wellbeings"
)
@ -374,6 +377,7 @@ class HeightWeight(Seasonisable):
verbose_name = "Height & weight"
verbose_name_plural = "Heights & weights"
unique_together = ("gymnast", "date")
ordering = ["date",]
gymnast = models.ForeignKey(
Gymnast,

View File

@ -6,7 +6,9 @@
<div class="row">
<div class="col-8">
<h4 class="">
{% if gymnast %}<i><a href="{% url 'gymnast_details_tab' gymnast.id 'scores' %}">{{ gymnast }}</a></i>'s{% endif %} chronos listing
{% if gymnast %}
<i><a href="{% url 'gymnast_details_tab' gymnast.id 'scores' %}">{{ gymnast }}</a></i>'s
{% endif %} chronos listing
</h4>
</div>
<div class="col-1 ml-auto">
@ -21,17 +23,70 @@
</div>
</div>
</div>
<div class="card-body vh-100">
<div class="table-responsive">
<div class="card-body pt-0">
{% if gymnast %}
<div class="row">
<div class="col-md-6">
<table class="table table-striped tablesorter" id="chrono_table">
<thead>
<tr>
<th style="width: 8%">&nbsp;</th>
<th style="width: 12%" class="header text-center">Date</th>
<th style="width: 20%" class="header text-center">Routine</th>
<th style="width: 15%" class="header text-center">Type</th>
<th style="width: 10%" class="header text-center">Score</th>
<th style="width: 10%" class="header text-center">TOF</th>
</tr>
</thead>
<tbody>
{% for chrono in chrono_list %}
<tr role="row" class="{% cycle 'odd' 'even' %}">
<td>
<a href="{% url 'chrono_update' chrono.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
&nbsp;
<a href="{% url 'jump_chrono_values_create_or_update' chrono.id %}">
<span class="far fa-search-plus text-warning"></span>
</a>
</td>
<td class="text-center">
{% if chrono.details.all %}
<a href="{% url 'jump_chrono_details' chrono.id %}">
{% endif %}
{{ chrono.date | date:"j-n-Y" }}
{% if chrono.details.all %}
</a>
{% endif %}
</td>
<td class="text-center">
{% if chrono.routine %}
{{ chrono.routine.long_label }}
{% else %}
{{ chrono.get_chrono_type_display }}
{% endif %}
</td>
<td class="text-center">{{ chrono.get_score_type_display }}</td>
<td class="text-center">{{ chrono.score }}</td>
<td class="text-center">{{ chrono.tof }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="col-md-6 pl-0 pr-0 pt-3">
<canvas id="chart_chrono" class="chartjs" width="100%">Your browser doesn't support canvas</canvas>
</div>
</div>
{% else %}
{% if chrono_list %}
<div class="table-responsive">
<table class="table table-striped tablesorter" id="chrono_table">
<thead>
<tr>
<th style="width: 6%">&nbsp;</th>
<th style="width: 12%" class="header">Date</th>
{% if not gymnast %}
<th style="width: 25%" class="header text-left">Gymnast</th>
{% endif %}
<th style="width: 25%" class="header text-left">Routine</th>
<th style="width: 15%" class="header">Type</th>
<th style="width: 10%" class="header text-center">Score</th>
@ -51,13 +106,11 @@
</a>
</td>
<td>{% if chrono.details.all %}<a href="{% url 'jump_chrono_details' chrono.id %}">{% endif %}{{ chrono.date | date:"j-n-Y" }}{% if chrono.details.all %}</a>{% endif %}</td>
{% if not gymnast %}
<td class="text-left">
{% if chrono.gymnast.id in request.session.available_gymnast or request.user.is_superuser %}<a href="{% url 'gymnast_details_tab' chrono.gymnast.id 'scores' %}">{% endif %}
{{ chrono.gymnast }}
</a>
</td>
{% endif %}
<td class="text-left">
{% if chrono.routine %}
{{ chrono.routine.long_label }}
@ -76,6 +129,7 @@
<p class="text-muted">There are no chronos corresponding to your criterias.</p>
{% endif %}
</div>
{% endif %}
</div>
</div>
{% endblock %}
@ -100,5 +154,150 @@
"bInfo": false,
});
});
{% if chrono_list %}
var timeFormat = 'DD-MM-YYYY';
var ctx = document.getElementById('chart_chrono').getContext('2d');
var gradient_stroke_1 = ctx.createLinearGradient(0, 230, 0, 50);
var gradient_stroke_2 = ctx.createLinearGradient(0, 230, 0, 50);
var gradient_stroke_3 = ctx.createLinearGradient(0, 230, 0, 50);
var gradient_stroke_4 = ctx.createLinearGradient(0, 230, 0, 50);
gradient_stroke_1.addColorStop(0.75, 'rgba(75, 192, 192, 0.3)');
gradient_stroke_1.addColorStop(0.5, 'rgba(75, 192, 192, 0.2)');
gradient_stroke_1.addColorStop(0.25, 'rgba(75, 192, 192, 0)');
gradient_stroke_2.addColorStop(1, 'rgba(255, 99, 132, 0.4)');
gradient_stroke_2.addColorStop(0.75, 'rgba(255, 99, 132, 0.3)');
gradient_stroke_2.addColorStop(0.5, 'rgba(255, 99, 132, 0.2)');
gradient_stroke_2.addColorStop(0.25, 'rgba(255, 99, 132, 0)');
gradient_stroke_3.addColorStop(1, 'rgba(255, 159, 64, 0.4)');
gradient_stroke_3.addColorStop(0.75, 'rgba(255, 159, 64, 0.3)');
gradient_stroke_3.addColorStop(0.5, 'rgba(255, 159, 64, 0.2)');
gradient_stroke_3.addColorStop(0.25, 'rgba(255, 159, 64, 0)');
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 straightjump_values = [
{% for chrono in chrono_10c %}
{
x: '{{ chrono.date | date:"d-m-Y" }}',
y: '{{ chrono.score_avg | floatformat:3 }}'
},
{% endfor %}
];
var compulsory_routine_values = [
{% for chrono in chrono_r1 %}
{
x: '{{ chrono.date | date:"d-m-Y" }}',
y: '{{ chrono.score_avg | floatformat:3 }}'
},
{% endfor %}
];
var volontary_routine_values = [
{% for chrono in chrono_r2 %}
{
x: '{{ chrono.date | date:"d-m-Y" }}',
y: '{{ chrono.score_avg | floatformat:3 }}'
},
{% endfor %}
];
var final_routine_values = [
{% for chrono in chrono_rf %}
{
x: '{{ chrono.date | date:"d-m-Y" }}',
y: '{{ chrono.score_avg | floatformat:3 }}'
},
{% endfor %}
];
var chrono_values = {
datasets: [
{% if chrono_10c %}
{
label: '10 |',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_1,
borderColor: 'rgb(75, 192, 192)',
pointBackgroundColor: 'rgb(75, 192, 192)',
fill: true,
data: straightjump_values,
},
{% endif %}
{% if chrono_r1 %}
{
label: 'Q1R1',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_2,
borderColor: 'rgb(255, 99, 132)',
pointBackgroundColor: 'rgb(255, 99, 132)',
fill: true,
data: compulsory_routine_values,
},
{% endif %}
{% if chrono_r2 %}
{
label: 'Q1R2',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_3,
borderColor: 'rgb(255, 159, 64)',
pointBackgroundColor: 'rgb(255, 159, 64)',
fill: true,
data: volontary_routine_values,
},
{% endif %}
{% if chrono_rf %}
{
label: 'Q2R1',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_4,
borderColor: 'rgb(255, 205, 86)',
pointBackgroundColor: 'rgb(255, 205, 86)',
fill: true,
data: final_routine_values,
},
{% endif %}
]
}
new Chart(ctx, {
type: 'line',
data: chrono_values,
options: {
scales: {
x: {
type: 'time',
display: true,
scaleLabel: {
display: true,
labelString: 'Date',
ticks: {
autoSkip: true,
source: 'data',
},
},
time: {
parser: timeFormat,
tooltipFormat: 'LL',
round: 'day',
},
},
},
plugins: {
legend: {
display: true,
position: 'bottom',
}
}
},
});
{% endif %}
</script>
{% endblock %}

View File

@ -1,5 +1,6 @@
{% extends "listing.html" %}
{% load has_group %}
{% load static %}
{% block datacontent %}
<div class="row justify-content-center">
@ -12,7 +13,7 @@
<div class="col-2 ml-auto pl-0">
<div class="text-right">
{% if request.user|has_group:"trainer" %}
<a href="{% if gymnast %}{% url 'heightweight_create_for_gymnast' gymnast.id %}{% else %}{% url 'heightweight_create' %}{% endif %}">
<a href="{% if gymnast %}{% url 'heightweight_create_for_gymnast' gymnast.id %}{% else %}{% url 'height_weight_create' %}{% endif %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="fas fa-plus"></i>
</button>
@ -21,9 +22,76 @@
</div>
</div>
</div>
<div class="card-body pt-1">
{% if heightweight_list %}
<table class="table tablesorter table-striped mb-0" data-sort="table" id="heightweight_table">
<div class="card-body pt-0">
{% if gymnast %}
<div class="row">
<div class="col-md-6">
<table class="table tablesorter table-striped mb-0" data-sort="table" id="height_weight_table">
<thead>
<tr>
<th></th>
<th class="header text-left">Date</th>
<th class="header text-center">Height</th>
<th class="header text-center">Hips height</th>
<th class="header text-center">Weight</th>
<th class="header text-center">BMI</th>
</tr>
</thead>
<tbody>
{% for height_weight in height_weight_list %}
<tr>
<td>
<a href="{% url 'heightweight_update' height_weight.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
<td class="text-left">{{ height_weight.date | date:"j-n-Y" }}</td>
<td class="text-center">{{ height_weight.height }}</td>
<td class="text-center">{% if height_weight.hips_height == None %}-{% else %}{{ height_weight.hips_height }}{% endif %}</td>
<td class="text-center">{{ height_weight.weight }}</td>
<td class="text-center">
{% if gymnast %}
{% if gymnast.gender == 0 %}
{% if height_weight.bmi < 19 %}
<span class="text-danger"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% elif height_weight.bmi < 21 %}
<span class="text-warning"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% elif height_weight.bmi < 23 %}
<span class="text-success"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% elif height_weight.bmi < 25 %}
<span class="text-warning"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% else %}
<span class="text-danger"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% endif %}
{% else %}
{% if height_weight.bmi < 21 %}
<span class="text-danger"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% elif height_weight.bmi < 23 %}
<span class="text-warning"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% elif height_weight.bmi < 25 %}
<span class="text-success"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% elif height_weight.bmi < 27 %}
<span class="text-warning"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% else %}
<span class="text-danger"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% endif %}
{% endif %}
{% else %}
<b>{{ height_weight.bmi | floatformat:2 }}</b>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="col-md-6 pl-0 pr-0 pt-3">
<canvas id="chart_height_weight" class="chartjs" width="100%">Your browser doesn't support canvas</canvas>
</div>
</div>
{% else %}
{% if height_weight_list %}
<table class="table tablesorter table-striped mb-0" data-sort="table" id="height_weight_table">
<thead>
<tr>
<th></th>
@ -38,49 +106,49 @@
</tr>
</thead>
<tbody>
{% for heightweight in heightweight_list %}
{% for height_weight in height_weight_list %}
<tr>
<td>
<a href="{% url 'heightweight_update' heightweight.id %}">
<a href="{% url 'height_weight_update' height_weight.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
<td class="text-left">{{ heightweight.date | date:"j-n-Y" }}</td>
<td class="text-left">{{ height_weight.date | date:"j-n-Y" }}</td>
{% if not gymnast %}
<td class="text-left">{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}<a href="{% url 'gymnast_details' heightweight.gymnast.id %}">{% endif %}{{ heightweight.gymnast }}</a></td>
<td class="text-left">{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}<a href="{% url 'gymnast_details' height_weight.gymnast.id %}">{% endif %}{{ height_weight.gymnast }}</a></td>
{% endif %}
<td class="text-center">{{ heightweight.height }}</td>
<td class="text-center">{% if heightweight.hips_height == None %}-{% else %}{{ heightweight.hips_height }}{% endif %}</td>
<td class="text-center">{{ heightweight.weight }}</td>
<td class="text-center">{{ height_weight.height }}</td>
<td class="text-center">{% if height_weight.hips_height == None %}-{% else %}{{ height_weight.hips_height }}{% endif %}</td>
<td class="text-center">{{ height_weight.weight }}</td>
<td class="text-center">
{% if gymnast %}
{% if gymnast.gender == 0 %}
{% if heightweight.bmi < 19 %}
<span class="text-danger"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
{% elif heightweight.bmi < 21 %}
<span class="text-warning"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
{% elif heightweight.bmi < 23 %}
<span class="text-success"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
{% elif heightweight.bmi < 25 %}
<span class="text-warning"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
{% if height_weight.bmi < 19 %}
<span class="text-danger"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% elif height_weight.bmi < 21 %}
<span class="text-warning"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% elif height_weight.bmi < 23 %}
<span class="text-success"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% elif height_weight.bmi < 25 %}
<span class="text-warning"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% else %}
<span class="text-danger"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
<span class="text-danger"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% endif %}
{% else %}
{% if heightweight.bmi < 21 %}
<span class="text-danger"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
{% elif heightweight.bmi < 23 %}
<span class="text-warning"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
{% elif heightweight.bmi < 25 %}
<span class="text-success"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
{% elif heightweight.bmi < 27 %}
<span class="text-warning"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
{% if height_weight.bmi < 21 %}
<span class="text-danger"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% elif height_weight.bmi < 23 %}
<span class="text-warning"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% elif height_weight.bmi < 25 %}
<span class="text-success"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% elif height_weight.bmi < 27 %}
<span class="text-warning"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% else %}
<span class="text-danger"><b>{{ heightweight.bmi | floatformat:2 }}</b></span>
<span class="text-danger"><b>{{ height_weight.bmi | floatformat:2 }}</b></span>
{% endif %}
{% endif %}
{% else %}
<b>{{ heightweight.bmi | floatformat:2 }}</b>
<b>{{ height_weight.bmi | floatformat:2 }}</b>
{% endif %}
</td>
</tr>
@ -90,6 +158,7 @@
{% else %}
<p class="text-muted">There are no scores corresponding to your criterias</p>
{% endif %}
{% endif %}
</div>
</div>
</div>
@ -97,6 +166,7 @@
{% endblock %}
{% block footerscript %}
<script src="{% static "js/template_users/chart_gradient_color.js" %}"></script>
<script type="text/javascript">
$(document).ready(function () {
$('[data-sort="table"]').tablesorter({
@ -107,7 +177,7 @@
sortList: [[1, 1]]
});
$('#heightweight_table').DataTable({
$('#height_weight_table').DataTable({
scrollY: '50vh',
scrollCollapse: true,
paging: false,
@ -116,5 +186,125 @@
"bInfo" : false,
});
});
{% if height_weight_list %}
var timeFormat = 'DD-M-YYYY';
var ctx = document.getElementById("chart_height_weight").getContext("2d");
var border_color_pink = 'rgb(255, 99, 132)';
var gradient_stroke_pink = ctx.createLinearGradient(0, 230, 0, 50);
gradient_stroke_pink.addColorStop(1, 'rgba(255, 99, 132, 0.4)');
gradient_stroke_pink.addColorStop(0.75, 'rgba(255, 99, 132, 0.3)');
gradient_stroke_pink.addColorStop(0.5, 'rgba(255, 99, 132, 0.2)');
gradient_stroke_pink.addColorStop(0.25, 'rgba(255, 99, 132, 0)');
var border_color_orange = 'rgb(255, 159, 64)';
var gradient_stroke_orange = ctx.createLinearGradient(0, 230, 0, 50);
gradient_stroke_orange.addColorStop(1, 'rgba(255, 159, 64, 0.4)');
gradient_stroke_orange.addColorStop(0.75, 'rgba(255, 159, 64, 0.3)');
gradient_stroke_orange.addColorStop(0.5, 'rgba(255, 159, 64, 0.2)');
gradient_stroke_orange.addColorStop(0.25, 'rgba(255, 159, 64, 0)');
var border_color_green = 'rgb(75, 192, 192)';
var gradient_stroke_green = ctx.createLinearGradient(0, 230, 0, 50);
gradient_stroke_green.addColorStop(1, 'rgba(75, 192, 192, 0.4)');
gradient_stroke_green.addColorStop(0.75, 'rgba(75, 192, 192, 0.3)');
gradient_stroke_green.addColorStop(0.5, 'rgba(75, 192, 192, 0.2)');
gradient_stroke_green.addColorStop(0.25, 'rgba(75, 192, 192, 0)');
var height_values = [
{% for height_weight in height_weight_list %}
{
x: '{{ height_weight.date | date:"d-m-Y" }}',
y: '{{ height_weight.weight }}'
},
{% endfor %}
]
var weight_values = [
{% for height_weight in height_weight_list %}
{
x: '{{ height_weight.date | date:"d-m-Y" }}',
y: '{{ height_weight.height | add:"-100" }}'
},
{% endfor %}
]
var bmi_value = [
{% for height_weight in height_weight_list %}
{
x: '{{ height_weight.date | date:"d-m-Y" }}',
y: '{{ height_weight.bmi }}'
},
{% endfor %}
]
var height_weight_data = {
datasets: [
{
label: 'Weight',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_pink,
borderColor: border_color_pink,
pointBackgroundColor: border_color_pink,
fill: true,
data: height_values,
hidden: true,
},
{
label: 'Height',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_orange,
borderColor: border_color_orange,
pointBackgroundColor: border_color_orange,
fill: true,
data: weight_values,
hidden: true,
},
{
label: 'BMI',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_green,
borderColor: border_color_green,
pointBackgroundColor: border_color_green,
fill: true,
data: bmi_value,
},
],
};
new Chart(ctx, {
responsive: true,
type: 'line',
data: height_weight_data,
options: {
scales: {
x: {
type: 'time',
display: true,
scaleLabel: {
display: true,
labelString: 'Date',
ticks: {
autoSkip: true,
source: 'data',
},
},
time: {
parser: timeFormat,
tooltipFormat: 'LL',
round: 'day',
},
},
},
plugins: {
legend: {
display: true,
position: 'bottom',
}
}
},
});
{% endif %}
</script>
{% endblock %}

View File

@ -21,7 +21,7 @@
<div class="card-footer row">
<div class="col-6">
<a href="{% url 'injuries_list' %}">
<a href="{% url 'injury_list' %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="tim-icons icon-double-left"></i>
</button>

View File

@ -5,7 +5,7 @@
<div class="card-header">
<div class="row">
<div class="col-md-4">
<h4 class=""> Injuries Listing</h4>
<h4 class="">{% if gymnast %}<i><a href="{% url 'gymnast_details_tab' gymnast.id 'physiological' %}">{{ gymnast }}</a></i>'s{% endif %} injuries Listing</h4>
</div>
<div class="col-1 ml-auto">
<div class="text-right">
@ -20,13 +20,15 @@
</div>
<div class="card-body">
<div class="table-responsive">
{% if injuries_list %}
{% if injury_list %}
<table class="table tablesorter table-striped" data-sort="table" id="injury_table">
<thead class="text-primary">
<tr>
<th style="width: 3%"></th>
<th class="header text-left" style="width: 8%">Date</th>
{% if not gymnast %}
<th class="header text-left" style="width: 20%">Gymnast</th>
{% endif %}
<th class="header text-left" style="width: 9%">Mechanism</th>
<th class="header text-left" style="width: 20%">Location</th>
<th class="header text-left" style="width: 8%">Side</th>
@ -35,7 +37,7 @@
</tr>
</thead>
<tbody>
{% for injury in injuries_list %}
{% for injury in injury_list %}
<tr role="row" class="{% cycle 'odd' 'even' %}">
<td>
<a href="{% url 'injury_update' injury.id %}">
@ -43,7 +45,17 @@
</a>
</td>
<td class="text-left"><a href="{% url 'injury_details' injury.id %}">{{ injury.date | date:"j-n-Y" }}</a></td>
<td class="text-left">{% if injury.gymnast.id in request.session.available_gymnast or request.user.is_superuser %}<a href="{% url 'gymnast_details_tab' injury.gymnast.id 'physiological' %}">{% endif %}{{ injury.gymnast }}</a></td>
{% if not gymnast %}
<td class="text-left">
{% if injury.gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
<a href="{% url 'gymnast_details_tab' injury.gymnast.id 'physiological' %}">
{% endif %}
{{ injury.gymnast }}
{% if injury.gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
</a>
{% endif %}
</td>
{% endif %}
<td class="text-left">{{ injury.get_mechanism_display }}</td>
<td class="text-left">{{ injury.get_location_display }}</td>
<td class="text-left">{{ injury.get_body_side_display }}</td>

View File

@ -1,5 +1,6 @@
{% extends "listing.html" %}
{% load has_group %}
{% load static %}
{% block datacontent %}
<div class="row justify-content-center">
@ -8,7 +9,17 @@
<div class="card-header row">
<div class="col-10 pr-0">
<h4 class="">
{% if gymnast %}<i>{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}<a href="{% url 'gymnast_details_tab' gymnast.id 'physiological' %}"><i>{% endif %}{{ gymnast }}</i></a>'s {% endif %} Well being list
{% if gymnast %}
<i>
{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
<a href="{% url 'gymnast_details_tab' gymnast.id 'physiological' %}">
{% endif %}
{{ gymnast }}
</i>
{% if gymnast.id in request.session.available_gymnast or request.user.is_superuser %}
</a>
{% endif %}'s
{% endif %} Well being listing
</h4>
</div>
<div class="col-2 ml-auto pl-0">
@ -23,7 +34,68 @@
</div>
</div>
</div>
<div class="card-body">
<div class="card-body pt-0">
{% if gymnast %}
<div class="row">
<div class="col-md-6">
<table class="table tablesorter table-striped mb-0" data-sort="table" id="mindstate_table">
<thead>
<tr>
<th></th>
<th class="header text-left">Date</th>
<th class="header text-center">Mindstate</th>
<th class="header text-center">Sleep</th>
<th class="header text-center">Stress</th>
<th class="header text-center">Fatigue</th>
<th class="header text-center">Muscle soreness</th>
</tr>
</thead>
<tbody>
{% for wellbeing in wellbeing_list %}
<tr>
<td>
<a href="{% url 'wellbeing_update' wellbeing.id %}">
<span class="tim-icons icon-pencil text-warning"></span>
</a>
</td>
<td class="text-left">
{% if wellbeing.gymnast.id in request.session.available_gymnast or request.user.is_superuser %}<a href="{% url 'wellbeing_details' wellbeing.id %}">{% endif %}{{ wellbeing.date | date:"j-n-Y" }}</a>
</td>
<td class="text-center">
{% if wellbeing.mindstate < 5%}<b><span class="text-danger">{% endif %}
{{ wellbeing.mindstate }}
{% if wellbeing.mindstate < 5%}</b></span>{% endif %}
</td>
<td class="text-center">
{% if wellbeing.sleep < 5%}<b><span class="text-danger">{% endif %}
{{ wellbeing.sleep }}
{% if wellbeing.sleep < 5%}</b></span>{% endif %}
</td>
<td class="text-center">
{% if wellbeing.stress > 5%}<b><span class="text-danger">{% endif %}
{{ wellbeing.stress }}
{% if wellbeing.stress > 5%}</b></span>{% endif %}
</td>
<td class="text-center">
{% if wellbeing.fatigue > 5%}<b><span class="text-danger">{% endif %}
{{ wellbeing.fatigue }}
{% if wellbeing.fatigue > 5%}</b></span>{% endif %}
</td>
<td class="text-center">
{% if wellbeing.muscle_soreness > 5%}<b><span class="text-danger">{% endif %}
{{ wellbeing.muscle_soreness }}
{% if wellbeing.muscle_soreness > 5%}</b></span>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="col-md-6 pl-0 pr-0 pt-3">
<canvas id="chart_wellbeing" class="chartjs" width="100%">Your browser doesn't support canvas</canvas>
</div>
</div>
{% else %}
{% if wellbeing_list %}
<table class="table tablesorter table-striped mb-0" data-sort="table" id="mindstate_table">
<thead>
@ -90,6 +162,7 @@
{% else %}
<p class="text-muted">There are no well being corresponding to your criterias</p>
{% endif %}
{% endif %}
</div>
</div>
</div>
@ -97,6 +170,7 @@
{% endblock %}
{% block footerscript %}
<script src="{% static "js/template_users/chart_gradient_color.js" %}"></script>
<script type="text/javascript">
$(document).ready(function () {
$('[data-sort="table"]').tablesorter({
@ -116,5 +190,172 @@
"bInfo" : false,
});
});
{% if wellbeing_list %}
var timeFormat = 'DD-M-YYYY';
var ctx = document.getElementById("chart_wellbeing").getContext("2d");
var border_color_pink = 'rgb(255, 99, 132)';
var gradient_stroke_pink = ctx.createLinearGradient(0, 230, 0, 50);
gradient_stroke_pink.addColorStop(1, 'rgba(255, 99, 132, 0.4)');
gradient_stroke_pink.addColorStop(0.75, 'rgba(255, 99, 132, 0.3)');
gradient_stroke_pink.addColorStop(0.5, 'rgba(255, 99, 132, 0.2)');
gradient_stroke_pink.addColorStop(0.25, 'rgba(255, 99, 132, 0)');
var border_color_orange = 'rgb(255, 159, 64)';
var gradient_stroke_orange = ctx.createLinearGradient(0, 230, 0, 50);
gradient_stroke_orange.addColorStop(1, 'rgba(255, 159, 64, 0.4)');
gradient_stroke_orange.addColorStop(0.75, 'rgba(255, 159, 64, 0.3)');
gradient_stroke_orange.addColorStop(0.5, 'rgba(255, 159, 64, 0.2)');
gradient_stroke_orange.addColorStop(0.25, 'rgba(255, 159, 64, 0)');
var border_color_green = 'rgb(75, 192, 192)';
var gradient_stroke_green = ctx.createLinearGradient(0, 230, 0, 50);
gradient_stroke_green.addColorStop(1, 'rgba(75, 192, 192, 0.4)');
gradient_stroke_green.addColorStop(0.75, 'rgba(75, 192, 192, 0.3)');
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 mindstate_values = [
{% for wellbeing in wellbeing_list %}
{
x: '{{ wellbeing.date | date:"d-m-Y" }}',
y: '{{ wellbeing.mindstate }}'
},
{% endfor %}
];
var sleep_values = [
{% for wellbeing in wellbeing_list %}
{
x: '{{ wellbeing.date | date:"d-m-Y" }}',
y: '{{ wellbeing.sleep }}'
},
{% endfor %}
];
var stress_values = [
{% for wellbeing in wellbeing_list %}
{
x: '{{ wellbeing.date | date:"d-m-Y" }}',
y: '{{ wellbeing.stress }}'
},
{% endfor %}
];
var fatigue_values = [
{% for wellbeing in wellbeing_list %}
{
x: '{{ wellbeing.date | date:"d-m-Y" }}',
y: '{{ wellbeing.fatigue }}'
},
{% endfor %}
];
var muscle_soreness_values = [
{% for wellbeing in wellbeing_list %}
{
x: '{{ wellbeing.date | date:"d-m-Y" }}',
y: '{{ wellbeing.muscle_soreness }}'
},
{% endfor %}
];
var wellbeing_data = {
datasets: [
{
label: 'Mindstate',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_pink,
borderColor: border_color_pink,
pointBackgroundColor: border_color_pink,
fill: true,
data: mindstate_values,
},
{
label: 'Sleep',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_orange,
borderColor: border_color_orange,
pointBackgroundColor: border_color_orange,
fill: true,
data: sleep_values,
},
{
label: 'Stress',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_green,
borderColor: border_color_green,
pointBackgroundColor: border_color_green,
fill: true,
data: stress_values,
},
{
label: 'Fatigue',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_blue,
borderColor: border_color_blue,
pointBackgroundColor: border_color_blue,
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,
},
],
};
new Chart(ctx, {
type: 'line',
data: wellbeing_data,
options: {
scales: {
x: {
type: 'time',
display: true,
scaleLabel: {
display: true,
labelString: 'Date',
ticks: {
autoSkip: true,
source: 'data',
},
},
time: {
parser: timeFormat,
tooltipFormat: 'LL',
round: 'day',
},
},
},
plugins: {
legend: {
display: true,
position: 'bottom',
}
}
},
});
{% endif %}
</script>
{% endblock %}

View File

@ -65,7 +65,7 @@ class URLTestCase(TestCase):
self.assertEqual(
resolve("/follow-up/injury/search/").view_name, "injury_search"
)
self.assertEqual(resolve("/follow-up/injury/").view_name, "injuries_list")
self.assertEqual(resolve("/follow-up/injury/").view_name, "injury_list")
self.assertEqual(resolve("/follow-up/injury/add/").view_name, "injury_create")
self.assertEqual(
resolve("/follow-up/injury/add/1/").view_name,

View File

@ -165,8 +165,12 @@ urlpatterns = [
#
#
# ACCIDENT
path(r"injury/search/", views_physiological.injuries_listing, name="injury_search"),
path(r"injury/", views_physiological.injuries_listing, name="injuries_list"),
path(r"injury/search/", views_physiological.injury_listing, name="injury_search"),
path(r"injury/", views_physiological.injury_listing, name="injury_list"),
path(
r"injury/gymnast/<int:gymnast_id>/",
views_physiological.injury_listing,
name="injury_list_for_gymnast"),
path(
r"injury/add/",
views_physiological.injury_create_or_update,

View File

@ -383,9 +383,19 @@ def chrono_listing(request, gymnast_id=None):
and gymnast_id in request.session["available_gymnast"]
)
):
chrono_list = Chrono.objects.filter(gymnast=gymnast_id)
gymnast = Gymnast.objects.get(pk=gymnast_id)
chrono_list = Chrono.objects.filter(gymnast=gymnast_id).order_by("date")
base_queryset = chrono_list.values("date").annotate(score_avg=Avg("tof"))
context = {
"chrono_10c": base_queryset.filter(chrono_type=0),
"chrono_r1": base_queryset.filter(chrono_type=1),
"chrono_r2": base_queryset.filter(chrono_type=2),
"chrono_rf": base_queryset.filter(chrono_type=3),
}
else:
context = {}
if request.user.is_superuser:
chrono_list = Chrono.objects.all()
else:
@ -393,7 +403,8 @@ def chrono_listing(request, gymnast_id=None):
gymnast__in=request.session["available_gymnast"]
)
context = {"chrono_list": chrono_list, "gymnast": gymnast}
context["chrono_list"] = chrono_list
context["gymnast"] = gymnast
return render(request, "chronos/list.html", context)
@ -466,7 +477,7 @@ def chrono_create_or_update(request, chrono_id=None, gymnast_id=None):
)
return HttpResponseRedirect(
reverse("gymnast_details_tab", args=(new_chrono.gymnast.id, "scores"))
reverse("chrono_list_for_gymnast", args=(new_chrono.gymnast.id,))
)
return render(request, "chronos/create.html", {"form": form})

View File

@ -34,7 +34,7 @@ from .email_vars import MAIL_HEADER, MAIL_FOOTER
@login_required
@require_http_methods(["GET"])
def injuries_listing(request, gymnast_id=None):
def injury_listing(request, gymnast_id=None):
"""
Récupère la liste des bessures.
Si c'est un gymnaste qui est connecté, il ne peut récupérer que la liste de ses blessures.
@ -51,16 +51,16 @@ def injuries_listing(request, gymnast_id=None):
)
):
gymnast = get_object_or_404(Gymnast, pk=gymnast_id)
injuries_list = Injury.objects.filter(gymnast=gymnast_id)
injury_list = Injury.objects.filter(gymnast=gymnast_id)
else:
if request.user.is_superuser:
injuries_list = Injury.objects.all()
injury_list = Injury.objects.all()
else:
injuries_list = Injury.objects.filter(
injury_list = Injury.objects.filter(
gymnast__in=request.session["available_gymnast"]
)
context = {"injuries_list": injuries_list, "gymnast": gymnast}
context = {"injury_list": injury_list, "gymnast": gymnast}
return render(request, "injuries/list.html", context)
@ -152,7 +152,7 @@ def injury_details(request, injury_id):
request.session.has_key("available_gymnast")
and injury.gymnast.id not in request.session["available_gymnast"]
):
return injuries_listing(request)
return injury_listing(request)
return render(request, "injuries/details.html", {"injury": injury})
@ -350,7 +350,7 @@ def heightweight_listing(request, gymnast_id=None):
gymnast__in=request.session["available_gymnast"]
)
context = {"heightweight_list": heightweight_list, "gymnast": gymnast}
context = {"height_weight_list": heightweight_list, "gymnast": gymnast}
return render(request, "heightweight/list.html", context)

View File

@ -17,9 +17,9 @@
<div class="card mb-0">
<div class="card-header">
<h3 class="mb-0">{{ skill.short_label }}</h3>
<h4 class="card-title"> {{ skill.notation }}</h4>
<h4 class="card-title mb-0"> {{ skill.notation }}</h4>
</div>
<div class="card-body pb-0 mb-0">
<div class="card-body pb-0 pt-0 mb-0">
<div class="row mr-1 ml-1 pb-0 mb-0">
<svg></svg>
</div>

View File

@ -69,8 +69,9 @@ def compute_completude(total_skill, gymnast_nb_known_skills, max_level_skill):
max_skill (int): nombre maximum de skill.
Returns:
string: pourcentage de skill connus.
string: pourcentage de skill connus sous forme de string.
int: niveau estimé du gymnaste.
float: pourcentage de skill connus sous forme de nombre
Example:
>>> from jarvis.objective.tools import compute_completude
@ -80,11 +81,12 @@ def compute_completude(total_skill, gymnast_nb_known_skills, max_level_skill):
if total_skill:
percentage = gymnast_nb_known_skills / total_skill
completude = f"{int(percentage * 100)}%"
evaluated_level = int(max_level_skill * percentage)
estimated_level = int(max_level_skill * percentage)
else:
percentage = 0
completude = None
evaluated_level = None
return completude, evaluated_level
estimated_level = None
return completude, estimated_level, int(percentage * 100)
def compute_statistics_by_type(

View File

@ -221,7 +221,7 @@ class Gymnast(Markdownizable):
"""
Calcule toutes les statistiques par rapport au niveau/rang suivant le paramètre transmis.
1. On va chercher le niveau/rang maximum de skill que le gymnast sait faire
1. On va chercher le type (niveau ou rang) maximum de skill que le gymnast sait faire
2. 0n va chercher le nombre de skill par niveau/rang que le gymnast sait faire
nb_known_skill_by_type = [
{
@ -259,6 +259,7 @@ class Gymnast(Markdownizable):
context = {}
skill_max = self.skill_max_for_type(desired_type)
gymnast_nb_known_skills = self.known_skills.distinct("skill").count()
context["gymnast_nb_known_skills"] = gymnast_nb_known_skills
if skill_max > 0:
cpt_known_skill_by_type = self.nb_known_skill_by_type(
@ -275,10 +276,16 @@ class Gymnast(Markdownizable):
tmp = Skill.objects.all()
context["total_skill"] = tmp.count()
context["unknown_skill"] = tmp
context["percentages"] = 0
context["completude"], context["evaluated_level"] = compute_completude(
context["completude"], context["estimated_level"], context["percentage_known_skill"] = compute_completude(
context["total_skill"], gymnast_nb_known_skills, skill_max
)
# print(context["percentage_known_skill"])
# print(context["gymnast_nb_known_skills"])
# print(context["completude"])
# print(context["estimated_level"])
context["max_" + desired_type + "_skill"] = skill_max
return context

View File

@ -76,19 +76,7 @@
<li class="nav-item">
<a class="nav-link get-info{% if tab is None or tab == 'level' %} active{% endif %}" data-toggle="tab" href="#skill" data-ref="#skill" data-url="skill/" id="display_skill">
<i class="tim-icons icon-sound-wave"></i> <!-- Level -->
</a>
</li>
<li class="nav-item">
<a class="nav-link get-info{% if tab == 'season_informations' %} active{% endif %}" data-toggle="tab" href="#season_informations" data-ref="#season_informations" data-url="season_informations/" id="display_season_informations">
<i class="fal fa-map-signs"></i> <!-- Season Informations -->
</a>
</li>
<li class="nav-item">
<a class="nav-link get-info{% if tab == 'document' %} active{% endif %}" data-toggle="tab" href="#document" data-ref="#document" data-url="document/" id="display_documents">
<i class="fal fa-file-pdf"></i> <!-- Documents -->
<i class="fal fa-hexagon"></i> <!-- Level -->
</a>
</li>
@ -100,7 +88,7 @@
<li class="nav-item">
<a class="nav-link get-info{% if tab == 'scores' %} active{% endif %}" data-toggle="tab" href="#scores" data-ref="#scores" data-url="scores_chrono/" id="display_scores_chrono">
<i class="fal fa-crosshairs"></i> <!-- Scores -->
<i class="fal fa-tasks-alt"></i> <!-- Scores -->
</a>
</li>
@ -111,10 +99,22 @@
</li>
<li class="nav-item">
<a class="nav-link get-info{% if tab == 'event' %} active{% endif %} mr-2 mb-1" data-toggle="tab" href="#event" data-ref="#event" data-url="event/" id="display_event">
<a class="nav-link get-info{% if tab == 'event' %} active{% endif %}" data-toggle="tab" href="#event" data-ref="#event" data-url="event/" id="display_event">
<i class="fal fa-calendar-day"></i> <!-- Events -->
</a>
</li>
<li class="nav-item">
<a class="nav-link get-info{% if tab == 'season_informations' %} active{% endif %}" data-toggle="tab" href="#season_informations" data-ref="#season_informations" data-url="season_informations/" id="display_season_informations">
<i class="fal fa-map-signs"></i> <!-- Season Informations -->
</a>
</li>
<li class="nav-item">
<a class="nav-link get-info{% if tab == 'document' %} active{% endif %} mr-2 mb-1" data-toggle="tab" href="#document" data-ref="#document" data-url="document/" id="display_documents">
<i class="fal fa-file-pdf"></i> <!-- Documents -->
</a>
</li>
</ul>
</div>
<div class="col-12 col-sm-11 col-md-11 col-lg-11 pr-0">

View File

@ -1,5 +1,5 @@
<h4 class="d-flex align-items-end flex-column">
Estimated level : {% if gymnast_nb_known_skills %}{{ evaluated_level }}{% else %}0{% endif %}
Estimated level : {% if gymnast_nb_known_skills %}{{ estimated_level }}{% else %}0{% endif %}
</h4>
<div class="progress-container progress-primary">
<div class="progress" style="height: 10px;">

View File

@ -33,7 +33,7 @@
<th class="header text-left" style="width: 20%">Lastname</th>
<th class="header text-left" style="width: 20%">Firstname</th>
<th class="header text-left" style="width: 10%">Gender</th>
<th class="header text-left" style="width: 10%">Age</th>
<th class="header text-center" style="width: 10%">Age</th>
<th class="header text-left" style="width: 10%">Category</th>
<th class="header text-left" style="width: 25%">Club</th>
</tr>
@ -53,7 +53,7 @@
<td class="text-left">{% if season_information.gymnast.id in request.session.available_gymnast or request.user.is_superuser %}<a href="{% url 'gymnast_details' season_information.gymnast.id %}">{% endif %}{{ season_information.gymnast.last_name }}</a></td>
<td class="text-left">{% if season_information.gymnast.id in request.session.available_gymnast or request.user.is_superuser %}<a href="{% url 'gymnast_details' season_information.gymnast.id %}">{% endif %}{{ season_information.gymnast.first_name }}</a></td>
<td class="text-left">{{ season_information.gymnast.get_gender_display }}</td>
<td class="text-left">{{ season_information.gymnast.age }}</td>
<td class="text-center">{{ season_information.gymnast.age }}</td>
<td class="text-left">{{ season_information.get_category_display }}</td>
<td class="text-left">{{ season_information.club.name }}</td>
</tr>

View File

@ -5,7 +5,7 @@
<h4>Injuries</h4>
</div>
<div class="card-body pt-0 pb-0">
{% if injuries_list %}
{% if injury_list %}
<div class="card-body pl-0 pt-0 pr-0">
<table class="table table-striped table-condensed tablesorter mb-1">
<thead>
@ -16,7 +16,7 @@
</tr>
</thead>
<tbody>
{% for injury in injuries_list %}
{% for injury in injury_list %}
<tr>
<td class="text-left">
<a href="{% url 'injury_update' injury.id %}">

View File

@ -214,7 +214,7 @@
<div class="row">
<div class="col-12">
<h4 class="mb-1">Injury</h4>
{% if injuries_list %}
{% if injury_list %}
<table class="table" id="injury_table">
<thead class="text-primary">
<tr>
@ -228,7 +228,7 @@
</tr>
</thead>
<tbody>
{% for injury in injuries_list %}
{% for injury in injury_list %}
<tr role="row" class="{% cycle 'odd' 'even' %}">
<td class="text-left">{{ injury.date | date:"d-m-Y" }}</td>
<td class="text-left">{{ injury.gymnast }}</td>

View File

@ -5,22 +5,26 @@
<div class="col-md-12">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-8">
<h4 class="mb-0">{{ latest_published_note.title }}</h4>
<p class="text-muted">{{ latest_published_note.date | date:'j N Y' }}</p>
</div>
<div class="card-body pt-0">
<p>{{ latest_published_note.to_markdown | safe }}</p>
</div>
<div class="card-footer text-right text-muted pt-0">
{% if request.user.id == latest_published_note.coach.id %}
<div class="col-1 ml-auto text-right">
<a href="{% url 'note_update' latest_published_note.id %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<span class="tim-icons icon-pencil"></span>
</button>
</a>
</div>
{% endif %}
</div>
</div>
<div class="card-body pt-0 text-justify">
<p>{{ latest_published_note.to_markdown | safe }}</p>
</div>
</div>
</div>
</div>
{% endif %}

View File

@ -95,9 +95,8 @@
</div>
<script type="text/javascript">
var timeFormat = 'DD-MM-YYYY';
{% if intensity_list %}
var timeFormat = 'DD-MM-YYYY';
var ctx = document.getElementById('chart_intensity').getContext('2d');
var average_difficulty_by_passe = [

View File

@ -16,7 +16,7 @@
{% if height_weight_list %}
<a href="{% url 'heightweight_list_for_gymnast' gymnast_id %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="fal fa-line-height"></i>
<i class="fal fa-weight"></i>
</button>
</a>
{% endif %}
@ -64,10 +64,10 @@
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h4>Injuries ({{ number_of_injuries }})</h4>
<h4>Injuries <i>on two last month</i></h4>
</div>
<div class="card-body pt-0 pb-0">
{% if injuries_list %}
{% if injury_list %}
<table class="table tablesorter table-striped table-condensed" id="injury_table">
<thead>
<tr>
@ -82,7 +82,7 @@
</tr>
</thead>
<tbody>
{% for injury in injuries_list %}
{% for injury in injury_list %}
<tr>
<td class="text-left">
<a href="{% url 'injury_update' injury.id %}">
@ -105,6 +105,13 @@
{% endif %}
</div>
<div class="card-footer text-right text-muted pt-0">
{% if injury_list %}
<a href="{% url 'injury_list_for_gymnast' gymnast_id %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="fal fa-comment-alt-medical"></i>
</button>
</a>
{% endif %}
<a href="{% url 'injury_create_for_gymnast' gymnast_id %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="fas fa-plus"></i>

View File

@ -23,7 +23,7 @@
</div>
<div class="card-body pt-0">
{% if season_information_list %}
<table class="table tablesorter table-striped mb-0" data-sort="table" id="score_table">
<table class="table tablesorter table-striped mb-0" data-sort="table" id="season_informations_table">
<thead>
<tr>
<th></th>
@ -62,126 +62,22 @@
</div>
<script type="text/javascript">
$('#span_week_button_generate').hide();
$('#span_week_comparison_button_generate').hide();
$('#span_month_button_generate').hide();
$('#span_season_button_generate').hide();
function check_comparison_fields(){
alert("check comparison fields")
if($('#select_week_number1').val() == '')
return false;
if($('#select_week_number2').val() == '')
return false;
if ($('#select_week_number2').val() == $('#select_week_number2').val())
return false;
return true;
}
function show_comparison_button(){
var tmp_url = "{% url 'gymnast_generate_report_week_comparison' gymnast.id '_season_source_' 9999 '_season_target_' 8888 %}";
season_source = $('#select_season_for_week1').val()
week_source = $('#select_week_number1').val()
season_target = $('#select_season_for_week2').val()
week_target = $('#select_week_number2').val()
target_url = tmp_url.replace('_season_source_', season_source).replace('9999', week_source).replace('_season_target_', season_target).replace('8888', week_target);
$('#week_comprison_pdf_link').attr('href', target_url);
$('#span_week_comparison_button_generate').show()
}
$('#select_season_for_week').change(function(){
var tmp_url = "{% url 'get_distinct_week_number_for_season_and_gymnast' gymnast.id '_season_label_' %}";
var season_label = $(this).children("option:selected").val();
target_url = tmp_url.replace('_season_label_', season_label);
$.getJSON(target_url, function(data) {
if (!$.trim(data))
$('#week_management').hide();
else
$('#week_management').show();
$("#select_week_number option").remove(); // Remove all <option> child tags.
$.each(data, function(key, value) { // Iterates through a collection
$("#select_week_number").append( // Append an object to the inside of the select box
$("<option></option>").text(value).val(value)
);
});
});
$(document).ready(function () {
$('[data-sort="table"]').tablesorter({
headers: {
0: { sorter: false },
},
dateFormat: "uk",
sortList: [[1, 1]]
});
$('#select_season_for_week1').change(function(){
var test = check_comparison_fields();
if(test)
show_comparison_button();
else
$('#span_week_comparison_button_generate').hide();
$('#score_table').DataTable({
scrollY: '50vh',
scrollCollapse: true,
paging: false,
searching: false,
ordering: false,
// "bInfo" : false,
});
$('#select_week_number1').change(function(){
var test = check_comparison_fields();
if(test)
show_comparison_button();
else
$('#span_week_comparison_button_generate').hide();
});
$('#select_season_for_week2').change(function(){
var test = check_comparison_fields();
if(test)
show_comparison_button();
else
$('#span_week_comparison_button_generate').hide();
});
$('#select_week_number2').change(function(){
var test = check_comparison_fields();
if(test)
show_comparison_button();
else
$('#span_week_comparison_button_generate').hide();
});
$('#select_week_number').change(function(){
if ($('#select_week_number').val() != "") {
var tmp_url = "{% url 'gymnast_report_export_for_week_number' gymnast.id '_season_label_' 9999 %}";
var season_label = $('#select_season_for_week').children("option:selected").val();
var week_number = $('#select_week_number').children("option:selected").val();
target_url = tmp_url.replace('_season_label_', season_label).replace('9999', week_number);
$('#week_pdf_link').attr('href', target_url);
$('#span_week_button_generate').show();
} else
$('#span_week_button_generate').hide();
});
$('#select_month_number').change(function(){
if ($('#select_month_number').val() != "") {
var tmp_url = "{% url 'gymnast_report_export_for_month_number' gymnast.id '_season_label_' 9999 %}";
var season_label = $('#select_season_for_month').children("option:selected").val();
var month_number = $('#select_month_number').children("option:selected").val();
target_url = tmp_url.replace('_season_label_', season_label).replace('9999', month_number);
$('#month_pdf_link').attr('href', target_url);
$('#span_month_button_generate').show();
} else
$('#span_month_button_generate').hide();
});
$('#select_season').change(function(){
if ($('#select_season').val() != "") {
var tmp_url = "{% url 'gymnast_report_export_for_season' gymnast.id '_season_label_' %}";
var season_label = $('#select_season').children("option:selected").val();
target_url = tmp_url.replace('_season_label_', season_label);
$('#season_pdf_link').attr('href', target_url);
$('#span_season_button_generate').show();
} else
$('#span_season_button_generate').hide();
});
</script>

View File

@ -228,8 +228,8 @@ def gymnast_display_physiological(request, gymnast_id):
gymnast_id (int) identifiant du gymnast
"""
number_of_injuries = Injury.objects.filter(gymnast=gymnast_id).count()
start_date = pendulum.now().date().subtract(months=6)
injuries_list = Injury.objects.filter(
start_date = pendulum.now().date().subtract(months=2)
injury_list = Injury.objects.filter(
gymnast=gymnast_id, date__gte=start_date
).order_by("date")
wellbeing_list = WellBeing.objects.filter(
@ -237,10 +237,13 @@ def gymnast_display_physiological(request, gymnast_id):
).order_by("date")
height_weight_list = HeightWeight.objects.filter(
gymnast=gymnast_id, date__gte=start_date
).order_by("date")
)
if height_weight_list.count() <= 3:
height_weight_list = HeightWeight.objects.filter(gymnast=gymnast_id).order_by("-date")[:5][::-1]
context = {
"injuries_list": injuries_list,
"injury_list": injury_list,
"number_of_injuries": number_of_injuries,
"wellbeing_list": wellbeing_list,
"height_weight_list": height_weight_list,

BIN
static/img/docs-dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

BIN
static/img/docs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 267 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

BIN
static/img/help/skills.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 75 KiB