cosmetical fixes
This commit is contained in:
@@ -51,7 +51,8 @@
|
||||
</div>
|
||||
<div class="workoutelement">
|
||||
<span style="color:#555">Workout</span><br>
|
||||
{{ analysis.workout }}
|
||||
<span>{{ analysis.workout.name }}</span><br>
|
||||
<span>{{ analysis.workout.date }}, {{ analysis.workout.distance }}m</span>
|
||||
</div>
|
||||
<div class="workoutelement">
|
||||
<span style="color:#555">Metric</span><br>
|
||||
@@ -69,6 +70,11 @@
|
||||
<span style="color:#555">Time</span><br>
|
||||
{{ analysis.start_second|secondstotimestring }} - {{ analysis.end_second|secondstotimestring }}
|
||||
</div>
|
||||
<div class="workoutelement">
|
||||
<span style="color:#555">Avg Pace</span><br>
|
||||
{{ analysis.average_boatspeed|velotopace }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
@@ -10,7 +10,7 @@ import math
|
||||
import datetime
|
||||
import re
|
||||
|
||||
from rowers.utils import calculate_age
|
||||
from rowers.utils import calculate_age, to_pace
|
||||
from rowers.models import (
|
||||
course_length, WorkoutComment,
|
||||
TrainingMacroCycle, TrainingMesoCycle, TrainingMicroCycle,
|
||||
@@ -491,6 +491,14 @@ def previousperiodstart(timeperiod):
|
||||
|
||||
return newstartdate.strftime("%Y-%m-%d")
|
||||
|
||||
@register.filter
|
||||
def velotopace(v):
|
||||
if v > 0:
|
||||
time500 = 500./v
|
||||
return to_pace(time500)
|
||||
|
||||
return ""
|
||||
|
||||
|
||||
@register.filter
|
||||
def paceprint(d):
|
||||
|
||||
@@ -3039,7 +3039,7 @@ def instroke_chart_interactive(request, id=0, analysis=0, userid=0):
|
||||
div = get_call()
|
||||
|
||||
|
||||
|
||||
dosave = False
|
||||
if request.method == 'POST':
|
||||
form = InstrokeForm(request.POST,choices=instrokemetrics)
|
||||
if form.is_valid():
|
||||
@@ -3079,6 +3079,7 @@ def instroke_chart_interactive(request, id=0, analysis=0, userid=0):
|
||||
instroke_analysis.rower=w.user
|
||||
|
||||
instroke_analysis.save()
|
||||
dosave = True
|
||||
messages.info(request,'In-Stroke Analysis saved')
|
||||
|
||||
|
||||
@@ -3097,6 +3098,7 @@ def instroke_chart_interactive(request, id=0, analysis=0, userid=0):
|
||||
)
|
||||
|
||||
instroke_analysis.save()
|
||||
dosave = True
|
||||
messages.info(request,'In-Stroke Analysis saved')
|
||||
|
||||
|
||||
@@ -3141,6 +3143,9 @@ def instroke_chart_interactive(request, id=0, analysis=0, userid=0):
|
||||
|
||||
if totaltime > 0:
|
||||
avg_speed = totaldist/totaltime
|
||||
if dosave:
|
||||
instroke_analysis.average_boatspeed = avg_speed
|
||||
instroke_analysis.save()
|
||||
|
||||
intervaldata = {
|
||||
'itime': itime,
|
||||
|
||||
@@ -402,7 +402,7 @@ th.rotate > div > span {
|
||||
|
||||
.analysiscontainer {
|
||||
display: grid;
|
||||
grid-template-columns: 50px repeat(auto-fit, minmax(calc((100% - 100px)/7), 1fr));
|
||||
grid-template-columns: 50px repeat(auto-fit, minmax(calc((100% - 100px)/8), 1fr));
|
||||
/* grid-template-columns: 50px repeat(auto-fit, minmax(100px, 1fr)) 50px; ????*/
|
||||
padding: 5px;
|
||||
margin: 0px;
|
||||
|
||||
Reference in New Issue
Block a user