diff --git a/rowers/templates/trainingplan.html b/rowers/templates/trainingplan.html index ad728fb0..072dd756 100644 --- a/rowers/templates/trainingplan.html +++ b/rowers/templates/trainingplan.html @@ -366,7 +366,7 @@

Click on the cycle to fold out its contents.

-

Click on the plan cycles to edit their names, start and end dates. +

The gray "filler" cycles are generated, adjusted and deleted automatically to ensure the entire plan diff --git a/rowers/templates/trainingplan_create.html b/rowers/templates/trainingplan_create.html index 2ec6d3d1..69086bde 100644 --- a/rowers/templates/trainingplan_create.html +++ b/rowers/templates/trainingplan_create.html @@ -72,9 +72,17 @@ {{ plan.enddate }} {{ plan.name }} {% if plan.status %} active {% else %} inactive {% endif %} - Edit + + {% if request.user == plan.manager %} + Edit + {% endif %} + Plan - Delete + + {% if request.user == plan.manager %} + Delete + {% endif %} + {% endfor %} diff --git a/rowers/views.py b/rowers/views.py index 2b8220a7..3fe9813a 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -16588,7 +16588,8 @@ def rower_trainingplan_view(request, r = getrequestrower(request,userid=userid) if not checkaccessuser(request.user,plan.manager): - raise PermissionDenied("Access denied") + if request.user.rower not in plan.rowers.all(): + raise PermissionDenied("Access denied") createmacrofillers(plan) macrocycles = TrainingMacroCycle.objects.filter(