Ultron/templates/people/gymnasts/report.html

382 lines
18 KiB
HTML

{% load static %}
{% load menuitems %}
{% load has_group %}
{% load is_user_equal_to_gymnast %}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="author" content="Gregory Trullemans">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="apple-touch-icon" sizes="76x76" href="{% static "img/apple-icon.png" %}">
<link rel="icon" type="image/png" href="{% static "img/favicon.png" %}">
<title>• Ultron - {{ gymnast.first_name }} {{ gymnast.last_name }} •</title>
<!-- Fonts and icons -->
<link href="https://fonts.googleapis.com/css?family=Poppins:200,300,400,600,700,800" rel="stylesheet" />
<!-- Font Awesome Pro -->
<link href="{% static "css/font_awesome_all_5.15.3.css" %}" rel="stylesheet" />
<!-- Full Calendar Plugin, full documentation here: https://github.com/fullcalendar/fullcalendar -->
<link href="{% static "js/plugins/fullcalendar/main.min.css" %}" rel="stylesheet" />
<!-- JQuery UI CSS -->
<link href="{% static "js/plugins/jqueryui/jquery-ui.theme.min.css" %}" rel="stylesheet" />
<link href="{% static "js/plugins/jqueryui/jquery-ui.min.css" %}" rel="stylesheet" />
<!-- Nucleo Icons -->
<link href="{% static "css/nucleo-icons.css" %}" rel="stylesheet" />
<!-- CSS Files -->
<link href="{% static "css/black-dashboard.css" %}" rel="stylesheet" />
<!-- Maps by mapbox -->
<script src='https://api.mapbox.com/mapbox.js/v3.2.0/mapbox.js'></script>
<link href='https://api.mapbox.com/mapbox.js/v3.2.0/mapbox.css' rel='stylesheet' />
<!-- Core JS Files -->
<script src="{% static "js/core/jquery-3.6.0.min.js" %}"></script>
<script src="{% static "js/core/popper.min.js" %}"></script>
<script src="{% static "js/core/bootstrap.min.js" %}"></script>
<!-- Chart JS -->
<script src="{% static "js/plugins/moment_2.29.1.min.js" %}"></script>
<script src="{% static "js/plugins/moment_locale_en-gb.js" %}"></script>
<script src="{% static "js/plugins/chartjs_2.9.4.min.js" %}"></script>
<!-- FullCalendar CSS -->
<!-- <link href="{% static "js/plugins/fullcalendar/main.css" %}" rel="stylesheet" /> -->
</head>
<body class="sidebar-mini white-content">
<div class="content">
<div class="row">
<div class="col-12 col-sm-4 col-md-4 col-lg-4">
<div class="card mb-4">
<div class="card-body">
<a href="{% url 'gymnast_report_preview' gymnast.id %}">Rapport</a>
<h4 class="title">{{ gymnast.first_name }} {{ gymnast.last_name }}</h4>
{{ gymnast.club.name }}<br />
<b>{{ gymnast.trainings_by_week }} training/week</b> for <b>{{ gymnast.hours_by_week }} hours/week</b><br />
{% 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 %}
<br />
{% if user_is_trainer and gymnast.informations %}
<p>{{ gymnast.informations }}</p>
<br />
{% endif %}
<h4>Personnal bests :</h4>
<li>
<b>10 |</b> : <b>{{ best_straightjump.0.tof }}</b> ({{ best_straightjump.0.date | date:"d-m-Y" }})
</li>
<li>
<b>R1</b> : <b>{{ best_tof_routine_1.0.tof }}</b> ({{ best_tof_routine_1.0.date | date:"d-m-Y" }})
</li>
<li>
<b>R2</b> : <b>{{ best_tof_routine_2.0.tof }}</b> ({{ best_tof_routine_2.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>
</div>
</div>
</div>
<div class="col-12 col-sm-4 col-md-4 col-lg-4">
(doughnut)
</div>
<div class="col-12 col-sm-4 col-md-4 card mb-4">
(stat par level/rank)
</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>
<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>
<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>
<!-- TODO : message d'erreur si TAB non géré. -->
</div>
</div>
</div>
</div>
</div>
</div>
<script src="{% static "js/plugins/perfect-scrollbar.jquery_1.4.0.min.js" %}"></script>
<!-- Plugin for Switches, full documentation here: http://www.jque.re/plugins/version3/bootstrap.switch/ -->
<script src="{% static "js/plugins/bootstrap-switch_3.3.4.js" %}"></script>
<!-- Plugin for Sweet Alert -->
<script src="{% static "js/plugins/sweetalert2.min.js" %}"></script>
<!-- Plugin for Sorting Tables -->
<script src="{% static "js/plugins/jquery.tablesorter_2.0.5b.js" %}"></script>
<!-- Forms Validations Plugin -->
<script src="{% static "js/plugins/jquery.validate_1.17.0.min.js" %}"></script>
<!-- Plugin for the Wizard, full documentation here: https://github.com/VinceG/twitter-bootstrap-wizard -->
<script src="{% static "js/plugins/jquery.bootstrap-wizard_1.4.2.js" %}"></script>
<!-- Plugin for Select, full documentation here: http://silviomoreto.github.io/bootstrap-select -->
<script src="{% static "js/plugins/bootstrap-selectpicker_1.12.4.js" %}"></script>
<!-- Plugin for the DateTimePicker, full documentation here: https://eonasdan.github.io/bootstrap-datetimepicker/ -->
<script src="{% static "js/plugins/bootstrap-datetimepicker_4.17.47.js" %}"></script>
<!-- DataTables.net Plugin, full documentation here: https://datatables.net/ -->
<script src="{% static "js/plugins/jquery.dataTables_1.10.18.min.js" %}"></script>
<!-- Plugin for Tags, full documentation here: https://github.com/bootstrap-tagsinput/bootstrap-tagsinputs -->
<script src="{% static "js/plugins/bootstrap-tagsinput_0.8.0.js" %}"></script>
<!-- Plugin for Fileupload, full documentation here: http://www.jasny.net/bootstrap/javascript/#fileinput -->
<script src="{% static "js/plugins/jasny-bootstrap_3.1.3.min.js" %}"></script>
<!-- Full Calendar Plugin, full documentation here: https://github.com/fullcalendar/fullcalendar -->
<script src="{% static "js/plugins/fullcalendar/main.js" %}"></script>
<!-- Vector Map plugin, full documentation here: http://jvectormap.com/documentation/ -->
<script src="{% static "js/plugins/jquery-jvectormap_2.0.4.js" %}"></script>
<!-- Plugin for the Sliders, full documentation here: http://refreshless.com/nouislider/ -->
<script src="{% static "js/plugins/nouislider_11.1.0.min.js" %}"></script>
<!-- Notifications Plugin -->
<script src="{% static "js/plugins/bootstrap-notify_3.1.5.js" %}"></script>
<!-- Control Center for Black Dashboard: parallax effects, scripts for the example pages etc -->
<!-- <script src="{% static "js/black-dashboard.min.js" %}"></script> -->
<script src="{% static "js/black-dashboard.js" %}"></script>
<!-- Jquery UI for autocomplete, etc. -->
<script src="{% static "js/plugins/jqueryui/jquery-ui.min.js" %}"></script>
<script type="text/javascript">
$(document).ready(function() {
$().ready(function() {
$sidebar = $('.sidebar');
$navbar = $('.navbar');
$main_panel = $('.main-panel');
$full_page = $('.full-page');
$sidebar_responsive = $('body > .navbar-collapse');
// {% if request.session.is_sidebar_minified %}sidebar_mini_active = true;
// {% else %}sidebar_mini_active = false;
// {% endif %}
// {% if request.session.template == 0 %}white_color = false;
// {% else %}white_color = true;
// {% endif %}
white_color = true;
window_width = $(window).width();
fixed_plugin_open = $('.sidebar .sidebar-wrapper .nav li.active a p').html();
// {% if request.session.sidebar == 1 %}color = 'blue';
// {% elif request.session.sidebar == 2 %}color = 'green';
// {% elif request.session.sidebar == 3 %}color = 'orange';
// {% elif request.session.sidebar == 4 %}color = 'red';
// {% else %}color = 'purple'
// {% endif %}
// $sidebar.attr('data', color);
// $main_panel.attr('data', color);
// $full_page.attr('filter-color', color);
// $sidebar_responsive.attr('data', color);
$('.fixed-plugin a').click(function(event) {
if ($(this).hasClass('switch-trigger')) {
if (event.stopPropagation) {
event.stopPropagation();
} else if (window.event) {
window.event.cancelBubble = true;
}
}
});
$('.fixed-plugin .background-color span').click(function() {
$(this).siblings().removeClass('active');
$(this).addClass('active');
var new_color = $(this).data('color');
if ($sidebar.length != 0)
$sidebar.attr('data', new_color);
if ($main_panel.length != 0)
$main_panel.attr('data', new_color);
if ($full_page.length != 0)
$full_page.attr('filter-color', new_color);
if ($sidebar_responsive.length != 0)
$sidebar_responsive.attr('data', new_color);
});
// $('.switch-sidebar-mini input').on("switchChange.bootstrapSwitch", function() {
// var $btn = $(this);
// if (sidebar_mini_active == true) {
// $('body').removeClass('sidebar-mini');
// sidebar_mini_active = false;
// blackDashboard.showSidebarMessage('Sidebar mini deactivated...');
// } else {
// $('body').addClass('sidebar-mini');
// sidebar_mini_active = true;
// blackDashboard.showSidebarMessage('Sidebar mini activated...');
// }
// // we simulate the window Resize so the charts will get updated in realtime.
// var simulateWindowResize = setInterval(function() {
// window.dispatchEvent(new Event('resize'));
// }, 180);
// // we stop the simulation of Window Resize after the animations are completed
// setTimeout(function() {
// clearInterval(simulateWindowResize);
// }, 1000);
// });
// $('.switch-change-color input').on("switchChange.bootstrapSwitch", function() {
// var $btn = $(this);
// if (white_color == true) {
// $('body').addClass('change-background');
// setTimeout(function() {
// $('body').removeClass('change-background');
// $('body').removeClass('white-content');
// }, 900);
// white_color = true; // false
// } else {
// $('body').addClass('change-background');
// setTimeout(function() {
// $('body').removeClass('change-background');
// $('body').addClass('white-content');
// }, 900);
// white_color = true;
// }
// });
// $('.light-badge').click(function() {
// $('body').addClass('white-content');
// });
// $('.dark-badge').click(function() {
// $('body').removeClass('white-content');
// });
// $('#inlineFormInputGroup').focus();
// $('#search-button').click(function(){
// alert('Clicked !');
// $('#inlineFormInputGroup').focus();
// });
});
});
</script>
<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 == '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>
<link href="{% static "css/ultron.css" %}" rel="stylesheet" />
</body>
</html>