196 lines
8.6 KiB
HTML
196 lines
8.6 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% load skill_doughnut %}
|
|
{% load level_chart_bar %}
|
|
{% load has_group %}
|
|
{% load is_user_equal_to_gymnast %}
|
|
|
|
{% block page_title %}{{ gymnast.first_name }} {{ gymnast.last_name }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row">
|
|
<div class="col-12 col-sm-12 col-md-4 col-lg-4">
|
|
<div class="card card-user mb-4">
|
|
<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)">
|
|
{% if gymnast.picture %}
|
|
<img src="{{ gymnast.picture.url }}" alt="{{ gymnast }}" class="avatar">
|
|
{% endif %}
|
|
<h4 class="title">{{ gymnast.first_name }} {{ gymnast.last_name }}</h4>
|
|
</a>
|
|
<p class="description">
|
|
{{ last_season_information.club.name }}<br />
|
|
<b>{{ last_season_information.get_category_display }}</b>
|
|
</p>
|
|
</div>
|
|
<div class="card-description">
|
|
{% if gymnast.orientation %}
|
|
Twisting side : <b>{{ gymnast.get_orientation_display }}</b><br />
|
|
{% endif %}
|
|
{% if height_weight %}
|
|
<b>{{ height_weight.0.height }}cm - {{ height_weight.0.weight }}kg</b> ({{ height_weight.0.date | date:"d-m-Y" }})<br />
|
|
{% endif %}
|
|
<b>{{ last_season_information.number_of_training_sessions_per_week }} training/week</b> for <b>{{ last_season_information.number_of_hours_per_week }} hours/week</b><br />
|
|
<br />
|
|
{% if user_is_trainer and gymnast.informations %}
|
|
<p>{{ gymnast.to_markdown | safe }}</p>
|
|
<br />
|
|
{% endif %}
|
|
<li>
|
|
<b>10 |</b> : {% if best_straightjump %}<b>{{ best_straightjump.0.tof }}</b> ({{ best_straightjump.0.date | date:"d-m-Y" }}){% else %} <span class="text-muted">(no information)</span>{% endif %}
|
|
</li>
|
|
<li>
|
|
<b>Routine</b> : {% if best_routine %}<b>{{ best_routine.0.tof }}</b> ({{ best_routine.0.date | date:"d-m-Y" }}){% else %} <span class="text-muted">(no information)</span>{% endif %}
|
|
</li>
|
|
{% if user_is_trainer %}
|
|
<a href="{% url 'add_season_information_for_gymnast' gymnast.id %}">Add season details</a> -
|
|
<a href="{% url 'season_information_for_gymnast' gymnast.id %}">Seasons details</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-12 col-sm-12 col-md-4 col-lg-4">
|
|
{% if gymnast_nb_known_skills %}
|
|
{% generate_skill_doughnut gymnast.id %}
|
|
{% else %}
|
|
<p class="text-muted mt-3">No learned skill statistics.</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-12 col-sm-12 col-md-4 card mb-4">
|
|
{% if gymnast_nb_known_skills %}
|
|
{% generate_level_chart_bar gymnast.id %}
|
|
{% else %}
|
|
<p class="text-muted mt-3">No level/rank information.</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-3 col-sm-1 col-md-1 col-lg-1 col-xl-1">
|
|
<ul class="nav nav-pills nav-pills-primary nav-pills-icons flex-column">
|
|
|
|
<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>
|
|
|
|
{% if user_is_trainer or request.user|is_user_equal_to_gymnast:gymnast.id %}
|
|
<li class="nav-item">
|
|
<a class="nav-link get-info{% if tab == 'routine' %} active{% endif %}" data-toggle="tab" href="#document" data-ref="#document" data-url="document/" id="display_documents">
|
|
<i class="fal fa-file-pdf"></i> <!-- Documents -->
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
|
|
<li class="nav-item">
|
|
<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">
|
|
<i class="tim-icons icon-components"></i> <!-- Routines -->
|
|
</a>
|
|
</li>
|
|
|
|
<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 -->
|
|
</a>
|
|
</li>
|
|
|
|
{% if user_is_trainer or request.user|is_user_equal_to_gymnast:gymnast.id %}
|
|
<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 %}
|
|
|
|
<li class="nav-item">
|
|
<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>
|
|
</ul>
|
|
</div>
|
|
<div class="col-12 col-sm-11 col-md-11 col-lg-11 pr-0">
|
|
<div class="tab-content">
|
|
<div class="tab-pane{% if tab is None or tab == 'skill' %} active{% endif %}" id="skill"></div>
|
|
{% if user_is_trainer or request.user|is_user_equal_to_gymnast:gymnast.id %}
|
|
<div class="tab-pane{% if tab == 'document' %} active{% endif %}" id="document"></div>
|
|
{% endif %}
|
|
<div class="tab-pane{% if tab == 'routine' %} active{% endif %}" id="routine"></div>
|
|
<div class="tab-pane{% if tab == 'scores' %} active{% endif %}" id="scores"></div>
|
|
{% if user_is_trainer or request.user|is_user_equal_to_gymnast:gymnast.id %}
|
|
<div class="tab-pane{% if tab == 'physiological' %} active{% endif %}" id="physiological"></div>
|
|
{% endif %}
|
|
<div class="tab-pane{% if tab == 'event' %} active{% endif %}" id="event"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
{% block footerscript %}
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
var default_url = "{% url 'gymnast_details' gymnast.id %}";
|
|
var tab_div = '';
|
|
|
|
{% if tab is None or tab == 'skill' %}
|
|
tab_url = default_url + 'skill/';
|
|
tab_div = '#skill';
|
|
{% elif tab == 'document' %}
|
|
tab_url = default_url + 'document/';
|
|
tab_div = '#document';
|
|
{% elif tab == 'routine' %}
|
|
tab_url = default_url + 'routine/';
|
|
tab_div = '#routine';
|
|
{% elif tab == 'scores' %}
|
|
tab_url = default_url + 'scores_chrono/';
|
|
tab_div = '#scores';
|
|
{% elif tab == 'physiological' %}
|
|
tab_url = default_url + 'physiological/';
|
|
tab_div = '#physiological'
|
|
{% elif tab == 'event' %}
|
|
tab_url = default_url + 'event/';
|
|
tab_div = '#event';
|
|
{% 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);
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|