linking back to plan
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
{% load rowerfilters %}
|
||||
<div class="grid_2 alpha">
|
||||
<p>
|
||||
{% if timeperiod and rower %}
|
||||
<a class="button gray small" href="/rowers/sessions/{{ timeperiod }}/rower/{{ rower.id }}">Plan Overview</a>
|
||||
{% elif timeperiod %}
|
||||
<a class="button gray small" href="/rowers/sessions/{{ timeperiod }}">Plan Overview</a>
|
||||
{% else %}
|
||||
<a class="button gray small" href="/rowers/sessions">Plan Overview</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
<div class="grid_2 dropdown alpha">
|
||||
<button class="grid_2 alpha button gray small dropbtn">Overview</button>
|
||||
<div class="dropdown-content">
|
||||
{% if timeperiod and rower %}
|
||||
<a class="button gray small" href="/rowers/sessions/{{ timeperiod }}/rower/{{ rower.id }}">Sessions Overview</a>
|
||||
{% elif timeperiod %}
|
||||
<a class="button gray small" href="/rowers/sessions/{{ timeperiod }}">Sessions Overview</a>
|
||||
{% else %}
|
||||
<a class="button gray small" href="/rowers/sessions">Sessions Overview</a>
|
||||
{% endif %}
|
||||
<a class="button gray small" href="/rowers/plan/{{ plan.id }}">Plan Overview</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
<p>
|
||||
|
||||
@@ -20,16 +20,6 @@
|
||||
<h1>Training Plan - {{ plan.name }}</h1>
|
||||
<p>This plan starts on {{ plan.startdate }} and ends on {{ plan.enddate }}. The training plan target is: {{ plan.target.name }} on {{ plan.target.date }}.</p>
|
||||
<p><a href="/rowers/editplan/{{ plan.id }}">Edit the plan</a></p>
|
||||
<p>Click on the plan cycles below to edit their names, start and end dates. The gray "filler"
|
||||
cycles are generated, adjusted and deleted automatically to ensure the entire plan
|
||||
duration is covered with non-overlapping cycles.
|
||||
Once you edit a filler cycle, it become a user-defined cycle, which cannot be deleted
|
||||
by the system.</p>
|
||||
<p>A good way to organize the plan is to think of micro cycles as training weeks. Macro cycles
|
||||
are typically used to address specific phases of preparation and to indicate the racing
|
||||
season and may span several months.
|
||||
Meso cycles can be used to group sequences of three to five light, medium and
|
||||
hard weeks. It is recommended to work from left to right, starting with the macro cycles.</p>
|
||||
</div>
|
||||
<div class="grid_4 alpha">
|
||||
<h2>Macro Cycles</h2>
|
||||
@@ -55,7 +45,12 @@
|
||||
{% if todays_date <= macrocycle.0.enddate|date:"Y-m-d" %}
|
||||
<p><a href="/rowers/macrocycle/{{ macrocycle.0.id }}">edit</a>
|
||||
/
|
||||
<a href="/rowers/deletemacrocycle/{{ macrocycle.0.id }}">delete</a></p>
|
||||
<a href="/rowers/deletemacrocycle/{{ macrocycle.0.id }}">delete</a>
|
||||
/
|
||||
<a href='/rowers/sessions/{{ macrocycle.0.startdate|date:"Y-m-d" }}/{{ macrocycle.0.enddate|date:"Y-m-d" }}'>sessions</a>
|
||||
</p>
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -72,8 +67,14 @@
|
||||
{% if todays_date <= mesocycle.0.enddate|date:"Y-m-d" %}
|
||||
<p><a href="/rowers/mesocycle/{{ mesocycle.0.id }}">edit</a>
|
||||
/
|
||||
<a href="/rowers/deletemesocycle/{{ mesocycle.0.id }}">delete</a></p>
|
||||
<a href="/rowers/deletemesocycle/{{ mesocycle.0.id }}">delete</a>
|
||||
/
|
||||
<a href='/rowers/sessions/{{ mesocycle.0.startdate|date:"Y-m-d" }}/{{ mesocycle.0.enddate|date:"Y-m-d" }}'>sessions</a>
|
||||
|
||||
</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -91,8 +92,13 @@
|
||||
<p>
|
||||
<a href="/rowers/microcycle/{{ microcycle.id }}">edit</a>
|
||||
/
|
||||
<a href="/rowers/deletemicrocycle/{{ microcycle.id }}">delete</a></p>
|
||||
<a href="/rowers/deletemicrocycle/{{ microcycle.id }}">delete</a>
|
||||
/
|
||||
<a href='/rowers/sessions/{{ microcycle.startdate|date:"Y-m-d" }}/{{ microcycle.enddate|date:"Y-m-d" }}'>sessions</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -102,5 +108,23 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_12">
|
||||
<p>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
|
||||
duration is covered with non-overlapping cycles.
|
||||
Once you edit a filler cycle, it become a user-defined cycle, which cannot be deleted
|
||||
by the system.</p>
|
||||
<p>Filler cycles which have a filler cycle as a parent cannot be edited
|
||||
or deleted. You have to edit the parent cycle first. The reason is
|
||||
that children of filler cycles are not safe. They are deleted when
|
||||
their parent is deleted by the system.</p>
|
||||
<p>Click on "Sessions" in the cycle of your interest to see details
|
||||
of the individual training sessions planned for this period.</p>
|
||||
<p>A good way to organize the plan is to think of micro cycles as training weeks. Macro cycles
|
||||
are typically used to address specific phases of preparation and to indicate the racing
|
||||
season and may span several months.
|
||||
Meso cycles can be used to group sequences of three to five light, medium and
|
||||
hard weeks. It is recommended to work from left to right, starting with the macro cycles.</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -12483,6 +12483,7 @@ def plannedsession_multiclone_view(
|
||||
def plannedsession_create_view(request,timeperiod='thisweek',rowerid=0):
|
||||
|
||||
r = getrequestrower(request,rowerid=rowerid)
|
||||
startdate,enddate = get_dates_timeperiod(timeperiod)
|
||||
|
||||
if request.method == 'POST':
|
||||
sessioncreateform = PlannedSessionForm(request.POST)
|
||||
@@ -12539,26 +12540,46 @@ def plannedsession_create_view(request,timeperiod='thisweek',rowerid=0):
|
||||
fstartdate = arrow.get(request.session['fstartdate']).date()
|
||||
except KeyError:
|
||||
fstartdate = timezone.now().date()
|
||||
if fstartdate < startdate:
|
||||
fstartdate = startdate
|
||||
try:
|
||||
fenddate = arrow.get(request.session['fenddate']).date()
|
||||
except KeyError:
|
||||
fenddate = timezone.now().date()
|
||||
if fenddate > enddate:
|
||||
fenddate = enddate
|
||||
try:
|
||||
fprefdate = arrow.get(request.session['fprefdate']).date()
|
||||
except KeyError:
|
||||
fprefdate = timezone.now().date()
|
||||
|
||||
if fprefdate < startdate:
|
||||
fprefdate = startdate
|
||||
|
||||
if fprefdate > enddate:
|
||||
fprefdate = enddate
|
||||
|
||||
forminitial = {
|
||||
'startdate':fstartdate,
|
||||
'enddate':fenddate,
|
||||
'preferreddate':fprefdate
|
||||
}
|
||||
else:
|
||||
forminitial = {}
|
||||
preferreddate = startdate
|
||||
if preferreddate < timezone.now().date():
|
||||
preferreddate = timezone.now().date()
|
||||
|
||||
if preferreddate > enddate:
|
||||
preferreddate = enddate
|
||||
|
||||
forminitial = {
|
||||
'startdate':startdate,
|
||||
'enddate':enddate,
|
||||
'preferreddate':preferreddate,
|
||||
}
|
||||
|
||||
sessioncreateform = PlannedSessionForm(initial=forminitial)
|
||||
|
||||
startdate,enddate = get_dates_timeperiod(timeperiod)
|
||||
sps = get_sessions(r,startdate=startdate,enddate=enddate)
|
||||
|
||||
return render(request,'plannedsessioncreate.html',
|
||||
@@ -12943,7 +12964,15 @@ def plannedsessions_view(request,timeperiod='thisweek',rowerid=0):
|
||||
r = getrequestrower(request,rowerid=rowerid)
|
||||
|
||||
startdate,enddate = get_dates_timeperiod(timeperiod)
|
||||
|
||||
|
||||
try:
|
||||
trainingplan = TrainingPlan.objects.filter(
|
||||
startdate__lte = startdate,
|
||||
enddate__gte = enddate)[0]
|
||||
except IndexError:
|
||||
trainingplan = None
|
||||
|
||||
|
||||
sps = get_sessions(r,startdate=startdate,enddate=enddate)
|
||||
|
||||
completeness = {}
|
||||
@@ -12966,6 +12995,7 @@ def plannedsessions_view(request,timeperiod='thisweek',rowerid=0):
|
||||
{
|
||||
'teams':get_my_teams(request.user),
|
||||
'plannedsessions':sps,
|
||||
'plan':trainingplan,
|
||||
'rower':r,
|
||||
'timeperiod':timeperiod,
|
||||
'completeness':completeness,
|
||||
@@ -13120,6 +13150,7 @@ def plannedsessions_manage_view(request,timeperiod='thisweek',rowerid=0,
|
||||
|
||||
|
||||
# Clone an existing planned session
|
||||
# need clarity on cloning behavior time shift
|
||||
@user_passes_test(hasplannedsessions,login_url="/rowers/planmembership/",
|
||||
redirect_field_name=None)
|
||||
def plannedsession_clone_view(request,id=0,rowerid=0,
|
||||
@@ -13146,8 +13177,9 @@ def plannedsession_clone_view(request,id=0,rowerid=0,
|
||||
|
||||
ps.startdate = timezone.now().date()
|
||||
ps.enddate = (timezone.now()+deltadays).date()
|
||||
ps.preferreddate = ps.preferreddate+deltadays
|
||||
ps.name += ' (copy)'
|
||||
|
||||
|
||||
ps.save()
|
||||
|
||||
for rower in rowers:
|
||||
|
||||
Reference in New Issue
Block a user