Compare commits
2 Commits
58c5d83658
...
96ecf9b022
Author | SHA1 | Date |
---|---|---|
Gregory Trullemans | 96ecf9b022 | |
Gregory Trullemans | eac92bb36f |
|
@ -8,7 +8,7 @@
|
|||
</div>
|
||||
<!-- {{ nb_known_skill }} known skills on {{ nb_skill }} skills. -->
|
||||
{% for level in percentages %}
|
||||
{% if level.2 > 0 %}
|
||||
{% if level.2 > 0 and level.2 <= level.1 %}
|
||||
<div class="progress-container progress-warning mt-2">
|
||||
<div class="progress" style="height: 10px;">
|
||||
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: {% widthratio level.2 level.1 100 %}%;"> Level {{ level.0 }}</div>
|
|
@ -22,7 +22,7 @@
|
|||
<div class="card-header">
|
||||
<h4>Next events</h4>
|
||||
</div>
|
||||
<div class="card-body pt-0 pb-0 pr-1 pl-1">
|
||||
<div class="card-body pt-0 pb-0 pr-0 pl-0">
|
||||
{% if next_event_list %}
|
||||
<table class="table tablesorter table-condensed table-striped" id="next_events">
|
||||
<thead>
|
||||
|
@ -42,31 +42,19 @@
|
|||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('#next_events').tablesorter({
|
||||
dateFormat: "uk",
|
||||
headers: {
|
||||
0: { sorter: false }, // disable first column
|
||||
},
|
||||
sortList: [[3,0]]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% else %}
|
||||
<p class="text-muted">No next event associated to this gymnast.</p>
|
||||
<p class="pl-3 pb-3 text-muted">No next event associated to this gymnast.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 pl-1">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4>Notes</h4>
|
||||
</div>
|
||||
<div class="card-body pt-0 pb-0 pr-1 pl-1">
|
||||
<div class="card-body pt-0 pb-0 pr-0 pl-0">
|
||||
{% if last_notes_list %}
|
||||
<table class="table tablesorter table-condensed table-striped" id="notes">
|
||||
<thead>
|
||||
|
@ -94,7 +82,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p class="text-muted">No note for this gymnast.</p>
|
||||
<p class="pl-3 text-muted">No note for this gymnast.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card-footer text-right text-muted pt-0">
|
||||
|
@ -110,18 +98,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#notes').tablesorter({
|
||||
dateFormat: "uk",
|
||||
headers: {
|
||||
0: { sorter: false }, // disable first column
|
||||
},
|
||||
sortList: [[3,1]],
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{% if previous_events %}
|
||||
<div class="row justify-content-center ml-3 pr-0">
|
||||
<div class="col-md-12 pr-0">
|
||||
|
@ -196,6 +172,26 @@
|
|||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('#next_events').tablesorter({
|
||||
dateFormat: "uk",
|
||||
headers: {
|
||||
0: { sorter: false }, // disable first column
|
||||
},
|
||||
sortList: [[3,0]]
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#notes').tablesorter({
|
||||
dateFormat: "uk",
|
||||
headers: {
|
||||
0: { sorter: false }, // disable first column
|
||||
},
|
||||
sortList: [[3,1]],
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#previous_events').tablesorter({
|
||||
dateFormat: "uk",
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col-md-6 text-right text-muted pt-0">
|
||||
<div class="col-md-6 {% if not ghr_list %}offset-md-6{% endif %} text-right text-muted pt-0">
|
||||
{% if routine_done_list %}
|
||||
<a href="{% url 'routinedone_list_for_gymnast' gymnast_id %}">
|
||||
<button type="submit" value="list" class="btn btn-icon btn-warning mr-2">
|
||||
|
|
|
@ -487,7 +487,7 @@
|
|||
});
|
||||
});
|
||||
|
||||
$('#table_by_rank, #table_by_level, #table_by_age, #table_unknown_skill, #table_skill_with_help, #table_skill_without_help').tablesorter({
|
||||
$('#table_by_rank, #table_by_level, #table_by_age, #table_unknown_skill, #table_skill_with_help, #table_skill_without_help, #table_skill_chained').tablesorter({
|
||||
{% if user_is_trainer %}
|
||||
headers: {
|
||||
0: { sorter: false }, // disable first column
|
||||
|
|
|
@ -237,7 +237,7 @@ class Gymnast(Markdownizable):
|
|||
c. on calcule les statistiques du gymnaste par rapport aux skill
|
||||
|
||||
SINON:
|
||||
on va chercher tous les Skill qui existent, on les met dans une liste et on les compte.
|
||||
on va chercher tous les Skill qui existent et on les compte.
|
||||
|
||||
"""
|
||||
if desired_type != "level" and desired_type != "rank":
|
||||
|
@ -245,10 +245,10 @@ class Gymnast(Markdownizable):
|
|||
|
||||
context = {}
|
||||
skill_max = self.skill_max_for_type(desired_type)
|
||||
cpt_known_skill_by_type = self.nb_known_skill_by_type(desired_type)
|
||||
gymnast_nb_known_skills = self.known_skills.distinct("skill").count()
|
||||
|
||||
if skill_max > 0:
|
||||
cpt_known_skill_by_type = self.nb_known_skill_by_type(desired_type) # à remonter ???
|
||||
cpt_skill_by_type = nb_skill_by_type(skill_max, desired_type)
|
||||
context["total_skill"] = nb_skill_lte_type(skill_max, desired_type)
|
||||
context["percentages"] = compute_statistics_by_type(
|
||||
|
|
|
@ -5,7 +5,7 @@ from ultron.people.models import Gymnast
|
|||
register = template.Library()
|
||||
|
||||
|
||||
@register.inclusion_tag("people/gymnasts/skill_level_chart_bar.html")
|
||||
@register.inclusion_tag("people/gymnasts/gymnast_level_chart_bar.html")
|
||||
def generate_level_chart_bar(gymnast_id):
|
||||
"""
|
||||
Tag permettant l'affichage des statistiques d'un gymnaste : le nombre de saut qu'il sait faire
|
||||
|
|
|
@ -5,7 +5,7 @@ from ultron.followup.models import LearnedSkill
|
|||
register = template.Library()
|
||||
|
||||
|
||||
@register.inclusion_tag("people/gymnasts/skill_doughnut.html")
|
||||
@register.inclusion_tag("people/gymnasts/gymnast_level_doughnut.html")
|
||||
def generate_skill_doughnut(gymnast_id):
|
||||
"""
|
||||
Récupère les différents nombres de skill du gymnaste (masterised, chained, without help,
|
||||
|
|
|
@ -259,7 +259,7 @@ def gymnast_display_events_and_notes(request, gymnast_id):
|
|||
@require_http_methods(["GET"])
|
||||
def gymnast_display_accident(request, gymnast_id):
|
||||
"""
|
||||
Renvoie deux listes d'évènements : ceux à venir et ceux passés.
|
||||
Renvoie la liste des accidents d'un gymnaste.
|
||||
"""
|
||||
accident_list = Accident.objects.filter(gymnast=gymnast_id)
|
||||
context = {"accident_list": accident_list, "gymnast_id": gymnast_id}
|
||||
|
|
Loading…
Reference in New Issue