khana/templates/program_day.html

230 lines
12 KiB
HTML

{% extends "base.html" %}
<!-- {% block page_title %}.: {{ gymnast }} :.{% endblock %} -->
<!-- {% block title %}{{ gymnast }} - Semaine {{ week_number }}<br />Club : {{ gymnast.club.name }}{% endblock %} -->
{% block content %}
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
<div class="card">
<div class="card-header">
<h3 class="card-title"><b>{{ gymnast }}</b></h3>
<h4 class="card-subtitle mb-2 text-muted"><b>{{ gymnast.club.name }} - Semaine {{ week_number }}</b></h4>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-8">
<div class="card mb-4">
<div class="card-body">
<table class="table table-striped">
<thead>
<th class="text-center"></th>
<th class="text-center"><a href="{% url 'dayprogram' gymnast.id '2019-03-22' %}">{{ day }}</a></th>
</thead>
<tbody>
{% for roundline in roundline_list %}
<tr>
{% for round in roundline %}
<td class="text-center pt-1 pb-1">
{% if round.is_important %}<b>{% endif %}
{% if round.educative %}
{{ round.educative }}
{% elif round.round_information %}
{{ round.round_information }}
{% elif round %}
{{ round }}
{% endif %}
{% if round.nb_of_realisation %}
&nbsp;&nbsp;&nbsp;{{ round.nb_of_realisation }}x
{% endif %}
{% if round.is_important %}</b>{% endif %}
</td>
{% if round.round_information or round.educative %}
<td class="pt-1 pb-1">
<select class="form-control col-5 coach_evaluation" data-roundid="{{ round.id }}">
<option {% if round.coach_evaluation == 0 %}selected{% endif %}>0</option>
<option {% if round.coach_evaluation == 1 %}selected{% endif %}>1</option>
<option {% if round.coach_evaluation == 2 %}selected{% endif %}>2</option>
<option {% if round.coach_evaluation == 3 %}selected{% endif %}>3</option>
<option {% if round.coach_evaluation == 4 %}selected{% endif %}>4</option>
<option {% if round.coach_evaluation == 5 %}selected{% endif %}>5</option>
<option {% if round.coach_evaluation == 6 %}selected{% endif %}>6</option>
<option {% if round.coach_evaluation == 7 %}selected{% endif %}>7</option>
<option {% if round.coach_evaluation == 8 %}selected{% endif %}>8</option>
<option {% if round.coach_evaluation == 9 %}selected{% endif %}>9</option>
<option {% if round.coach_evaluation == 10 %}selected{% endif %}>10</option>
</select>
</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="card">
<div class="card-body">
<p>{{ gymnast.content }}</p>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card">
<div class="card-body">
<h4 class="text-center">Routines</h4>
{% if l1 or l2 or l3 or l4%}
<div class="row">
<div class="col-md-6 pr-1">
{% if l1 %}
<table class="table table-striped table-condensed">
<thead>
<th colspan="2" class="text-center">L1</th>
</thead>
<tbody>
{% for skill_link in l1 %}
<tr>
<td class="text-left">{{ skill_link.skill.notation }}</td>
<td class="text-left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
{% endfor %}
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
{% endif %}
</div>
<div class="col-md-6 pl-1">
{% if l2 %}
<table class="table table-striped table-condensed">
<thead>
<th colspan="2" class="text-center">L2</th>
</thead>
<tbody>
{% for skill_link in l2 %}
<tr>
<td class="text-left">{{ skill_link.skill.notation }}</td>
<td class="text-right">{{ skill_link.skill.difficulty }}</td>
</tr>
{% endfor %}
<tr>
<td></td>
<td class="text-right"><b>{{ difficulty_l2 }}</b></td>
</tr>
</tbody>
</table>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-md-6 pr-1">
{% if l3 %}
<table class="table table-striped table-condensed">
<thead>
<th colspan="2" class="text-center">L3</th>
</thead>
<tbody>
{% for skill_link in l3 %}
<tr>
<td class="text-left">{{ skill_link.skill.notation }}</td>
<td class="text-right">{{ skill_link.skill.difficulty }}</td>
</tr>
{% endfor %}
<tr>
<td>&nbsp;</td>
<td class="text-right"><b>{{ difficulty_l3 }}</b></td>
</tr>
</tbody>
</table>
{% endif %}
</div>
<div class="col-md-6 pl-1">
{% if l4 or next_skill %}
<table class="table table-striped table-condensed">
{% if l4 %}
<thead>
<th colspan="2" class="text-center">L4</th>
</thead>
<tbody>
{% for skill_link in l4 %}
<tr>
<td class="text-left">{{ skill_link.skill.notation }}</td>
<td class="text-right">{{ skill_link.skill.difficulty }}</td>
</tr>
{% endfor %}
<tr>
<td></td>
<td class="text-right"><b>{{ difficulty_l4 }}</b></td>
</tr>
</tbody>
{% else %}
<thead>
<th colspan="2" class="text-center">Next Skills</th>
</thead>
<tbody>
{% for skill in next_skill %}
<tr>
<td class="text-center" colspan="2"><a href="{% url 'skill_details' skill.id %}">{{ skill.notation }}</a></td>
</tr>
{% endfor %}
</tbody>
{% endif %}
</table>
{% endif %}
</div>
</div>
{% else %}
Aucune série définie.
{% endif %}
<h4 class="text-center">Chronos</h4>
<table class="table table-striped table-condensed">
<tbody>
<tr>
<td class="text-center"><b>L1</b></td>
<td class="text-center">{{ chrono_l1 }}</td>
<td class="text-center"><b>L3</b></td>
<td class="text-center">{% if chrono_l3 %}{{ chrono_l3 }}{% else %}-{% endif %}</td>
</tr>
<tr>
<td class="text-center"><b>L2</b></td>
<td class="text-center">{{ chrono_l2 }}</td>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
<tr>
<td class="text-center"><b>10|</b></td>
<td class="text-center">{{ chrono_best_ten }}</td>
<td class="text-center"><b>T/S</b></td>
<td class="text-center">{{ time_by_skill|floatformat:2 }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock%}
{% block footerscript %}
<script type="text/javascript">
$(document).ready(function() {
$('select').change(function(){
alert('la valeur du round ' + $(this).data("roundid") + ' a été changée.')
// appel ajax pour enregistrer la nouvelle valeur
// program/round/<int:roundid>/evaluate/by/coach/<int:coachid>/value/<int:value>
$.ajax({
url: '/program/round/' + $(this).data("roundid") + '/evaluate/by/coach/1/value/' + $(this).val() + '/',
// }).done(function() {
// alert('suppression du li');
// $('ol li:last-child').prev().remove();
});
});
});
</script>
{% endblock %}