2021-11-02 14:05:32 +01:00
{% extends "base.html" %}
2022-01-06 10:04:36 +01:00
{% load skill_doughnut %}
{% load level_chart_bar %}
2022-02-07 12:09:29 +01:00
{% load has_group %}
{% load is_user_equal_to_gymnast %}
2022-01-06 10:04:36 +01:00
2021-11-17 10:39:16 +01:00
{% block page_title %}{{ gymnast.first_name }} {{ gymnast.last_name }}{% endblock %}
2021-11-02 14:05:32 +01:00
{% block content %}
< div class = "row" >
2021-12-28 10:25:29 +01:00
< div class = "col-12 col-sm-4 col-md-4 col-lg-4" >
2021-12-26 17:49:48 +01:00
< div class = "card card-user mb-4" >
2021-11-02 14:05:32 +01:00
< div class = "card-body" >
< div class = "author" >
< div class = "block block-one" > < / div >
< div class = "block block-two" > < / div >
< div class = "block block-three" > < / div >
< div class = "block block-four" > < / div >
< a href = "javascript:void(0)" >
2021-11-17 10:39:16 +01:00
{% if gymnast.picture %}
< img src = "{{ gymnast.picture.url }}" alt = "{{ gymnast }}" class = "avatar" >
2021-11-02 14:05:32 +01:00
{% endif %}
2021-11-17 10:39:16 +01:00
< h4 class = "title" > {{ gymnast.first_name }} {{ gymnast.last_name }}< / h4 >
2021-11-02 14:05:32 +01:00
< / a >
2021-12-13 15:51:07 +01:00
< p class = "description" >
{{ gymnast.club.name }}
< / p >
2021-11-02 14:05:32 +01:00
< / div >
< div class = "card-description" >
2021-12-13 15:51:07 +01:00
{% if height_weight %}
2022-02-13 15:33:46 +01:00
< b > {{ height_weight.0.height }}cm - {{ height_weight.0.weight }}kg< / b > ({{ height_weight.0.date | date:"d-m-Y" }})< br / >
2021-12-13 15:51:07 +01:00
{% endif %}
< b > {{ gymnast.trainings_by_week }} training/week< / b > for < b > {{ gymnast.hours_by_week }} hours/week< / b > < br / >
2021-11-18 21:36:15 +01:00
< br / >
2022-02-15 07:41:19 +01:00
{% if user_is_trainer and gymnast.informations %}
2022-09-27 08:24:01 +02:00
< p > {{ gymnast.to_markdown | safe }}< / p >
2022-02-15 07:41:19 +01:00
< br / >
{% endif %}
< li >
< b > 10 |< / b > : < b > {{ best_straightjump.0.tof }}< / b > ({{ best_straightjump.0.date | date:"d-m-Y" }})
< / li >
< li >
< b > Routine< / b > : {% if best_routine %}< b > {{ best_routine.0.tof }}< / b > ({{ best_routine.0.date | date:"d-m-Y" }}){% else %} (no information){% endif %}
< / li >
2021-12-18 22:40:15 +01:00
2021-11-13 14:45:02 +01:00
< / div >
2021-11-02 14:05:32 +01:00
< / div >
< / div >
< / div >
< div class = "col-12 col-sm-4 col-md-4 col-lg-4" >
2021-12-26 17:49:48 +01:00
{% if gymnast_nb_known_skills %}
2022-01-06 10:04:36 +01:00
{% generate_skill_doughnut gymnast.id %}
{% else %}
< p class = "text-muted mt-3" > No learned skill statistics.< / p >
2021-12-26 17:49:48 +01:00
{% endif %}
2021-11-02 14:05:32 +01:00
< / div >
2021-12-26 17:49:48 +01:00
< div class = "col-12 col-sm-4 col-md-4 card mb-4" >
{% if gymnast_nb_known_skills %}
2022-01-06 10:04:36 +01:00
{% generate_level_chart_bar gymnast.id %}
2021-12-08 09:30:13 +01:00
{% else %}
2021-12-26 17:49:48 +01:00
< p class = "text-muted mt-3" > No level/rank information.< / p >
2021-12-08 09:30:13 +01:00
{% endif %}
2021-11-02 14:05:32 +01:00
< / div >
2021-12-08 09:30:13 +01:00
2021-11-02 14:05:32 +01:00
< / div >
2021-11-26 14:52:16 +01:00
< div class = "row" >
2021-12-28 10:25:29 +01:00
< div class = "col-3 col-sm-1 col-md-1 col-lg-1 col-xl-1" >
2021-11-26 14:52:16 +01:00
< ul class = "nav nav-pills nav-pills-primary nav-pills-icons flex-column" >
2021-11-28 15:05:00 +01:00
< li class = "nav-item" >
2022-01-03 08:02:02 +01:00
< 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" >
2021-12-19 21:14:04 +01:00
< i class = "tim-icons icon-sound-wave" > < / i > <!-- Level -->
2021-11-28 15:05:00 +01:00
< / a >
< / li >
2022-09-27 08:24:01 +02:00
2021-12-05 15:18:31 +01:00
< li class = "nav-item" >
2021-12-18 22:40:15 +01:00
< a class = "nav-link get-info{% if tab == 'routine' %} active{% endif %}" data-toggle = "tab" href = "#routine" data-ref = "#routine" data-url = "routine/" id = "display_routines" >
2021-12-19 21:14:04 +01:00
< i class = "tim-icons icon-components" > < / i > <!-- Routines -->
2021-12-05 15:18:31 +01:00
< / a >
< / li >
2021-11-26 14:52:16 +01:00
< li class = "nav-item" >
2021-12-18 22:40:15 +01:00
< 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" >
2021-12-19 21:14:04 +01:00
< i class = "fal fa-crosshairs" > < / i > <!-- Scores -->
2021-11-26 14:52:16 +01:00
< / a >
< / li >
2022-02-15 07:41:19 +01:00
{% if user_is_trainer or request.user|is_user_equal_to_gymnast:gymnast.id %}
2022-02-07 12:09:29 +01:00
< li class = "nav-item" >
< a class = "nav-link get-info{% if tab == 'physiological' %} active{% endif %}" data-toggle = "tab" href = "#physiological" data-ref = "#physiological" data-url = "physiological/" id = "display_physiological" >
< i class = "fal fa-stethoscope" > < / i > <!-- Physical -->
< / a >
< / li >
{% endif %}
2021-11-26 14:52:16 +01:00
< li class = "nav-item" >
2021-12-18 22:40:15 +01:00
< 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" >
2021-12-19 21:14:04 +01:00
< i class = "fal fa-calendar-day" > < / i > <!-- Events -->
2021-11-26 14:52:16 +01:00
< / a >
< / li >
< / ul >
< / div >
2021-12-26 17:49:48 +01:00
< div class = "col-12 col-sm-11 col-md-11 col-lg-11 pr-0" >
2021-11-26 14:52:16 +01:00
< div class = "tab-content" >
2022-01-03 08:02:02 +01:00
< div class = "tab-pane{% if tab is None or tab == 'skill' %} active{% endif %}" id = "skill" > < / div >
2022-09-27 08:24:01 +02:00
2021-12-18 22:40:15 +01:00
< div class = "tab-pane{% if tab == 'routine' %} active{% endif %}" id = "routine" > < / div >
2021-12-13 15:51:07 +01:00
2021-12-18 22:40:15 +01:00
< div class = "tab-pane{% if tab == 'scores' %} active{% endif %}" id = "scores" > < / div >
2021-11-27 17:14:09 +01:00
2022-02-15 07:41:19 +01:00
{% if user_is_trainer or request.user|is_user_equal_to_gymnast:gymnast.id %}
2022-02-07 12:09:29 +01:00
< div class = "tab-pane{% if tab == 'physiological' %} active{% endif %}" id = "physiological" > < / div >
{% endif %}
2022-09-27 08:24:01 +02:00
2021-12-18 22:40:15 +01:00
< div class = "tab-pane{% if tab == 'event' %} active{% endif %}" id = "event" > < / div >
2022-01-03 14:45:31 +01:00
<!-- TODO : message d'erreur si TAB non géré. -->
2021-11-26 14:52:16 +01:00
< / div >
< / div >
< / div >
2021-11-03 06:19:59 +01:00
{% endblock %}
2021-11-02 14:05:32 +01:00
2021-11-03 06:19:59 +01:00
{% block footerscript %}
2021-11-02 14:05:32 +01:00
< script type = "text/javascript" >
2021-11-27 17:14:09 +01:00
$(document).ready(function() {
2022-02-15 07:41:19 +01:00
var default_url = "{% url 'gymnast_details' gymnast.id %}";
var tab_div = '';
2021-11-27 17:14:09 +01:00
2022-01-03 08:02:02 +01:00
{% if tab is None or tab == 'skill' %}
tab_url = default_url + 'skill/';
2022-02-15 07:41:19 +01:00
tab_div = '#skill';
2021-11-27 17:14:09 +01:00
{% elif tab == 'routine' %}
tab_url = default_url + 'routine/';
2022-02-15 07:41:19 +01:00
tab_div = '#routine';
2021-11-27 17:14:09 +01:00
{% elif tab == 'scores' %}
tab_url = default_url + 'scores_chrono/';
2022-02-15 07:41:19 +01:00
tab_div = '#scores';
{% elif tab == 'physiological' %}
tab_url = default_url + 'physiological/';
tab_div = '#physiological'
2021-11-27 17:14:09 +01:00
{% elif tab == 'event' %}
tab_url = default_url + 'event/';
2022-02-15 07:41:19 +01:00
tab_div = '#event';
2021-11-27 17:14:09 +01:00
{% endif %}
$.ajax({
url: tab_url,
dataType: "html",
success: function(data) {
$(tab_div).replaceWith($(tab_div).html(data));
},
error: function (exception) {
console.log(exception);
}
});
$('.get-info').click(function(){
$.ajax({
url: default_url + $(this).data("url"),
dataType: "html",
context: $(this),
success: function(data) {
$($(this).data("ref")).replaceWith($($(this).data("ref")).html(data));
},
error: function (exception) {
console.log(exception);
}
});
});
});
2021-11-02 14:05:32 +01:00
< / script >
{% endblock %}