Merge branch 'release/v8.72'
This commit is contained in:
@@ -880,8 +880,8 @@ class WorkoutSessionSelectForm(forms.Form):
|
||||
|
||||
|
||||
class RaceResultFilterForm(forms.Form):
|
||||
boatclasses = (type for type in mytypes.workouttypes if type[0] in mytypes.otwtypes)
|
||||
boatclassinitial = [t for t in mytypes.otwtypes]
|
||||
boatclasses = (type for type in mytypes.workouttypes if type[0] in mytypes.rowtypes)
|
||||
boatclassinitial = [t for t in mytypes.rowtypes]
|
||||
sexchoices = (
|
||||
('female','Female'),
|
||||
('male','Male'),
|
||||
@@ -904,7 +904,7 @@ class RaceResultFilterForm(forms.Form):
|
||||
boatclass = forms.MultipleChoiceField(
|
||||
choices=boatclasses,
|
||||
initial=boatclassinitial,
|
||||
label='Boat Class',
|
||||
label='Boat/Erg Class',
|
||||
widget=forms.CheckboxSelectMultiple())
|
||||
|
||||
boattype = forms.MultipleChoiceField(
|
||||
|
||||
@@ -16,6 +16,12 @@
|
||||
</a>
|
||||
</li>
|
||||
{% if race %}
|
||||
{% if results %}
|
||||
<li id="compare">
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/compare">
|
||||
<i class="fas fa-balance-scale fa-fw"></i> Compare Results</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if reguest.user.is_anonymous %}
|
||||
<li id="race-register">
|
||||
{% if race.sessiontype == 'race' %}
|
||||
|
||||
@@ -41,5 +41,9 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% if active == 'nav-racing' %}
|
||||
{% include 'menu_racing.html' %}
|
||||
{% else %}
|
||||
{% include 'menu_workouts.html' %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
<h1>Detailed Summary Edit</h1>
|
||||
<p>This is still experimental and there are known bugs. Use at your own risk. Nothing is stored permanently until you hit Save on the summary above. You can use the restore original button to restore the original values.</p>
|
||||
<p>This is still experimental and there are known bugs. Use at your own risk. Nothing is stored permanently until you hit Save in the Updated Summary section. You can use the restore original button to restore the original values.</p>
|
||||
<form enctype="multipart/form-data" action="/rowers/workout/{{ workout.id }}/editintervals" method="post">
|
||||
<table width=100%>
|
||||
<thead>
|
||||
|
||||
@@ -233,8 +233,8 @@
|
||||
<h2>Results</h2>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if results or dns %}
|
||||
<p>
|
||||
{% if results or dns %}
|
||||
<table class="listtable shortpadded" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -245,8 +245,8 @@
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<th>Class</th>
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<th>Boat</th>
|
||||
{% endif %}
|
||||
<th>Time</th>
|
||||
@@ -266,9 +266,15 @@
|
||||
<td>{{ result.age }}</td>
|
||||
<td>{{ result.sex }}</td>
|
||||
<td>{{ result.weightcategory }}</td>
|
||||
<td>{{ result.adaptiveclass }}</td>
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<td>
|
||||
{% if result.adaptiveclass == 'None' %}
|
||||
|
||||
{% else %}
|
||||
{{ result.adaptiveclass }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ result.boatclass }}</td>
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<td>{{ result.boattype }}</td>
|
||||
{% endif %}
|
||||
<td>{{ result.duration |durationprint:"%H:%M:%S.%f" }}</td>
|
||||
@@ -295,9 +301,15 @@
|
||||
<td>{{ result.age }}</td>
|
||||
<td>{{ result.sex }}</td>
|
||||
<td>{{ result.weightcategory }}</td>
|
||||
<td>{{ result.adaptiveclass }}</td>
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<td>
|
||||
{% if result.adaptiveclass == 'None' %}
|
||||
|
||||
{% else %}
|
||||
{{ result.adaptiveclass }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ result.boatclass }}</td>
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<td>{{ result.boattype }}</td>
|
||||
{% endif %}
|
||||
<td>DNS</td>
|
||||
@@ -305,10 +317,16 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
No results yet
|
||||
{% endif %}
|
||||
</p>
|
||||
<p>
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/compare"
|
||||
title="Compare the workouts of all competitors">Compare Results</a>
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
No results yet
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
{% if form %}
|
||||
@@ -354,16 +372,20 @@
|
||||
<tr>
|
||||
<td>{{ record.username }}
|
||||
<td>{{ record.teamname }}</td>
|
||||
<td>{{ record.boatclass }}</td>
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<td>{{ record.boatclass }}</td>
|
||||
<td>{{ record.boattype }}</td>
|
||||
{% else %}
|
||||
<td>{{ record.boatclass }}</td>
|
||||
{% endif %}
|
||||
<td>{{ record.age }}</td>
|
||||
<td>{{ record.sex }}</td>
|
||||
<td>{{ record.weightcategory }}</td>
|
||||
<td>{{ record.adaptiveclass }}</td>
|
||||
<td>
|
||||
{% if record.adaptiveclass == 'None' %}
|
||||
|
||||
{% else %}
|
||||
{{ record.adaptiveclass }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if record.userid == rower.id and 'withdrawbutton' in buttons %}
|
||||
<td>
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/withdraw/{{ record.id }}" >Withdraw</a>
|
||||
|
||||
@@ -119,7 +119,7 @@ $('#id_workouttype').change();
|
||||
</p>
|
||||
</li>
|
||||
{% if indoorraces %}
|
||||
<li>
|
||||
<li class="grid_4">
|
||||
<h1>Racing</h1>
|
||||
{% for race in indoorraces %}
|
||||
<p>
|
||||
|
||||
@@ -278,6 +278,7 @@ urlpatterns = [
|
||||
url(r'^workout/(?P<id>\d+)/interactiveotwplot$',views.workout_otwpowerplot_view),
|
||||
url(r'^workout/(?P<id>\d+)/wind$',views.workout_wind_view),
|
||||
url(r'^workout/(?P<id>\d+)/image$',views.workout_uploadimage_view),
|
||||
url(r'^virtualevent/(?P<id>\d+)/compare$',views.virtualevent_compare_view),
|
||||
url(r'^virtualevent/(?P<id>\d+)/image$',
|
||||
views.virtualevent_uploadimage_view),
|
||||
url(r'^virtualevent/(?P<id>\d+)/setimage/(?P<logoid>\d+)/$',
|
||||
|
||||
146
rowers/views.py
146
rowers/views.py
@@ -5598,6 +5598,139 @@ def team_comparison_select(request,
|
||||
'teams':get_my_teams(request.user),
|
||||
})
|
||||
|
||||
def virtualevent_compare_view(request,id=0):
|
||||
results = []
|
||||
|
||||
promember = 0
|
||||
if not request.user.is_anonymous():
|
||||
r = getrower(request.user)
|
||||
result = request.user.is_authenticated() and ispromember(request.user)
|
||||
if result:
|
||||
promember=1
|
||||
else:
|
||||
r = None
|
||||
|
||||
try:
|
||||
race = VirtualRace.objects.get(id=id)
|
||||
except VirtualRace.DoesNotExist:
|
||||
raise Http404("Virtual Race does not exist")
|
||||
|
||||
if race.sessiontype == 'race':
|
||||
script,div = course_map(race.course)
|
||||
resultobj = VirtualRaceResult
|
||||
else:
|
||||
script = ''
|
||||
div = ''
|
||||
resultobj = IndoorVirtualRaceResult
|
||||
|
||||
results = resultobj.objects.filter(
|
||||
race=race,
|
||||
workoutid__isnull=False,
|
||||
coursecompleted=True,
|
||||
).order_by("duration","-distance")
|
||||
|
||||
workoutids = [result.workoutid for result in results]
|
||||
|
||||
if request.method == 'GET':
|
||||
xparam = race.sessionmode if race.sessionmode in ['distance','time'] else 'time'
|
||||
yparam = 'pace'
|
||||
plottype = 'line'
|
||||
|
||||
|
||||
|
||||
request.session['ids'] = workoutids
|
||||
request.session['plottype'] = plottype
|
||||
request.session['xparam'] = xparam
|
||||
request.session['yparam'] = yparam
|
||||
|
||||
|
||||
workouts = []
|
||||
for id in workoutids:
|
||||
try:
|
||||
workouts.append(Workout.objects.get(id=id))
|
||||
except Workout.DoesNotExist:
|
||||
pass
|
||||
|
||||
labeldict = {
|
||||
int(w.id): w.__unicode__() for w in workouts
|
||||
}
|
||||
|
||||
chartform = ChartParamChoiceForm(
|
||||
initial = {
|
||||
'xparam':xparam,
|
||||
'yparam':yparam,
|
||||
'plottype':plottype,
|
||||
'teamid':0
|
||||
}
|
||||
)
|
||||
elif request.method == 'POST':
|
||||
chartform = ChartParamChoiceForm(request.POST)
|
||||
if chartform.is_valid():
|
||||
xparam = chartform.cleaned_data['xparam']
|
||||
yparam = chartform.cleaned_data['yparam']
|
||||
plottype = chartform.cleaned_data['plottype']
|
||||
teamid = chartform.cleaned_data['teamid']
|
||||
workoutids = request.session['ids']
|
||||
request.session['ids'] = workoutids
|
||||
workouts = []
|
||||
for id in workoutids:
|
||||
try:
|
||||
workouts.append(Workout.objects.get(id=id))
|
||||
except Workout.DoesNotExist:
|
||||
pass
|
||||
|
||||
labeldict = {
|
||||
int(w.id): w.__unicode__() for w in workouts
|
||||
}
|
||||
res = interactive_multiple_compare_chart(workoutids,xparam,yparam,
|
||||
promember=promember,
|
||||
plottype=plottype,
|
||||
labeldict=labeldict)
|
||||
script = res[0]
|
||||
div = res[1]
|
||||
errormessage = res[3]
|
||||
if errormessage != '':
|
||||
messages.error(request,errormessage)
|
||||
|
||||
breadcrumbs = [
|
||||
{
|
||||
'url': reverse(virtualevents_view),
|
||||
'name': 'Racing'
|
||||
},
|
||||
{
|
||||
'url':reverse(virtualevent_view,
|
||||
kwargs={
|
||||
'id':race.id,
|
||||
}
|
||||
),
|
||||
'name': race.name
|
||||
},
|
||||
{
|
||||
'url':reverse(virtualevent_compare_view,
|
||||
kwargs={
|
||||
'id':race.id,
|
||||
}
|
||||
),
|
||||
'name': 'Compare'
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
return render(request,'multicompare.html',
|
||||
{'interactiveplot':script,
|
||||
'the_div':div,
|
||||
'breadcrumbs':breadcrumbs,
|
||||
'rower':r,
|
||||
'race':race,
|
||||
'results':results,
|
||||
'active':'nav-racing',
|
||||
'promember':promember,
|
||||
'teamid':0,
|
||||
'chartform':chartform,
|
||||
'teams':[]
|
||||
})
|
||||
|
||||
|
||||
@login_required()
|
||||
def plannedsession_compare_view(request,id=0,userid=0):
|
||||
r = getrequestrower(request,userid=userid)
|
||||
@@ -17595,14 +17728,6 @@ def virtualevent_submit_result_view(request,id=0,workoutid=0):
|
||||
selectedworkout = w_form.cleaned_data['workouts']
|
||||
splitsecond = 0
|
||||
recordid = w_form.cleaned_data['record']
|
||||
# splittime = w_form.cleaned_data['evaluate_after']
|
||||
# if splittime is not None:
|
||||
# splitsecond = splittime.hour*3600
|
||||
# splitsecond += splittime.minute*60
|
||||
# splitsecond += splittime.second
|
||||
# splitsecond += splittime.microsecond/1.e6
|
||||
# else:
|
||||
# splitsecond = 0
|
||||
else:
|
||||
selectedworkout = None
|
||||
|
||||
@@ -17621,11 +17746,6 @@ def virtualevent_submit_result_view(request,id=0,workoutid=0):
|
||||
workouts,race,r,recordid=recordid)
|
||||
|
||||
|
||||
# if result:
|
||||
# for w in ws:
|
||||
# remove_workout_plannedsession(w,race)
|
||||
# delete_race_result(w,race)
|
||||
|
||||
for c in comments:
|
||||
messages.info(request,c)
|
||||
for er in errors:
|
||||
|
||||
Reference in New Issue
Block a user