Private
Public Access
1
0
Files
rowsandall/rowers/templates/trainingplan.html
2022-04-12 09:51:12 +02:00

503 lines
21 KiB
HTML

{% extends "newbase.html" %}
{% load static %}
{% load rowerfilters %}
{% block title %}Rowsandall Training Plans{% endblock %}
{% block main %}
<script>
function toggle(source) {
checkboxes = document.querySelectorAll("input[type='checkbox']");
for (var i=0, n=checkboxes.length;i<n;i++) {
if (checkboxes[i].name.includes('selector')) {
checkboxes[i].checked = source.checked
}
}
}
</script>
<h1>Training Plan - {{ plan.name }}</h1>
<p>This plan starts on {{ plan.startdate }} and ends on {{ plan.enddate }}.
{% if plan.target %}
The training plan target is: {{ plan.target.name }} on {{ plan.target.date }}.
{% endif %}
</p>
<h2>Notes</h2>
<p>
{{ plan.notes }}
</p>
{% if plan|mayeditplan:request %}
<p><a href="/rowers/editplan/{{ plan.id }}">Edit the plan</a></p>
{% endif %}
<p><a href="/rowers/plan/{{ plan.id }}/execution/?when={{ plan.startdate|date:'Y-m-d' }}/{{ plan.enddate|date:'Y-m-d' }}/">Plan vs Actual chart</a></p>
<p><a href="/rowers/sessions/user/{{ rower.user.id }}?when={{ plan.startdate|date:'Y-m-d' }}/{{ plan.enddate|date:'Y-m-d' }}/">
View all sessions
</a>
<h2>Plan Macro, Meso and Micro Cycles</h2>
<p><input type="checkbox" href="" onClick="toggle(this)" />Unfold/Fold all</p>
<ul class="cd-accordion-menu animated">
<!-- Start Macrocycle For Loop -->
{% for key, macrocycle in cycles.items %}
<li class="has-kids" id="macros">
<input type="checkbox" name="macro-selector" id="macro-selector-{{ macrocycle.0.id }}">
<label for="macro-selector-{{ macrocycle.0.id }}">Macro Cycle {{ macrocycle.0.name }} ({{ macrocycle.0.startdate }} - {{ macrocycle.0.enddate }})</label>
<ul>
<li id="macro-{{ macrocycle.0.id }}">
{% if macrocycle.0.type == 'filler' %}
<div class='filler'>
<div class="padded">
<table width="100%">
<tr>
<th colspan="4">
{{ macrocycle.0.name }} ({{ macrocycle.0.startdate }} - {{ macrocycle.0.enddate }})
</th>
</tr>
{% if todays_date <= macrocycle.0.enddate %}
<tr>
&nbsp;
</tr>
<tr>
<td colspan="4">
{% if macrocycle.0|mayeditplan:request %}
<a href="/rowers/macrocycle/{{ macrocycle.0.id }}/">edit</a>
/
<a href="/rowers/deletemacrocycle/{{ macrocycle.0.id }}/">delete</a>
/
<a href='/rowers/sessions/create/user/{{ rower.user.id }}?when={{ macrocycle.0.startdate|date:"Y-m-d" }}/{{ macrocycle.0.enddate|date:"Y-m-d" }}'>add sessions</a>
/
{% endif %}
<a href='/rowers/sessions/user/{{ rower.user.id }}?when={{ macrocycle.0.startdate|date:"Y-m-d" }}/{{ macrocycle.0.enddate|date:"Y-m-d" }}'>view sessions</a>
</td>
</tr>
{% else %}
<tr>
&nbsp;
</tr>
<tr>
<a href='/rowers/sessions/user/{{ rower.user.id }}?when={{ macrocycle.0.startdate|date:"Y-m-d" }}/{{ macrocycle.0.enddate|date:"Y-m-d" }}'>view sessions</a>
</tr>
{% endif %}
</table>
</div>
</div>
{% else %}
<div class='palegreen'>
<div class="padded">
<table width="100%">
<tr>
<th colspan="4">
{{ macrocycle.0.name }} ({{ macrocycle.0.startdate }} - {{ macrocycle.0.enddate }})
</th>
</tr>
{% if macrocycle.0.notes %}
<tr>
<td colspan="4">
{{ macrocycle.0.notes|linebreaks }}
</td>
</tr>
{% endif %}
{% if macrocycle.0.type == 'userdefined' and macrocycle.0.plan.status %}
<tr>
<td></td>
<td>dist (m)</td>
<td>t (min)</td>
<td>rScore</td>
<td>TRIMP</td>
</tr>
<tr>
<td>plan</td>
<td>{{ macrocycle.0.plandistance }}</td>
<td>{{ macrocycle.0.plantime }}</td>
<td>{{ macrocycle.0.planrscore }}</td>
<td>{{ macrocycle.0.plantrimp }}</td>
</tr>
<tr>
<td>actual</td>
<td>{{ macrocycle.0.actualdistance }}</td>
<td>{{ macrocycle.0.actualtime }}</td>
<td>{{ macrocycle.0.actualrscore }}</td>
<td>{{ macrocycle.0.actualtrimp }}</td>
</tr>
{% endif %}
{% if todays_date <= macrocycle.0.enddate %}
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4">
{% if macrocycle.0|mayeditplan:request %}
<a href="/rowers/macrocycle/{{ macrocycle.0.id }}/">edit</a>
/
<a href="/rowers/deletemacrocycle/{{ macrocycle.0.id }}/">delete</a>
/
<a href="/rowers/macrocycle/{{ macrocycle.0.id }}/planbymonths/user/{{ rower.user.id }}">
Replan by Months
</a>
/
<a href='/rowers/sessions/create/user/{{ rower.user.id }}?when={{ macrocycle.0.startdate|date:"Y-m-d" }}/{{ macrocycle.0.enddate|date:"Y-m-d" }}'>add sessions</a>
/
{% endif %}
<a href='/rowers/sessions/user/{{ rower.user.id }}?when={{ macrocycle.0.startdate|date:"Y-m-d" }}/{{ macrocycle.0.enddate|date:"Y-m-d" }}'>view sessions</a>
</td>
</tr>
{% else %}
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4">
<a href="/rowers/macrocycle/{{ macrocycle.0.id }}/planbymonths/user/{{ rower.user.id }}">
Replan by Months
</a>
/
<a href='/rowers/sessions/user/{{ rower.user.id }}?when={{ macrocycle.0.startdate|date:"Y-m-d" }}/{{ macrocycle.0.enddate|date:"Y-m-d" }}'>view sessions</a>
</td>
</tr>
{% endif %}
</table>
</div>
</div>
{% endif %}
</li>
<li class="has-kids" id="mesos">
<input type="checkbox" name="meso-selector" id="meso-selector-{{ macrocycle.0.id }}">
<label for="meso-selector-{{ macrocycle.0.id }}">Meso Cycles</label>
<ul>
<!-- Meso Cycle For Loop -->
{% for key, mesocycle in macrocycle.1.items %}
<li id="meso-{{ mesocycle.0.id }}-{{ macrocycle.0.id }}">
{% if mesocycle.0.type == 'filler' %}
<div class='filler'>
<div class="padded">
<table width="100%">
<tr>
<th colspan="4">
Meso {{ mesocycle.0.name }} ({{ mesocycle.0.startdate }} - {{ mesocycle.0.enddate }})
</th>
</tr>
{% if todays_date <= mesocycle.0.enddate %}
{% if mesocycle.0.plan.type == 'userdefined' %}
<tr>
&nbsp;
</tr>
<tr>
<td colspan="4">
{% if mesocycle.0|mayeditplan:request %}
<a href="/rowers/mesocycle/{{ mesocycle.0.id }}/">edit</a>
/
<a href="/rowers/deletemesocycle/{{ mesocycle.0.id }}/">delete</a>
/
<a href='/rowers/sessions/create/user/{{ rower.user.id }}?when={{ mesocycle.0.startdate|date:"Y-m-d" }}/{{ mesocycle.0.enddate|date:"Y-m-d" }}'>add sessions</a>
/
{% endif %}
<a href='/rowers/sessions/user/{{ rower.user.id }}?when={{ mesocycle.0.startdate|date:"Y-m-d" }}/{{ mesocycle.0.enddate|date:"Y-m-d" }}'>view sessions</a>
</td>
</tr>
{% endif %}
{% else %}
<tr>
&nbsp;
</tr>
<tr>
<a href='/rowers/sessions/user/{{ rower.user.id }}?when={{ mesocycle.0.startdate|date:"Y-m-d" }}/{{ mesocycle.0.enddate|date:"Y-m-d" }}'>view sessions</a>
</tr>
{% endif %}
</table>
</div>
</div>
{% else %}
<div class='lightsalmon'>
<div class="padded">
<table width="100%">
<tr>
<th colspan="4">
Meso {{ mesocycle.0.name }} ({{ mesocycle.0.startdate }} - {{ mesocycle.0.enddate }})
</th>
</tr>
{% if mesocycle.0.notes %}
<tr>
<td colspan="4">
{{ mesocycle.0.notes|linebreaks }}
</td>
</tr>
{% endif %}
{% if mesocycle.0.type == 'userdefined' and mesocycle.0.plan.plan.status %}
<tr>
<td></td>
<td>dist (m)</td>
<td>t (min)</td>
<td>rScore</td>
<td>TRIMP</td>
</tr>
<tr>
<td>plan</td>
<td>{{ mesocycle.0.plandistance }}</td>
<td>{{ mesocycle.0.plantime }}</td>
<td>{{ mesocycle.0.planrscore }}</td>
<td>{{ mesocycle.0.plantrimp }}</td>
</tr>
<tr>
<td>actual</td>
<td>{{ mesocycle.0.actualdistance }}</td>
<td>{{ mesocycle.0.actualtime }}</td>
<td>{{ mesocycle.0.actualrscore }}</td>
<td>{{ mesocycle.0.actualtrimp }}</td>
</tr>
{% endif %}
{% if todays_date <= mesocycle.0.enddate %}
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4">
{% if mesocycle.0|mayeditplan:request %}
<a href="/rowers/mesocycle/{{ mesocycle.0.id }}/">edit</a>
/
<a href="/rowers/deletemesocycle/{{ mesocycle.0.id }}/">delete</a>
/
<a href="/rowers/mesocycle/{{ mesocycle.0.id }}/planbyweeks/user/{{ rower.user.id }}">
Replan by Weeks
</a>
/
<a href='/rowers/sessions/create/user/{{ rower.user.id }}?when={{ mesocycle.0.startdate|date:"Y-m-d" }}/{{ mesocycle.0.enddate|date:"Y-m-d" }}'>add sessions</a>
/
{% endif %}
<a href='/rowers/sessions/user/{{ rower.user.id }}?when={{ mesocycle.0.startdate|date:"Y-m-d" }}/{{ mesocycle.0.enddate|date:"Y-m-d" }}'>view sessions</a>
</td>
</tr>
{% else %}
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4">
<a href="/rowers/mesocycle/{{ mesocycle.0.id }}/planbyweeks/user/{{ rower.user.id }}">
Replan by Weeks
</a>
/
<a href='/rowers/sessions/user/{{ rower.user.id }}?when={{ mesocycle.0.startdate|date:"Y-m-d" }}/{{ mesocycle.0.enddate|date:"Y-m-d" }}'>view sessions</a>
</td>
</tr>
{% endif %}
</table>
</div>
</div>
{% endif %}
</li>
<li class="has-kids" id="micros">
<input type="checkbox" name="micro-selector"
id="micro-selector-{{ macrocycle.0.id }}-{{ mesocycle.0.id }}">
<label
for="micro-selector-{{ macrocycle.0.id }}-{{ mesocycle.0.id }}">
Micro Cycles
</label>
<ul>
<!-- MicroCycle For Loop -->
{% for microcycle in mesocycle.1 %}
<li
id="micro-{{ microcycle.id }}-{{ mesocycle.0.id }}-{{ macrocycle.id }}">
{% if microcycle.type == 'filler' %}
<div class="filler">
<div class="padded">
<table width="100%">
<tr>
<th colspan="4">
Micro {{ microcycle.name }} ({{ microcycle.startdate }} - {{ microcycle.enddate }})
</th>
</tr>
{% if todays_date <= microcycle.enddate %}
{% if microcycle.plan.type == 'userdefined' %}
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4">
{% if microcycle|mayeditplan:request %}
<a href="/rowers/microcycle/{{ microcycle.id }}/">edit</a>
/
<a href="/rowers/deletemicrocycle/{{ microcycle.id }}/">delete</a>
/
<a href='/rowers/sessions/create/user/{{ rower.user.id }}?when={{ microcycle.startdate|date:"Y-m-d" }}/{{ microcycle.enddate|date:"Y-m-d" }}'>add sessions</a>
/
{% endif %}
<a href='/rowers/sessions/user/{{ rower.user.id }}?when={{ microcycle.startdate|date:"Y-m-d" }}/{{ microcycle.enddate|date:"Y-m-d" }}'>view sessions</a>
</td>
</tr>
{% endif %}
{% else %}
{% if microcycle.plan.type == 'userdefined' %}
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4">
<a href='/rowers/sessions/user/{{ rower.user.id }}?when={{ microcycle.startdate|date:"Y-m-d" }}/{{ microcycle.enddate|date:"Y-m-d" }}'>view sessions</a>
</td>
</tr>
{% endif %}
{% endif %}
</table>
</div>
</div>
{% else %}
<div class="paleblue">
<div class="padded">
<table width="100%">
<tr>
<th colspan="4">
Micro {{ microcycle.name }} ({{ microcycle.startdate }} - {{ microcycle.enddate }})
</th>
</tr>
{% if microcycle.notes %}
<tr>
<td colspan="4">
{{ microcycle.notes|linebreaks }}
</td>
</tr>
{% endif %}
{% if microcycle.plan.plan.plan.status %}
<tr>
<td></td>
<td>dist (m)</td>
<td>t (min)</td>
<td>rScore</td>
<td>TRIMP</td>
</tr>
<tr>
<td>plan</td>
<td>{{ microcycle.plandistance }}</td>
<td>{{ microcycle.plantime }}</td>
<td>{{ microcycle.planrscore }}</td>
<td>{{ microcycle.plantrimp }}</td>
</tr>
<tr>
<td>actual</td>
<td>{{ microcycle.actualdistance }}</td>
<td>{{ microcycle.actualtime }}</td>
<td>{{ microcycle.actualrscore }}</td>
<td>{{ microcycle.actualtrimp }}</td>
</tr>
{% endif %}
{% if todays_date <= microcycle.enddate %}
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4">
{% if microcycle|mayeditplan:request %}
<a href="/rowers/microcycle/{{ microcycle.id }}">edit</a>
/
<a href="/rowers/deletemicrocycle/{{ microcycle.id }}">delete</a>
/
<a href='/rowers/sessions/create/user/{{ rower.user.id }}?when={{ microcycle.startdate|date:"Y-m-d" }}/{{ microcycle.enddate|date:"Y-m-d" }}'>add sessions</a>
/
{% endif %}
<a href='/rowers/sessions/user/{{ rower.user.id }}?when={{ microcycle.startdate|date:"Y-m-d" }}/{{ microcycle.enddate|date:"Y-m-d" }}'>view sessions</a>
</td>
</tr>
{% else %}
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4">
<a href='/rowers/sessions/user/{{ rower.user.id }}?when={{ microcycle.startdate|date:"Y-m-d" }}/{{ microcycle.enddate|date:"Y-m-d" }}'>view sessions</a>
</td>
</tr>
{% endif %}
</table>
</div>
</div>
{% endif %}
</li>
{% endfor %}
<!-- end microcycle forloop -->
</ul>
</li>
{% endfor %}
<!-- end mesocycle forloop -->
</ul>
</li>
</ul>
</li>
{% endfor %}
<!-- end macrocycle forloop -->
</ul>
<p>Click on the cycle to fold out its contents.</p>
<p>
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>
{% endblock %}
{% block scripts %}
{% if thismicroid %}
<script type='text/javascript'
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
</script>
<script>
$(document).ready(function() {
console.log('#micro-selector-{{ thismicroid|micromacroid }}-{{ thismicroid|micromesoid }}');
$('#micro-selector-{{ thismicroid|micromacroid }}-{{ thismicroid|micromesoid }}').prop('checked',true);
$('#meso-selector-{{ thismicroid|micromacroid }}').prop('checked',true);
$('#macro-selector-{{ thismicroid|micromacroid }}').prop('checked',true);
$('#micro-{{ thismicroid }}-{{ thismicroid|micromesoid }}-{{ thismicroid|micromacroid }}').focus();
console.log('done')
});
</script>
{% elif thismesoid %}
<script type='text/javascript'
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
</script>
<script>
$(document).ready(function() {
$('#meso-selector-{{ thismesoid|mesomacroid }}').prop('checked',true);
$('#macro-selector-{{ thismesoid|mesomacroid }}').prop('checked',true);
$('#meso-{{ thismesoid }}-{{ thismesoid|mesomacroid }}').focus();
});
</script>
{% endif %}
{% if thismacroid %}
<script type='text/javascript'
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
</script>
<script>
$(document).ready(function() {
$('#macro-selector-{{ thismacroid }}').prop('checked',true);
$('#macro-{{ thismacroid }}').focus();
console.log('done')
});
</script>
{% endif %}
{% endblock %}
{% block sidebar %}
{% include 'menu_plan.html' %}
{% endblock %}