Minor update

This commit is contained in:
Gregory Trullemans 2024-05-14 12:18:46 +02:00
parent 0541fa6be3
commit 8915a390f3
3 changed files with 68 additions and 78 deletions

View File

@ -81,7 +81,7 @@
</h3>
</div>
</div>
<div class="card-body pb-0">
<div class="card-body pt-0">
{% if injury_list %}
<table class="table tablesorter table-striped table-condensed" id="injury_table">
<thead>

View File

@ -4,42 +4,58 @@
<div class="row justify-content-center">
<div class="col-md-6 pl-0">
<div class="card mb-3">
<div class="card-header">
<h4>Scores</h4>
<div class="card-header row">
<div class="col-8">
<h4>Scores</h4>
</div>
<div class="col-4 text-right">
<h3 class="mb-0">
{% if score_list %}
<a href="{% url 'score_list_for_gymnast' gymnast_id %}">
<i class="fal fa-crosshairs text-warning"></i>
</a>
{% endif %}
&nbsp;
{% if request.user|has_group:"trainer" or request.user|is_user_equal_to_gymnast:gymnast_id %}
<a href="{% url 'score_create_for_gymnast' gymnast_id %}">
<i class="fas fa-plus text-warning"></i>
</a>
{% endif %}
</h3>
</div>
</div>
<div class="card-body pt-0 pb-0 pr-0 pl-0">
<div class="card-body pt-0 pr-0 pl-0">
{% if score_list %}
<div><canvas id="chart_score_competition" class="chartjs" width="400" height="200"></canvas></div>
{% else %}
<p class="pl-3 text-muted">No score recorded for this gymnast.</p>
{% endif %}
</div>
<div class="card-footer text-right text-muted pt-0">
{% if score_list %}
<a href="{% url 'score_list_for_gymnast' gymnast_id %}">
<button type="submit" value="add" class="btn btn-icon btn-warning mr-2">
<i class="fal fa-crosshairs"></i>
</button>
</a>
{% endif %}
{% if request.user|has_group:"trainer" or request.user|is_user_equal_to_gymnast:gymnast_id %}
<a href="{% url 'score_create_for_gymnast' gymnast_id %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="fas fa-plus"></i>
</button>
</a>
{% endif %}
</div>
</div>
</div>
<div class="col-md-6 pl-0">
<div class="card mb-3">
<div class="card-header">
<h4>Routine's statistics</h4>
<div class="card-header row">
<div class="col-8">
<h4>Routine's statistics</h4>
</div>
<div class="col-4 text-right">
<h3 class="mb-0">
{% if routine_one_done_list or routine_two_done_list %}
<a href="{% url 'routinedone_list_for_gymnast' gymnast_id %}">
<i class="far fa-chart-bar text-warning"></i>
</a>
{% endif %}
{% if request.user|has_group:"trainer" or request.user|is_user_equal_to_gymnast:gymnast_id %}
<a href="{% url 'routinedone_create_for_gymnast' gymnast_id %}">
<i class="fas fa-plus text-warning"></i>
</a>
{% endif %}
</h3>
</div>
</div>
<div class="card-body pt-0 pb-0 pr-0 pl-0">
<div class="card-body p-0">
{% if routine_one_done_list or routine_two_done_list %}
<div><canvas id="chart_routine_done" class="chartjs" width="400" height="200"></canvas></div>
{% else %}
@ -84,23 +100,6 @@
{% endif %}
</div>
{% endif %}
<div class="col-md-6 {% if not ghr_list %}offset-md-6{% endif %} text-right text-muted pt-0">
{% if routine_one_done_list or routine_two_done_list %}
<a href="{% url 'routinedone_list_for_gymnast' gymnast_id %}">
<button type="submit" value="list" class="btn btn-icon btn-warning mr-2">
<i class="far fa-chart-bar"></i>
</button>
</a>
{% endif %}
{% if request.user|has_group:"trainer" or request.user|is_user_equal_to_gymnast:gymnast_id %}
<a href="{% url 'routinedone_create_for_gymnast' gymnast_id %}">
<button type="submit" value="add" class="btn btn-icon btn-warning ">
<i class="fas fa-plus"></i>
</button>
</a>
{% endif %}
</div>
</div>
</div>
</div>
@ -128,11 +127,9 @@
</a>
{% endif %}
</h3>
</div>
</div>
<div class="card-body pb-0 pr-0 pl-0">
<div class="card-body pt-0 pr-0 pl-0">
{% if ghr_list %}
<div class="pr-1 pl-1">
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="routine_table">
@ -171,17 +168,11 @@
<script type="text/javascript">
$(document).ready(function () {
$('#routine_table').tablesorter({
// headers: {
// 0: { sorter: false }, // disable first column
// },
dateFormat : "ddmmyyyy",
sortList: [[0, 0],]
});
$('#stats_table').tablesorter({
// headers: {
// 0: { sorter: false }, // disable first column
// },
dateFormat : "ddmmyyyy",
sortList: [[0, 1],]
});
@ -197,10 +188,7 @@
csrfmiddlewaretoken: '{{ csrf_token }}'
},
}).done(function () {
//
// RELOAD DE L'ONGLET
//
//
location.reload(); // recharge TOUTE la page... Overkill !
// tab_url = {% url 'gymnast_details_tab' gymnast_id 'routine' %};
// tab_div = '#routine';

View File

@ -90,7 +90,7 @@
<div class="tab-content tab-space tab-subcategories p-0">
{% if planned_skill %}
<div class="tab-pane {% if planned_skill %}active{% endif %}" id="planned_skill">
<table class="table table-condensed table-striped tablesorter" id="table_planned_skill">
<table class="table table-condensed table-striped tablesorter m-0 p-0" id="table_planned_skill">
<thead>
<tr>
<th style="width: 15%"></th>
@ -150,7 +150,7 @@
{% if confused_skill %}
<div class="tab-pane {% if confused_skill and not planned_skill %}active{% endif %}" id="confused_skill">
<table class="table table-striped table-condensed tablesorter" id="table_confused_skill">
<table class="table table-striped table-condensed tablesorter m-0 p-0" id="table_confused_skill">
<thead>
<tr>
<th style="width: 10%"></th>
@ -196,7 +196,7 @@
{% if skill_whith_help %}
<div class="tab-pane {% if skill_whith_help and not confused_skill and not planned_skill %}active{% endif %}" id="skill_whith_help">
<table class="table table-striped table-condensed tablesorter" id="table_skill_with_help">
<table class="table table-striped table-condensed tablesorter m-0 p-0" id="table_skill_with_help">
<thead>
<tr>
<th style="width: 10%"></th>
@ -240,7 +240,7 @@
{% if skill_without_help %}
<div class="tab-pane {% if skill_without_help and not skill_whith_help and not confused_skill and not planned_skill %}active{% endif %}" id="skill_without_help">
<table class="table table-striped table-condensed tablesorter" id="table_skill_without_help">
<table class="table table-striped table-condensed tablesorter m-0 p-0" id="table_skill_without_help">
<thead>
<tr>
<th style="width: 12%"></th>
@ -284,7 +284,7 @@
{% if skill_chained %}
<div class="tab-pane {% if skill_chained and not skill_without_help and not skill_whith_help and not confused_skill and not planned_skill %}active{% endif %}" id="skill_chained">
<table class="table table-striped table-condensed tablesorter" id="table_skill_chained">
<table class="table table-striped table-condensed tablesorter m-0 p-0" id="table_skill_chained">
<thead>
<tr>
<th style="width: 12%"></th>
@ -328,7 +328,7 @@
{% if skill_masterised %}
<div class="tab-pane {% if skill_masterised and not skill_chained and not skill_without_help and not skill_whith_help and not confused_skill and not planned_skill %}active{% endif %}" id="skill_masterised">
<table class="table table-striped table-condensed tablesorter" id="table_skill_masterised">
<table class="table table-striped table-condensed tablesorter m-0 p-0" id="table_skill_masterised">
<thead>
<tr>
<th style="width: 12%"></th>
@ -372,7 +372,7 @@
{% if skill_by_rank %}
<div class="tab-pane {% if skill_by_rank and not skill_masterised and not skill_chained and not skill_without_help and not skill_whith_help and not confused_skill and not planned_skill %}active{% endif %}" id="skill_by_rank">
<table class="table table-striped table-condensed tablesorter" id="table_by_rank">
<table class="table table-striped table-condensed tablesorter m-0 p-0" id="table_by_rank">
<thead>
<tr>
<th style="width: 13%">Actions</th>
@ -420,7 +420,7 @@
{% if skill_by_level %}
<div class="tab-pane {% if skill_by_level and not skill_by_rank and not skill_masterised and not skill_chained and not skill_without_help and not skill_whith_help and not confused_skill and not planned_skill %}active{% endif %}" id="skill_by_level">
<table class="table table-striped table-condensed tablesorter" id="table_by_level">
<table class="table table-striped table-condensed tablesorter m-0 p-0" id="table_by_level">
<thead>
<tr>
<th style="width: 15%">Actions</th>
@ -468,7 +468,7 @@
{% if skill_by_age %}
<div class="tab-pane {% if skill_by_age and not skill_by_level and not skill_by_rank and not skill_masterised and not skill_chained and not skill_without_help and not skill_whith_help and not confused_skill and not planned_skill %}active{% endif %}" id="skill_by_age">
<table class="table table-striped table-condensed tablesorter" id="table_by_age">
<table class="table table-striped table-condensed tablesorter m-0 p-0" id="table_by_age">
<thead>
<tr>
<th style="width: 15%">Actions</th>
@ -517,15 +517,15 @@
{% if unknown_skill %}
<div class="tab-pane {% if unknown_skill and not skill_by_age and not skill_by_level and not skill_by_rank and not skill_masterised and not skill_chained and not skill_without_help and not skill_whith_help and not confused_skill and not planned_skill %}active{% endif %}" id="unknown_skill">
<table class="table tablesorter table-striped" data-sort="table" id="table_unknown_skill">
<thead class="text-primary">
<table class="table tablesorter table-striped m-0 p-0" data-sort="table" id="table_unknown_skill" style="width: 100%">
<thead>
<tr>
<th>Actions</th>
<th>Notation</th>
<th class="text-left">Label</th>
<th class="not-displayed-on-phone">Diff.</th>
<th class="not-displayed-on-phone">Level</th>
<th class="not-displayed-on-phone">Rank</th>
<th class="header">Actions</th>
<th class="header">Notation</th>
<th class="header text-left">Label</th>
<th class="header not-displayed-on-phone">Diff.</th>
<th class="header not-displayed-on-phone">Level</th>
<th class="header not-displayed-on-phone">Rank</th>
</tr>
</thead>
<tbody>
@ -579,7 +579,7 @@
$('.checkUnknownSkill').click(function(){
$.ajax({
// TODO: chande hardcoded url
url: '/follow-up/learnedskill/new/',
url: '{% url "gymnast_learn_skill" %}',
data: {
gymnast_id: $(this).data('gymnast_id'),
skill_id: $(this).data('skill_id'),
@ -625,14 +625,16 @@
sortList: [[3, 0], [6,0], [5,0], [3, 0]]
});
// TODO: faire fonctionner le DataTable pour pouvoir limiter la hauteur du div.
// $('#table_by_age').DataTable({
// scrollY: '57.3vh',
// scrollCollapse: true,
// paging: false,
// $('#table_by_rank, #table_by_level, #table_by_age, #table_unknown_skill, #table_skill_with_help, #table_skill_without_help, #table_skill_chained').DataTable({
// scrollY: '65vh',
// });
// $('#table_skill_chained').DataTable({
// searching: false,
// // scrollY: '60vh',
// ordering: false,
// "bInfo": false,
// paging: false,
// info: false,
// });
});
</script>