2022-01-26 22:45:07 +01:00
|
|
|
{% extends "base.html" %}
|
2022-01-27 20:05:58 +01:00
|
|
|
{% load get_value_at_index %}
|
2022-01-26 22:45:07 +01:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="card mb-0">
|
|
|
|
<div class="card-header">
|
|
|
|
<h3 class="mb-0">{{ gymnast }}</h3>
|
|
|
|
<h4 class="card-title"> Chrono from {{ date_begin | date:'d-m-Y' }} to {{ date_end | date:'d-m-Y' }}</h4>
|
|
|
|
</div>
|
|
|
|
<div class="card-body pb-0 mb-0">
|
2022-01-27 20:05:58 +01:00
|
|
|
<div class="row pb-0 mb-0">
|
|
|
|
<div class="col-md-5">
|
|
|
|
<table class="table table-condensed" id="chrono_values_table">
|
2022-01-26 22:45:07 +01:00
|
|
|
{% for chrono in chrono_list %}
|
|
|
|
<tr>
|
|
|
|
{% for detail in chrono.details.all %}
|
2022-01-28 11:21:46 +01:00
|
|
|
{% with stat_value=stat_values|get_value_at_index:forloop.counter0 %}
|
|
|
|
<td class="{% if stat_value.max_score == detail.value %}cell-success{% endif %}{% if stat_value.min_score == detail.value %}cell-danger{% endif %}">{{ detail.value | floatformat:2 }}</td>
|
2022-01-27 20:05:58 +01:00
|
|
|
{% endwith %}
|
2022-01-26 22:45:07 +01:00
|
|
|
{% endfor %}
|
2022-01-27 20:05:58 +01:00
|
|
|
<td class="text-right"><b>{{ chrono.score | floatformat:2 }}</b></td>
|
2022-01-26 22:45:07 +01:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
<tr>
|
2022-01-28 11:21:46 +01:00
|
|
|
{% for value in stat_values %}
|
|
|
|
<td><b>{{ value.avg_score | floatformat:2 }}</b></td>
|
2022-01-26 22:45:07 +01:00
|
|
|
{% endfor %}
|
|
|
|
<td class="text-right"><b></b></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
2022-01-27 20:05:58 +01:00
|
|
|
<div class="col-md-7 alert {% if request.session.template == 0 %}skill-info{% else %}alert-secondary{% endif %}">
|
|
|
|
<canvas id="chartjs_chrono" class="chartjs"></canvas>
|
2022-01-26 22:45:07 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block footerscript %}
|
|
|
|
<script type="text/javascript">
|
2022-01-27 20:05:58 +01:00
|
|
|
// $('#chrono_values_table').DataTable({
|
|
|
|
// paging: false,
|
|
|
|
// searching: false,
|
|
|
|
// ordering: false,
|
|
|
|
// "bInfo" : false,
|
|
|
|
// });
|
|
|
|
|
2022-01-26 22:45:07 +01:00
|
|
|
var ctx = document.getElementById("chartjs_chrono").getContext("2d");
|
|
|
|
var gradient_stroke_1 = ctx.createLinearGradient(0, 450, 0, 0);
|
|
|
|
|
|
|
|
gradient_stroke_1.addColorStop(1, 'rgba(255, 99, 132, 0.4)');
|
|
|
|
gradient_stroke_1.addColorStop(0.75, 'rgba(255, 99, 132, 0.3)');
|
|
|
|
gradient_stroke_1.addColorStop(0.5, 'rgba(255, 99, 132, 0.2)');
|
|
|
|
gradient_stroke_1.addColorStop(0.25, 'rgba(255, 99, 132, 0)');
|
|
|
|
|
|
|
|
new Chart(document.getElementById("chartjs_chrono"), {
|
|
|
|
type: 'line',
|
|
|
|
data: {
|
2022-01-28 11:21:46 +01:00
|
|
|
labels: [{% for value in stat_values %}{{ value.avg_score | floatformat:3 }}, {% endfor %}],
|
2022-01-26 22:45:07 +01:00
|
|
|
datasets: [{
|
2022-01-28 11:21:46 +01:00
|
|
|
data: [{% for value in stat_values %}{{ value.avg_score | floatformat:3 }}, {% endfor %}],
|
2022-01-26 22:45:07 +01:00
|
|
|
pointBackgroundColor: 'rgb(255, 99, 132)',
|
|
|
|
borderColor: 'rgb(255, 99, 132)',
|
|
|
|
backgroundColor: gradient_stroke_1,
|
|
|
|
fill: true,
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
options: {
|
|
|
|
// scales: {
|
|
|
|
// yAxes: [{
|
|
|
|
// ticks: {
|
|
|
|
// suggestedMin: {{ min_value }},
|
|
|
|
// suggestedMax: {{ max_value }},
|
|
|
|
// }
|
|
|
|
// }]
|
|
|
|
// },
|
|
|
|
legend: {
|
|
|
|
display: false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|