Private
Public Access
1
0

cosmetic changes in training plan presentation

This commit is contained in:
Sander Roosendaal
2021-03-23 10:20:26 +01:00
parent 2abc533ada
commit da5611005a
3 changed files with 17 additions and 7 deletions

View File

@@ -17,11 +17,16 @@
</p>
{% endif %}
<p>Plan length: {{ plan.duration }} days</p>
{% if plan.description %}
<p>{{ plan.description }}</p>
<p>{{ plan.target }}</p>
{% endif %}
{% if plan.goal %}
<p>Goal: {{ plan.goal }}</p>
<p>{{ plan.hoursperweek }} hours per week</p>
<p>{{ plan.sessionsperweek }} sessions per week</p>
{% endif %}
{% if plan.target %}
<p>What the plan will achieve: {{ plan.target }}</p>
{% endif %}
<p>Weekly volume: {{ plan.hoursperweek }} hours per week over {{ plan.sessionsperweek }} sessions.</p>
</li>
<li class="grid_2">
<p>

View File

@@ -15,10 +15,13 @@
<p>Created by: {{ plan.owner.first_name }} {{ plan.owner.last_name }}</p>
<p>Plan length: {{ plan.duration }} days</p>
<p>{{ plan.description }}</p>
<p>{{ plan.target }}</p>
{% if plan.target %}
<p>What the plan will achieve: {{ plan.target }}</p>
{% endif %}
{% if plan.goal %}
<p>Goal: {{ plan.goal }}</p>
<p>{{ plan.hoursperweek }} hours per week</p>
<p>{{ plan.sessionsperweek }} sessoins per week</p>
{% endif %}
<p>{{ plan.hoursperweek }} hours per week over {{ plan.sessionsperweek }} sessions</p>
</li>
{% endfor %}

View File

@@ -25,6 +25,7 @@ import requests
from django.http import HttpResponse
import humanize
lbstoN = 4.44822
@@ -793,8 +794,9 @@ def step_to_string(step,short=False):
unit = 'min'
value = step['durationValue']
if value/1000. >= 3600:
unit = 'hour'
unit = 'h'
dd = timedelta(seconds=value/1000.)
#duration = humanize.naturaldelta(dd, minimum_unit="seconds")
duration = '{v}'.format(v=str(dd))
elif durationtype == 'Distance':
unit = 'm'