Merge branch 'release/v8.65'
This commit is contained in:
@@ -25,6 +25,15 @@ class LoginForm(forms.Form):
|
||||
username = forms.CharField()
|
||||
password = forms.CharField(widget=forms.PasswordInput())
|
||||
|
||||
# search form
|
||||
class SearchForm(forms.Form):
|
||||
q = forms.CharField(max_length=255,required=False,
|
||||
widget=forms.TextInput(
|
||||
attrs={'placeholder': 'Search'}),
|
||||
label='Search')
|
||||
|
||||
|
||||
|
||||
# simple form for Contact page. Sends email to info@rowsandall.com
|
||||
class EmailForm(forms.Form):
|
||||
firstname = forms.CharField(max_length=255)
|
||||
|
||||
@@ -150,7 +150,12 @@ def get_strava_workouts(rower):
|
||||
start_date = item['start_date']
|
||||
stravaid = item['id']
|
||||
if arrow.get(start_date) == arrow.get(w.startdatetime):
|
||||
if datetime.time(seconds=int(elapsed_time)) == w.duration:
|
||||
dd = datetime.min + timedelta(
|
||||
seconds=int(elapsed_time)
|
||||
)
|
||||
|
||||
|
||||
if datetime.time(dd) == w.duration:
|
||||
w.uploadedtostrava = int(stravaid)
|
||||
w.save()
|
||||
|
||||
|
||||
@@ -34,10 +34,8 @@
|
||||
<p>
|
||||
<form id="searchform" action=""
|
||||
method="get" accept-charset="utf-8">
|
||||
<button class="button blue small" type="submit">
|
||||
Search
|
||||
</button>
|
||||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||
{{ searchform }}
|
||||
<input type="submit" value="GO"></input>
|
||||
</form>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -32,10 +32,8 @@
|
||||
<p>
|
||||
<form id="searchform" action=""
|
||||
method="get" accept-charset="utf-8">
|
||||
<button class="button blue small" type="submit">
|
||||
Search
|
||||
</button>
|
||||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||
{{ searchform }}
|
||||
<input type="submit" value="GO"></input>
|
||||
</form>
|
||||
</p>
|
||||
<p>
|
||||
@@ -49,7 +47,7 @@
|
||||
</table>
|
||||
{% csrf_token %}
|
||||
</p>
|
||||
<input name='daterange' class="button green" type="submit" value="Submit"> </form>
|
||||
<input name='daterange' type="submit" value="Submit"> </form>
|
||||
</li>
|
||||
<li class="grid_3">
|
||||
<h1>Fuse this workout with data from:</h1>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</p>
|
||||
{% endif %}
|
||||
<p>
|
||||
<table>
|
||||
<table class="djangoform">
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
</p>
|
||||
@@ -64,6 +64,41 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script type='text/javascript'
|
||||
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
|
||||
</script>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
|
||||
$('#id_registration_form').change(function(){
|
||||
|
||||
var value = $(this).val();
|
||||
|
||||
if (value == 'windowstart') {
|
||||
|
||||
$('#id_registration_closure_0').val($('#id_startdate').val());
|
||||
|
||||
$('#id_registration_closure_1').val($('#id_start_time').val());
|
||||
|
||||
} else if (value == 'windowend') {
|
||||
|
||||
$('#id_registration_closure_0').val($('#id_enddate').val());
|
||||
|
||||
$('#id_registration_closure_1').val($('#id_end_time').val());
|
||||
|
||||
} else if (value == 'deadline') {
|
||||
|
||||
$('#id_registration_closure_0').val($('#id_evaluation_closure_0').val());
|
||||
|
||||
$('#id_registration_closure_1').val($('#id_evaluation_closure_1').val());
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
|
||||
@@ -60,14 +60,12 @@
|
||||
<p>
|
||||
<form id="searchform" action="/rowers/list-courses/"
|
||||
method="get" accept-charset="utf-8">
|
||||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||
<button class="button blue small" type="submit">
|
||||
Search
|
||||
</button>
|
||||
{{ searchform }}
|
||||
<input type="submit" value="GO"></input>
|
||||
</form>
|
||||
</p>
|
||||
<p>
|
||||
<a class="button small green" href="/rowers/courses/upload">Add Courses</a>
|
||||
<a href="/rowers/courses/upload">Add Courses</a>
|
||||
</p>
|
||||
{% if announcements %}
|
||||
<h3>What's New?</h3>
|
||||
|
||||
@@ -16,10 +16,8 @@
|
||||
<li class="grid_2">
|
||||
<form id="searchform" action="."
|
||||
method="get" accept-charset="utf-8">
|
||||
<button class="button blue small" type="submit">
|
||||
Search
|
||||
</button>
|
||||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||
{{ searchform }}
|
||||
<input type="submit" value="GO"></input>
|
||||
</form>
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
|
||||
@@ -85,9 +85,9 @@
|
||||
{% else %}
|
||||
<form id="searchform" action="/rowers/list-workouts/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}"
|
||||
method="get" accept-charset="utf-8">
|
||||
{% endif %}
|
||||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||
<input type="submit">
|
||||
{% endif %}
|
||||
{{ searchform }}
|
||||
<input type="submit" value="GO">
|
||||
</input>
|
||||
</form>
|
||||
</p>
|
||||
|
||||
@@ -103,10 +103,8 @@
|
||||
<form id="searchform"
|
||||
action=""
|
||||
method="get" accept-charset="utf-8">
|
||||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||
<button class="button blue small" type="submit">
|
||||
Search
|
||||
</button>
|
||||
{{ searchform }}
|
||||
<input type="submit" value="GO"></input>
|
||||
</form>
|
||||
</li>
|
||||
<li class="grid_2 maxheight">
|
||||
@@ -133,7 +131,7 @@
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
<input name="chartform" class="button green" type="submit" value="Compare">
|
||||
<input name="chartform" type="submit" value="Compare">
|
||||
</p>
|
||||
</form>
|
||||
</li>
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
{{ chartform.as_table }}
|
||||
</table>
|
||||
<p>
|
||||
<input name='workoutselectform' class="button green" type="submit" value="Submit">
|
||||
<input name='workoutselectform' type="submit" value="Submit">
|
||||
</p>
|
||||
</form>
|
||||
</li>
|
||||
@@ -118,16 +118,14 @@
|
||||
{{ optionsform.as_table }}
|
||||
</table>
|
||||
{% csrf_token %}
|
||||
<input name='optionsform' class="button green" type="submit" value="Submit">
|
||||
<input name='optionsform' type="submit" value="Submit">
|
||||
</form>
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
<form id="searchform" action=""
|
||||
method="get" accept-charset="utf-8">
|
||||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||
<button class="button blue small" type="submit">
|
||||
Search
|
||||
</button>
|
||||
{{ searchform }}
|
||||
<input type="submit" value="GO"></input>
|
||||
</form>
|
||||
</li>
|
||||
|
||||
|
||||
@@ -92,16 +92,14 @@
|
||||
{{ modalityform.as_table }}
|
||||
</table>
|
||||
{% csrf_token %}
|
||||
<input name='modalityform' class="button green" type="submit" value="Filter">
|
||||
<input name='modalityform' type="submit" value="Filter">
|
||||
</form>
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
<form id="searchform" action=""
|
||||
method="get" accept-charset="utf-8">
|
||||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||
<button class="button blue small" type="submit">
|
||||
Search
|
||||
</button>
|
||||
{{ searchform }}
|
||||
<input type="submit" value="GO"></input>
|
||||
</form>
|
||||
</li>
|
||||
<li class="grid_2 maxheight">
|
||||
@@ -122,7 +120,7 @@
|
||||
{{ chartform.as_table }}
|
||||
</table>
|
||||
<p>
|
||||
<input name='workoutselectform' class="button green" type="submit" value="Create Chart">
|
||||
<input name='workoutselectform' type="submit" value="Create Chart">
|
||||
</p>
|
||||
</form>
|
||||
</li>
|
||||
|
||||
@@ -56,6 +56,41 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script type='text/javascript'
|
||||
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
|
||||
</script>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
|
||||
$('#id_registration_form').change(function(){
|
||||
|
||||
var value = $(this).val();
|
||||
|
||||
if (value == 'windowstart') {
|
||||
|
||||
$('#id_registration_closure_0').val($('#id_startdate').val());
|
||||
|
||||
$('#id_registration_closure_1').val($('#id_start_time').val());
|
||||
|
||||
} else if (value == 'windowend') {
|
||||
|
||||
$('#id_registration_closure_0').val($('#id_enddate').val());
|
||||
|
||||
$('#id_registration_closure_1').val($('#id_end_time').val());
|
||||
|
||||
} else if (value == 'deadline') {
|
||||
|
||||
$('#id_registration_closure_0').val($('#id_evaluation_closure_0').val());
|
||||
|
||||
$('#id_registration_closure_1').val($('#id_evaluation_closure_1').val());
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
</table>
|
||||
<p>
|
||||
{% csrf_token %}
|
||||
<input name='workoutselectform' class="button green" type="submit" value="Submit">
|
||||
<input name='workoutselectform' type="submit" value="Submit">
|
||||
</p>
|
||||
</form>
|
||||
</li>
|
||||
@@ -106,7 +106,7 @@
|
||||
</table>
|
||||
<p>
|
||||
{% csrf_token %}
|
||||
<input name='daterange' class="button green" type="submit" value="Submit">
|
||||
<input name='daterange' type="submit" value="Submit">
|
||||
</p>
|
||||
</form>
|
||||
</li>
|
||||
@@ -121,7 +121,7 @@
|
||||
</table>
|
||||
<p>
|
||||
{% csrf_token %}
|
||||
<input name='modalityform' class="button green" type="submit" value="Submit">
|
||||
<input name='modalityform' type="submit" value="Submit">
|
||||
</p>
|
||||
</form>
|
||||
</li>
|
||||
@@ -133,10 +133,8 @@
|
||||
<form id="searchform" action="/rowers/workouts-join-select/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}"
|
||||
method="get" accept-charset="utf-8">
|
||||
{% endif %}
|
||||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||
<button class="button blue small" type="submit">
|
||||
Search
|
||||
</button>
|
||||
{{ searchform }}
|
||||
<input type="submit" value="GO"></input>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<tbody>
|
||||
{% for key, value in stats.items %}
|
||||
<tr>
|
||||
{% if value.std > 2 %}
|
||||
{% if value.std > 10 %}
|
||||
<td>{{ value.verbosename }}</td>
|
||||
<td>{{ value.mean|floatformat:0 }}</td>
|
||||
<td> {{ value.wmean|floatformat:0 }}</td>
|
||||
|
||||
+6
-1
@@ -377,7 +377,12 @@ def totaltime_sec_to_string(totaltime):
|
||||
if not message:
|
||||
message = 'Warning: there is something wrong with the workout duration'
|
||||
|
||||
duration = "%s:%s:%s.%s" % (hours, minutes, seconds, tenths)
|
||||
duration = "{hours:02d}:{minutes:02d}:{seconds:02d}.{tenths}".format(
|
||||
hours=hours,
|
||||
minutes=minutes,
|
||||
seconds=seconds,
|
||||
tenths=tenths
|
||||
)
|
||||
|
||||
return duration
|
||||
|
||||
|
||||
+47
-5
@@ -50,7 +50,7 @@ from rowers.forms import (
|
||||
RaceResultFilterForm,PowerIntervalUpdateForm,FlexAxesForm,
|
||||
FlexOptionsForm,DataFrameColumnsForm,OteWorkoutTypeForm,
|
||||
MetricsForm,DisqualificationForm,disqualificationreasons,
|
||||
disqualifiers
|
||||
disqualifiers,SearchForm,
|
||||
)
|
||||
from django.core.urlresolvers import reverse, reverse_lazy
|
||||
|
||||
@@ -5336,6 +5336,9 @@ def workouts_join_select(request,
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
form = WorkoutMultipleCompareForm()
|
||||
form.fields["workouts"].queryset = workouts
|
||||
@@ -5358,6 +5361,7 @@ def workouts_join_select(request,
|
||||
return render(request, 'workout_join_select.html',
|
||||
{'workouts': workouts,
|
||||
'dateform':dateform,
|
||||
'searchform':searchform,
|
||||
'startdate':startdate,
|
||||
'enddate':enddate,
|
||||
'active':'nav-workouts',
|
||||
@@ -5510,6 +5514,9 @@ def team_comparison_select(request,
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
if id:
|
||||
firstworkout = get_workout(id)
|
||||
@@ -5573,6 +5580,7 @@ def team_comparison_select(request,
|
||||
'startdate':startdate,
|
||||
'enddate':enddate,
|
||||
'team':theteam,
|
||||
'searchform':searchform,
|
||||
'form':form,
|
||||
'rower':r,
|
||||
'breadcrumbs':breadcrumbs,
|
||||
@@ -5921,6 +5929,9 @@ def user_multiflex_select(request,
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
form = WorkoutMultipleCompareForm()
|
||||
form.fields["workouts"].queryset = workouts
|
||||
@@ -5975,6 +5986,7 @@ def user_multiflex_select(request,
|
||||
'rower':r,
|
||||
'form':form,
|
||||
'chartform':chartform,
|
||||
'searchform':searchform,
|
||||
'modalityform':modalityform,
|
||||
'teams':get_my_teams(request.user),
|
||||
})
|
||||
@@ -6551,6 +6563,9 @@ def user_boxplot_select(request,
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
form = WorkoutMultipleCompareForm()
|
||||
form.fields["workouts"].queryset = workouts
|
||||
@@ -6592,6 +6607,7 @@ def user_boxplot_select(request,
|
||||
'form':form,
|
||||
'active':'nav-analysis',
|
||||
'chartform':chartform,
|
||||
'searchform':searchform,
|
||||
'optionsform':optionsform,
|
||||
'teams':get_my_teams(request.user),
|
||||
})
|
||||
@@ -6834,10 +6850,14 @@ def courses_view(request):
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
return render(request,'list_courses.html',
|
||||
{'courses':courses,
|
||||
'active':'nav-racing',
|
||||
'searchform':searchform,
|
||||
'rower':r,
|
||||
})
|
||||
|
||||
@@ -6994,6 +7014,9 @@ def workouts_view(request,message='',successmessage='',
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
paginator = Paginator(workouts,20) # show 25 workouts per page
|
||||
page = request.GET.get('page')
|
||||
@@ -7038,6 +7061,7 @@ def workouts_view(request,message='',successmessage='',
|
||||
{'workouts': workouts,
|
||||
'active': 'nav-workouts',
|
||||
'rower':r,
|
||||
'searchform':searchform,
|
||||
'breadcrumbs':breadcrumbs,
|
||||
'dateform':dateform,
|
||||
'startdate':startdate,
|
||||
@@ -7104,6 +7128,9 @@ def workout_comparison_list(request,id=0,message='',successmessage='',
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
paginator = Paginator(workouts,15) # show 25 workouts per page
|
||||
page = request.GET.get('page')
|
||||
@@ -7126,6 +7153,7 @@ def workout_comparison_list(request,id=0,message='',successmessage='',
|
||||
'workouts': workouts,
|
||||
'last_name':u.last_name,
|
||||
'first_name':u.first_name,
|
||||
'searchform':searchform,
|
||||
'dateform':dateform,
|
||||
'startdate':startdate,
|
||||
'enddate':enddate,
|
||||
@@ -7185,7 +7213,10 @@ def workout_fusion_list(request,id=0,message='',successmessage='',
|
||||
(Q(name__icontains=q) for q in query_list)) |
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
paginator = Paginator(workouts,15) # show 25 workouts per page
|
||||
page = request.GET.get('page')
|
||||
@@ -7221,6 +7252,7 @@ def workout_fusion_list(request,id=0,message='',successmessage='',
|
||||
{'id':int(id),
|
||||
'workout':row,
|
||||
'rower':r,
|
||||
'searchform':searchform,
|
||||
'active':'nav-workouts',
|
||||
'breadcrumbs':breadcrumbs,
|
||||
'workouts': workouts,
|
||||
@@ -8496,10 +8528,16 @@ def workout_data_view(request, id=0):
|
||||
|
||||
datadf.sort_values(['ftime'],inplace=True)
|
||||
|
||||
datadf.drop(labels=[
|
||||
columns = datadf.columns.values
|
||||
|
||||
to_be_dropped = [
|
||||
'id','time','hr_an','hr_at','hr_bottom','hr_max',
|
||||
'hr_tr','hr_ut1','hr_ut2','x_right',
|
||||
],inplace=True,axis=1)
|
||||
]
|
||||
|
||||
to_be_dropped = [c for c in to_be_dropped if c in columns]
|
||||
|
||||
datadf.drop(labels=to_be_dropped,inplace=True,axis=1)
|
||||
|
||||
|
||||
cols = ['ftime','cumdist','fpace','spm',
|
||||
@@ -12057,6 +12095,9 @@ def graphs_view(request):
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
g = GraphImage.objects.filter(workout__in=workouts).order_by("-creationdatetime")
|
||||
|
||||
@@ -12073,6 +12114,7 @@ def graphs_view(request):
|
||||
|
||||
return render(request, 'list_graphs.html',
|
||||
{'graphs': g,
|
||||
'searchform':searchform,
|
||||
'active':'nav-workouts',
|
||||
'teams':get_my_teams(request.user),
|
||||
})
|
||||
|
||||
@@ -1086,3 +1086,7 @@ a.wh:hover {
|
||||
background: silver;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
table.djangoform tbody > tr > th {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user