crewnerd summary
This commit is contained in:
@@ -1,25 +1,25 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "newbase.html" %}
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
|
|
||||||
{% block title %}CrewNerd Summary loading{% endblock %}
|
{% block title %}CrewNerd Summary loading{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block main %}
|
||||||
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
||||||
<div id="left" class="grid_6 alpha">
|
<h1>Upload Workout Summary File (CrewNerd)</h1>
|
||||||
<h1>Upload Workout Summary File (CrewNerd)</h1>
|
{% if form.errors %}
|
||||||
{% if form.errors %}
|
<p style="color: red;">
|
||||||
<p style="color: red;">
|
Please correct the error{{ form.errors|pluralize }} below.
|
||||||
Please correct the error{{ form.errors|pluralize }} below.
|
</p>
|
||||||
</p>
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
|
<table>
|
||||||
<table>
|
{{ form.as_table }}
|
||||||
{{ form.as_table }}
|
</table>
|
||||||
</table>
|
{% csrf_token %}
|
||||||
{% csrf_token %}
|
<input type="submit" value="Submit">
|
||||||
<div id="formbutton" class="grid_1 prefix_4 suffix_1">
|
|
||||||
<input type="submit" value="Submit">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block sidebar %}
|
||||||
|
{% include 'menu_workout.html' %}
|
||||||
|
{% endblock %}
|
||||||
|
|||||||
@@ -52,7 +52,10 @@ def secondstotimestring(tdelta):
|
|||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def water(workout):
|
def water(workout):
|
||||||
return workout.workouttype in otwtypes
|
try:
|
||||||
|
return workout.workouttype in otwtypes
|
||||||
|
except AttributeError:
|
||||||
|
return False
|
||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def ddays(ddelta):
|
def ddays(ddelta):
|
||||||
|
|||||||
@@ -6763,6 +6763,22 @@ def workout_smoothenpace_view(request,id=0,message="",successmessage=""):
|
|||||||
@user_passes_test(ispromember,login_url="/",redirect_field_name=None)
|
@user_passes_test(ispromember,login_url="/",redirect_field_name=None)
|
||||||
def workout_crewnerd_summary_view(request,id=0,message="",successmessage=""):
|
def workout_crewnerd_summary_view(request,id=0,message="",successmessage=""):
|
||||||
row = get_workout(id)
|
row = get_workout(id)
|
||||||
|
r = getrower(request.user)
|
||||||
|
breadcrumbs = [
|
||||||
|
{
|
||||||
|
'url':'/rowers/list-workouts',
|
||||||
|
'name':'Workouts'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url':get_workout_default_page(request,id),
|
||||||
|
'name': str(row.id)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url':reverse(workout_crewnerd_summary_view,kwargs={'id':id}),
|
||||||
|
'name': 'CrewNerd Summary'
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
form = CNsummaryForm(request.POST,request.FILES)
|
form = CNsummaryForm(request.POST,request.FILES)
|
||||||
@@ -6799,6 +6815,10 @@ def workout_crewnerd_summary_view(request,id=0,message="",successmessage=""):
|
|||||||
return render(request,
|
return render(request,
|
||||||
"cn_form.html",
|
"cn_form.html",
|
||||||
{'form':form,
|
{'form':form,
|
||||||
|
'active':'nav-workouts',
|
||||||
|
'rower':r,
|
||||||
|
'workout':row,
|
||||||
|
'breadcrumbs':breadcrumbs,
|
||||||
'teams':get_my_teams(request.user),
|
'teams':get_my_teams(request.user),
|
||||||
'id':row.id})
|
'id':row.id})
|
||||||
else:
|
else:
|
||||||
@@ -6807,6 +6827,10 @@ def workout_crewnerd_summary_view(request,id=0,message="",successmessage=""):
|
|||||||
return render(request,
|
return render(request,
|
||||||
"cn_form.html",
|
"cn_form.html",
|
||||||
{'form':form,
|
{'form':form,
|
||||||
|
'active':'nav-workouts',
|
||||||
|
'rower':r,
|
||||||
|
'workout':row,
|
||||||
|
'breadcrumbs':breadcrumbs,
|
||||||
'teams':get_my_teams(request.user),
|
'teams':get_my_teams(request.user),
|
||||||
'id':row.id})
|
'id':row.id})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user