diff --git a/README.md b/README.md index f658e45642..41b5af73ce 100644 --- a/README.md +++ b/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 diff --git a/templates/people/gymnasts/details.html b/templates/people/gymnasts/details.html index 909b5876a3..ceb57ba0cd 100644 --- a/templates/people/gymnasts/details.html +++ b/templates/people/gymnasts/details.html @@ -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 @@ -
+ {% if request.user|has_group:"Trainer" %} + | + {% endif %} | Notation | Label | Deadline | @@ -86,6 +90,7 @@|||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ {% endif %} | {{ skill.notation }} | {{ skill.long_label }} | {{ skill.plan_date | date:"d-m-Y" }} | @@ -118,7 +124,9 @@
+ {% if request.user|has_group:"Trainer" %} + | + {% endif %} | Notation | Label | Diff. | @@ -129,6 +137,7 @@||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ {% endif %} | {{ skill.notation }} | {{ skill.long_label }} | {{ skill.difficulty }} | @@ -157,7 +167,9 @@
+ {% if request.user|has_group:"Trainer" %} + | + {% endif %} | Notation | Label | Diff. | @@ -168,6 +180,7 @@|||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ {% endif %} | {{ skill.notation }} | {{ skill.long_label }} | {{ skill.difficulty }} | @@ -193,7 +207,9 @@
Actions | + {% if request.user|has_group:"Trainer" %} +Actions | + {% endif %}Notation | Label | Diff. | @@ -204,6 +220,7 @@||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ {% endif %} | {{ skill.notation }} | {{ skill.long_label }} | {{ skill.difficulty }} | @@ -237,7 +255,9 @@
Actions | + {% if request.user|has_group:"Trainer" %} +Actions | + {% endif %}Notation | Label | Diff. | @@ -248,6 +268,7 @@|||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ {% endif %} | {{ skill.notation }} | {{ skill.long_label }} | {{ skill.difficulty }} | @@ -279,7 +301,9 @@
Actions | + {% if request.user|has_group:"Trainer" %} +Actions | + {% endif %}Notation | Label | Diff. | @@ -291,6 +315,7 @@||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
+ {% endif %} | {{ skill.notation }} | {{ skill.long_label }} | {{ skill.difficulty }} | @@ -322,7 +348,9 @@
Actions | + {% if request.user|has_group:"Trainer" %} +Actions | + {% endif %}Notation | Label | Diff. | @@ -333,6 +361,7 @@
---|---|---|---|---|
+ {% endif %} | {{ skill.notation }} | {{ skill.long_label }} | {{ skill.difficulty }} | diff --git a/ultron/tools/templatetags/is_user_equal_to_gymnast.py b/ultron/tools/templatetags/is_user_equal_to_gymnast.py new file mode 100644 index 0000000000..10aada1423 --- /dev/null +++ b/ultron/tools/templatetags/is_user_equal_to_gymnast.py @@ -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