Ultron/templates/gymnasts/details.html

204 lines
7.7 KiB
HTML
Raw Normal View History

2021-11-02 14:05:32 +01:00
{% extends "base.html" %}
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">
<div class="col-12 col-sm-4 col-md-4 col-lg-4 m-b-md">
<div class="card card-user">
<div class="card-body">
<p class="card-text">
<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>
</div>
</p>
<div class="card-description">
2021-11-17 10:39:16 +01:00
{{ gymnast.age }} years ({{ gymnast.birthdate | date:"d F Y" }})<span class="text-info"><b>{{ gymnast.get_orientation_display }}</b></span><br/>
{{ gymnast.club.name }} - {{ gymnast.club.place.city }}<br/>
2021-11-02 14:05:32 +01:00
<br \>
2021-11-12 15:32:24 +01:00
{% if best_routine or best_straightjump %}
<h5><u>Bests Scores</u></h5>
<ul>
{% if best_straightjump %}
<li><b>Straight</b> : {{ best_straightjump.0.date | date:"d-m-Y" }} - <b>{{ best_straightjump.0.tof }}</b></li>
{% endif %}
{% if best_routine %}
<li><b>Routine</b> : {{ best_routine.0.date | date:"d-m-Y" }} - <b>{{ best_routine.0.tof }}</b></li>
{% endif %}
</ul>
2021-11-02 14:05:32 +01:00
{% endif %}
{{ known_skill }} known skill on {{ nb_skill }} skills.
</div>
<div class="row">
<div class="col-6">
2021-11-17 10:39:16 +01:00
<a href="{% url 'chrono_create' gymnast.id %}" class="nav-item dropdown-item">New <i class="far fa-stopwatch"></i></a>
</div>
<div class="col-6">
2021-11-17 10:39:16 +01:00
<a href="{% url 'learnedskill_create' gymnast.id %}" class="nav-item dropdown-item">New <i class="tim-icons icon-molecule-40"></i></a>
</div>
2021-11-02 14:05:32 +01:00
</div>
</div>
</div>
</div>
<div class="col-12 col-sm-4 col-md-4 col-lg-4">
<div class="table-responsive pb-0"></div>
{% if learnedskills_list %}
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="skilltable">
2021-11-02 14:05:32 +01:00
<thead>
<tr>
2021-11-11 15:21:48 +01:00
<th class="header text-left" style="width: 25%">Date</th>
<th class="header text-left" style="width: 50%">Skill</th>
<th class="header text-left" style="width: 30%">Type</th>
2021-11-02 14:05:32 +01:00
</tr>
</thead>
<tbody>
2021-11-11 15:21:48 +01:00
{% for learnedskill in learnedskills_list %}
2021-11-02 14:05:32 +01:00
<tr>
<td class="text-left">{{ learnedskill.date | date:"d-m-Y" }}</a></td>
2021-11-12 15:32:24 +01:00
<td class="text-left"><a href="{% url 'skill_details' learnedskill.skill.id %}">{{ learnedskill.skill.short_label }}</a></td>
2021-11-11 15:21:48 +01:00
<td class="text-left">{{ learnedskill.get_cando_display }}</a></td>
2021-11-02 14:05:32 +01:00
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<table class="table">
<tr>
<td>No information found</td>
</tr>
</table>
{% endif %}
</div>
<div class="col-12 col-sm-4 col-md-4 card">
<div class="table-responsive pb-0">
{% if chronos_list %}
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="chronotable">
2021-11-02 14:05:32 +01:00
<thead>
<tr>
<th class="header text-left" style="width: 35%">Date</th>
<th class="header text-left" style="width: 35%">Type</th>
<th class="header text-left" style="width: 30%">Tof</th>
2021-11-02 14:05:32 +01:00
</tr>
</thead>
<tbody>
{% for chrono in chronos_list %}
<tr>
<td class="text-left">{{ chrono.date | date:"d-m-Y" }}</a></td>
2021-11-02 14:05:32 +01:00
<td class="text-left">{{ chrono.get_type_display }}</a></td>
<td class="text-right">{{ chrono.tof }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<table class="table">
<tr>
<td>No information found</td>
2021-11-02 14:05:32 +01:00
</tr>
</table>
{% endif %}
</div>
</div>
</div>
2021-11-12 15:32:24 +01:00
{% if chronos_list %}
2021-11-02 14:05:32 +01:00
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 card">
<div class="card-body pb-0">
<canvas id="chartjs_routine" class="chartjs" width="350" height="150"></canvas>
</div>
</div>
</div>
2021-11-12 15:32:24 +01:00
{% endif %}
{% endblock %}
2021-11-02 14:05:32 +01:00
{% block footerscript %}
2021-11-02 14:05:32 +01:00
<script type="text/javascript">
$(function(){
$('#skilltable').tablesorter({
dateFormat: "uk",
})
$('#chronotable').tablesorter({
dateFormat: "uk",
})
});
2021-11-02 14:05:32 +01:00
new Chart(document.getElementById("chartjs_routine"),{
type: 'line',
data:{
datasets:[
{% if straightjump_score %}
{
label: '10|',
backgroundColor: 'rgb(255, 99, 132, 0.25)',
borderColor: 'rgb(255, 99, 132)',
fill: true,
data: [
{% for chrono in straightjump_score %}
{
x: '{{ chrono.date | date:"d-m-Y" }}',
y: '{{ chrono.tof }}'
},
{% endfor %}
]
},
{% endif %}
{% if routine_score %}
{
label: 'L2',
backgroundColor: 'rgb(255, 159, 64, 0.25)',
borderColor: 'rgb(255, 159, 64)',
fill: true,
data: [
{% for chrono in routine_score %}
{
x: '{{ chrono.date | date:"d-m-Y" }}',
y: '{{ chrono.tof }}'
},
{% endfor %}
]
},
{% endif %}
],
},
options: {
scales: {
xAxes: [{
type: "time",
time: {
format: 'DD-MM-YYYY',
round: 'day'
},
scaleLabel: {
display: true,
}
}, ],
yAxes: [{
scaleLabel: {
display: true,
}
}]
},
legend: {
display: true,
position: 'bottom',
}
},
});
</script>
{% endblock %}