Gymnast User finished
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
7477950ffc
commit
1e512990fb
11
README.md
11
README.md
|
@ -44,6 +44,17 @@ Peut tout faire sauf :
|
|||
- Gérer les Pays
|
||||
- Gérer les lieux
|
||||
|
||||
##### Gymnaste
|
||||
|
||||
Un gymnaste peut tout faire pour *lui-même* :
|
||||
|
||||
- Ajouter un chrono
|
||||
- Ajouter un score
|
||||
- Ajouter un height/weight
|
||||
- …
|
||||
|
||||
|
||||
|
||||
### Skill
|
||||
|
||||
### Learned Skill
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
{% load skill_doughnut %}
|
||||
{% load level_chart_bar %}
|
||||
{% load has_group %}
|
||||
{% load is_user_equal_to_gymnast %}
|
||||
|
||||
{% block page_title %}{{ gymnast.first_name }} {{ gymnast.last_name }}{% endblock %}
|
||||
|
||||
|
@ -81,11 +83,13 @@
|
|||
<i class="fal fa-crosshairs"></i> <!-- Scores -->
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link get-info{% if tab == 'physiological' %} active{% endif %}" data-toggle="tab" href="#physiological" data-ref="#physiological" data-url="physiological/" id="display_physiological">
|
||||
<i class="fal fa-stethoscope"></i> <!-- Physical -->
|
||||
</a>
|
||||
</li>
|
||||
{% if request.user|has_group:"Trainer" or request.user|is_user_equal_to_gymnast:gymnast.id %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link get-info{% if tab == 'physiological' %} active{% endif %}" data-toggle="tab" href="#physiological" data-ref="#physiological" data-url="physiological/" id="display_physiological">
|
||||
<i class="fal fa-stethoscope"></i> <!-- Physical -->
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link get-info{% if tab == 'event' %} active{% endif %}" data-toggle="tab" href="#event" data-ref="#event" data-url="event/" id="display_event">
|
||||
<i class="fal fa-calendar-day"></i> <!-- Events -->
|
||||
|
@ -101,7 +105,9 @@
|
|||
|
||||
<div class="tab-pane{% if tab == 'scores' %} active{% endif %}" id="scores"></div>
|
||||
|
||||
<div class="tab-pane{% if tab == 'physiological' %} active{% endif %}" id="physiological"></div>
|
||||
{% if request.user|has_group:"Trainer" or request.user|is_user_equal_to_gymnast:gymnast.id %}
|
||||
<div class="tab-pane{% if tab == 'physiological' %} active{% endif %}" id="physiological"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="tab-pane{% if tab == 'event' %} active{% endif %}" id="event"></div>
|
||||
|
||||
|
@ -118,6 +124,7 @@
|
|||
$(document).ready(function() {
|
||||
var default_url = '/gymnast/details/' + {{ gymnast.id }} + '/';
|
||||
|
||||
// TODO: check pourquoi il n'y a pas le TAB physiological est pas présent.
|
||||
{% if tab is None or tab == 'skill' %}
|
||||
tab_url = default_url + 'skill/';
|
||||
var tab_div = '#skill';
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% load has_group %}
|
||||
{% load is_user_equal_to_gymnast %}
|
||||
|
||||
<div class="row justify-content-center ml-3 pr-0">
|
||||
<div class="col-md-12 pr-0">
|
||||
|
@ -56,11 +58,13 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
<div class="card-footer text-right text-muted pt-0">
|
||||
<a href="{% url 'mindstate_create_for_gymnast' gymnastid %}">
|
||||
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
||||
<i class="tim-icons icon-simple-add"></i>
|
||||
</button>
|
||||
</a>
|
||||
{% if request.user|has_group:"Trainer" or request.user|is_user_equal_to_gymnast:gymnastid %}
|
||||
<a href="{% url 'mindstate_create_for_gymnast' gymnastid %}">
|
||||
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
||||
<i class="tim-icons icon-simple-add"></i>
|
||||
</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
{% load has_group %}
|
||||
{% load is_user_equal_to_gymnast %}
|
||||
|
||||
<div class="row justify-content-center ml-1">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
|
@ -44,11 +47,13 @@
|
|||
</button>
|
||||
</a>
|
||||
|
||||
<a href="{% url 'link_routine_to_gymnast' gymnast_id %}">
|
||||
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
||||
<i class="tim-icons icon-simple-add"></i>
|
||||
</button>
|
||||
</a>
|
||||
{% if request.user|has_group:"Trainer" or request.user|is_user_equal_to_gymnast:gymnast_id %}
|
||||
<a href="{% url 'link_routine_to_gymnast' gymnast_id %}">
|
||||
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
||||
<i class="tim-icons icon-simple-add"></i>
|
||||
</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -95,11 +100,13 @@
|
|||
</button>
|
||||
</a>
|
||||
|
||||
<a href="{% url 'routinedone_create_for_gymnast' gymnast_id %}">
|
||||
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
||||
<i class="tim-icons icon-simple-add"></i>
|
||||
</button>
|
||||
</a>
|
||||
{% 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="tim-icons icon-simple-add"></i>
|
||||
</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
{% load has_group %}
|
||||
{% load is_user_equal_to_gymnast %}
|
||||
|
||||
<div class="row justify-content-center ml-1">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
|
@ -99,18 +102,20 @@
|
|||
|
||||
<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 ">
|
||||
<i class="fal fa-crosshairs"></i>
|
||||
</button>
|
||||
</a>
|
||||
<a href="{% url 'score_list_for_gymnast' gymnast_id %}">
|
||||
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
||||
<i class="fal fa-crosshairs"></i>
|
||||
</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<a href="{% url 'score_create_for_gymnast' gymnast_id %}">
|
||||
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
||||
<i class="tim-icons icon-simple-add"></i>
|
||||
</button>
|
||||
</a>
|
||||
{% 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="tim-icons icon-simple-add"></i>
|
||||
</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -131,18 +136,20 @@
|
|||
</div>
|
||||
<div class="card-footer text-right text-muted pt-0">
|
||||
{% if chrono_list %}
|
||||
<a href="{% url 'chrono_list_for_gymnast' gymnast_id %}">
|
||||
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
||||
<i class="fal fa-stopwatch"></i>
|
||||
</button>
|
||||
</a>
|
||||
<a href="{% url 'chrono_list_for_gymnast' gymnast_id %}">
|
||||
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
||||
<i class="fal fa-stopwatch"></i>
|
||||
</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<a href="{% url 'chrono_create_for_gymnast' gymnast_id %}">
|
||||
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
||||
<i class="tim-icons icon-simple-add"></i>
|
||||
</button>
|
||||
</a>
|
||||
{% if request.user|has_group:"Trainer" or request.user|is_user_equal_to_gymnast:gymnast_id %}
|
||||
<a href="{% url 'chrono_create_for_gymnast' gymnast_id %}">
|
||||
<button type="submit" value="add" class="btn btn-icon btn-warning ">
|
||||
<i class="tim-icons icon-simple-add"></i>
|
||||
</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{% load has_group %}
|
||||
|
||||
<div class="row justify-content-center ml-1">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
|
@ -74,7 +76,9 @@
|
|||
<table class="table table-striped tablesorter" id="table_planified_skill">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 14%"></th>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<th style="width: 14%"></th>
|
||||
{% endif %}
|
||||
<th style="width: 10%">Notation</th>
|
||||
<th class="header text-left" style="width: 55%">Label</th>
|
||||
<th class="header text-left" style="width: 10%">Deadline</th>
|
||||
|
@ -86,6 +90,7 @@
|
|||
<tbody>
|
||||
{% for skill in planified_skill %}
|
||||
<tr>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<td>
|
||||
<button type="button" rel="tooltip" class="btn btn-success btn-link btn-sm btn-icon checkUnknownSkill" data-gymnastid="{{ gymnast.id }}" data-skillid="{{ skill.id }}" data-link="1">
|
||||
<i class="far fa-check"></i>
|
||||
|
@ -100,6 +105,7 @@
|
|||
<i class="fal fa-thumbs-up"></i>
|
||||
</button>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>{{ skill.notation }}</td>
|
||||
<td class="text-left"><a href="{% url 'skill_details' skill.id %}">{{ skill.long_label }}</a></td>
|
||||
<td>{{ skill.plan_date | date:"d-m-Y" }}</td>
|
||||
|
@ -118,7 +124,9 @@
|
|||
<table class="table table-striped table-condensed tablesorter" id="table-skill-with-help">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10%"></th>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<th style="width: 10%"></th>
|
||||
{% endif %}
|
||||
<th style="width: 10%">Notation</th>
|
||||
<th class="header text-left" style="width: 55%">Label</th>
|
||||
<th class="header" style="width: 7%">Diff.</th>
|
||||
|
@ -129,6 +137,7 @@
|
|||
<tbody>
|
||||
{% for skill in skill_whith_help %}
|
||||
<tr>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<td>
|
||||
<button type="button" rel="tooltip" class="btn btn-success btn-link btn-sm btn-icon checkUnknownSkill" data-gymnastid="{{ gymnast.id }}" data-skillid="{{ skill.id }}" data-link="2">
|
||||
<i class="far fa-check-double"></i>
|
||||
|
@ -140,6 +149,7 @@
|
|||
<i class="fal fa-thumbs-up"></i>
|
||||
</button>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>{{ skill.notation }}</td>
|
||||
<td class="text-left"><a href="{% url 'skill_details' skill.id %}">{{ skill.long_label }}</a></td>
|
||||
<td>{{ skill.difficulty }}</td>
|
||||
|
@ -157,7 +167,9 @@
|
|||
<table class="table table-striped table-condensed tablesorter" id="table-skill-with-help">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10%"></th>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<th style="width: 10%"></th>
|
||||
{% endif %}
|
||||
<th style="width: 10%">Notation</th>
|
||||
<th class="header text-left" style="width: 55%">Label</th>
|
||||
<th class="header" style="width: 7%">Diff.</th>
|
||||
|
@ -168,6 +180,7 @@
|
|||
<tbody>
|
||||
{% for skill in skill_without_help %}
|
||||
<tr>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<td>
|
||||
<button type="button" rel="tooltip" class="btn btn-success btn-link btn-sm btn-icon checkUnknownSkill" data-gymnastid="{{ gymnast.id }}" data-skillid="{{ skill.id }}" data-link="3">
|
||||
<i class="far fa-link"></i>
|
||||
|
@ -176,6 +189,7 @@
|
|||
<i class="fal fa-thumbs-up"></i>
|
||||
</button>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>{{ skill.notation }}</td>
|
||||
<td class="text-left"><a href="{% url 'skill_details' skill.id %}">{{ skill.long_label }}</a></td>
|
||||
<td>{{ skill.difficulty }}</td>
|
||||
|
@ -193,7 +207,9 @@
|
|||
<table class="table table-striped table-condensed tablesorter" id="table-by-rank">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 12%">Actions</th>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<th style="width: 12%">Actions</th>
|
||||
{% endif %}
|
||||
<th style="width: 10%">Notation</th>
|
||||
<th class="header text-left" style="width: 50%">Label</th>
|
||||
<th class="header" style="width: 7%">Diff.</th>
|
||||
|
@ -204,6 +220,7 @@
|
|||
<tbody>
|
||||
{% for skill in skill_by_rank %}
|
||||
<tr>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<td>
|
||||
<a href="{% url 'add_skill_for_gymnast' gymnast.id skill.id %}">
|
||||
<button type="button" rel="tooltip" class="btn btn-success btn-link btn-sm btn-icon planify_skill">
|
||||
|
@ -220,6 +237,7 @@
|
|||
<i class="far fa-link"></i>
|
||||
</button>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>{{ skill.notation }}</td>
|
||||
<td class="text-left"><a href="{% url 'skill_details' skill.id %}">{{ skill.long_label }}</a></td>
|
||||
<td>{{ skill.difficulty }}</td>
|
||||
|
@ -237,7 +255,9 @@
|
|||
<table class="table table-striped table-condensed tablesorter" id="table-by-level">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 12%">Actions</th>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<th style="width: 12%">Actions</th>
|
||||
{% endif %}
|
||||
<th style="width: 10%">Notation</th>
|
||||
<th class="header text-left" style="width: 50%">Label</th>
|
||||
<th class="header" style="width: 7%">Diff.</th>
|
||||
|
@ -248,6 +268,7 @@
|
|||
<tbody>
|
||||
{% for skill in skill_by_level %}
|
||||
<tr>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<td>
|
||||
<button type="button" rel="tooltip" class="btn btn-success btn-link btn-sm btn-icon planify_skill" data-gymnastid="{{ gymnast.id }}" data-skillid="{{ skill.id }}" data-link="1">
|
||||
<i class="fal fa-share-all"></i>
|
||||
|
@ -262,6 +283,7 @@
|
|||
<i class="far fa-link"></i>
|
||||
</button>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>{{ skill.notation }}</td>
|
||||
<td class="text-left"><a href="{% url 'skill_details' skill.id %}">{{ skill.long_label }}</a></td>
|
||||
<td>{{ skill.difficulty }}</td>
|
||||
|
@ -279,7 +301,9 @@
|
|||
<table class="table table-striped table-condensed tablesorter" id="table-by-age">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 12%">Actions</th>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<th style="width: 12%">Actions</th>
|
||||
{% endif %}
|
||||
<th style="width: 10%">Notation</th>
|
||||
<th class="header text-left" style="width: 50%">Label</th>
|
||||
<th class="header" style="width: 7%">Diff.</th>
|
||||
|
@ -291,6 +315,7 @@
|
|||
<tbody>
|
||||
{% for skill in skill_by_age %}
|
||||
<tr>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<td>
|
||||
<button type="button" rel="tooltip" class="btn btn-success btn-link btn-sm btn-icon planify_skill" data-gymnastid="{{ gymnast.id }}" data-skillid="{{ skill.id }}" data-link="1">
|
||||
<i class="fal fa-share-all"></i>
|
||||
|
@ -305,6 +330,7 @@
|
|||
<i class="far fa-link"></i>
|
||||
</button>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>{{ skill.notation }}</td>
|
||||
<td class="text-left"><a href="{% url 'skill_details' skill.id %}">{{ skill.long_label }}</a></td>
|
||||
<td>{{ skill.difficulty }}</td>
|
||||
|
@ -322,7 +348,9 @@
|
|||
<table class="table table-striped table-condensed tablesorter" id="table-other">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 12%">Actions</th>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<th style="width: 12%">Actions</th>
|
||||
{% endif %}
|
||||
<th style="width: 10%">Notation</th>
|
||||
<th class="header text-left" style="width: 50%">Label</th>
|
||||
<th class="header" style="width: 7%">Diff.</th>
|
||||
|
@ -333,6 +361,7 @@
|
|||
<tbody>
|
||||
{% for skill in unknown_skill %}
|
||||
<tr>
|
||||
{% if request.user|has_group:"Trainer" %}
|
||||
<td>
|
||||
<button type="button" rel="tooltip" class="btn btn-success btn-link btn-sm btn-icon planify_skill" data-gymnastid="{{ gymnast.id }}" data-skillid="{{ skill.id }}" data-link="1">
|
||||
<i class="fal fa-share-all"></i>
|
||||
|
@ -347,6 +376,7 @@
|
|||
<i class="far fa-link"></i>
|
||||
</button>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>{{ skill.notation }}</td>
|
||||
<td class="text-left"><a href="{% url 'skill_details' skill.id %}">{{ skill.long_label }}</a></td>
|
||||
<td>{{ skill.difficulty }}</td>
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
from django import template
|
||||
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
@register.filter
|
||||
def is_user_equal_to_gymnast(user, gymnast_id):
|
||||
return user.gymnast.id == gymnast_id
|
Loading…
Reference in New Issue