Merge branch 'release/v10.30'
This commit is contained in:
+1
-2
@@ -67,7 +67,6 @@ Faker==1.0.4
|
|||||||
fitparse==1.1.0
|
fitparse==1.1.0
|
||||||
Flask==1.0.2
|
Flask==1.0.2
|
||||||
future==0.17.1
|
future==0.17.1
|
||||||
GDAL==2.3.3
|
|
||||||
geocoder==1.38.1
|
geocoder==1.38.1
|
||||||
geos==0.2.1
|
geos==0.2.1
|
||||||
holoviews==1.11.3
|
holoviews==1.11.3
|
||||||
@@ -109,6 +108,7 @@ mistune==0.8.4
|
|||||||
mock==2.0.0
|
mock==2.0.0
|
||||||
more-itertools==6.0.0
|
more-itertools==6.0.0
|
||||||
mpld3==0.3
|
mpld3==0.3
|
||||||
|
mysqlclient==1.4.2.post1
|
||||||
nbconvert==5.4.1
|
nbconvert==5.4.1
|
||||||
nbformat==4.4.0
|
nbformat==4.4.0
|
||||||
nose==1.3.7
|
nose==1.3.7
|
||||||
@@ -192,7 +192,6 @@ wcwidth==0.1.7
|
|||||||
webencodings==0.5.1
|
webencodings==0.5.1
|
||||||
Werkzeug==0.15.1
|
Werkzeug==0.15.1
|
||||||
widgetsnbextension==3.4.2
|
widgetsnbextension==3.4.2
|
||||||
winkerberos==0.7.0
|
|
||||||
xlrd==1.2.0
|
xlrd==1.2.0
|
||||||
xmltodict==0.12.0
|
xmltodict==0.12.0
|
||||||
yamjam==0.1.7
|
yamjam==0.1.7
|
||||||
|
|||||||
@@ -53,9 +53,11 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block scripts %}
|
||||||
<!-- Include formset plugin - including jQuery dependency -->
|
<!-- Include formset plugin - including jQuery dependency -->
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||||
<script src="/static/js/jquery.formset.js"></script>
|
<script src="/static/js/jquery.formset.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$('.fav-formset').formset({
|
$('.fav-formset').formset({
|
||||||
@@ -64,9 +66,30 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$( document ).ready(function() {
|
||||||
|
$('#id_workouttype').on('change', function(){
|
||||||
|
if (
|
||||||
|
$(this).val() == 'water'
|
||||||
|
|| $(this).val() == 'coastal'
|
||||||
|
|| $(this).val() == 'c-boat'
|
||||||
|
|| $(this).val() == 'churchboat'
|
||||||
|
) {
|
||||||
|
$('#id_boattype').toggle(true);
|
||||||
|
} else {
|
||||||
|
$('#id_boattype').toggle(false);
|
||||||
|
$('#id_boattype').val('1x');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
$('#id_workouttype').change();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% block sidebar %}
|
{% block sidebar %}
|
||||||
{% include 'menu_analytics.html' %}
|
{% include 'menu_analytics.html' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
<ul class="main-content">
|
<ul class="main-content">
|
||||||
<li class="grid_2">
|
<li class="grid_2">
|
||||||
<h2>Alert {{ alert.name }} for {{ alert.rower.user.first_name }}</h2>
|
<h2>Alert {{ alert.name }} for {{ alert.rower.user.first_name }}</h2>
|
||||||
|
<p>Alert managed by {{ alert.manager.first_name }} {{ alert.manager.last_name }}</p>
|
||||||
<p>
|
<p>
|
||||||
{{ formset.management_form }}
|
{{ formset.management_form }}
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
@@ -51,9 +52,11 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block scripts %}
|
||||||
<!-- Include formset plugin - including jQuery dependency -->
|
<!-- Include formset plugin - including jQuery dependency -->
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||||
<script src="/static/js/jquery.formset.js"></script>
|
<script src="/static/js/jquery.formset.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$('.fav-formset').formset({
|
$('.fav-formset').formset({
|
||||||
@@ -61,10 +64,29 @@
|
|||||||
deleteText: '<div><p> </p></div><div>remove</div>'
|
deleteText: '<div><p> </p></div><div>remove</div>'
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
$( document ).ready(function() {
|
||||||
|
$('#id_workouttype').on('change', function(){
|
||||||
|
if (
|
||||||
|
$(this).val() == 'water'
|
||||||
|
|| $(this).val() == 'coastal'
|
||||||
|
|| $(this).val() == 'c-boat'
|
||||||
|
|| $(this).val() == 'churchboat'
|
||||||
|
) {
|
||||||
|
$('#id_boattype').toggle(true);
|
||||||
|
} else {
|
||||||
|
$('#id_boattype').toggle(false);
|
||||||
|
$('#id_boattype').val('1x');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
$('#id_workouttype').change();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% block sidebar %}
|
{% block sidebar %}
|
||||||
{% include 'menu_analytics.html' %}
|
{% include 'menu_analytics.html' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
<h2>{{ alert.name }}</h2>
|
<h2>{{ alert.name }}</h2>
|
||||||
<p>{{ alert }}</p>
|
<p>{{ alert }}</p>
|
||||||
<p>{{ alert.description }}</p>
|
<p>{{ alert.description }}</p>
|
||||||
|
<p>Managed by {{ alert.manager.first_name }} {{ alert.manager.last_name }}</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="rounder">
|
<li class="rounder">
|
||||||
<h2>Score</h2>
|
<h2>Score</h2>
|
||||||
|
|||||||
@@ -15,9 +15,11 @@
|
|||||||
{% for alert in alerts %}
|
{% for alert in alerts %}
|
||||||
<li class="rounder" id="alert_{{ alert.id }}">
|
<li class="rounder" id="alert_{{ alert.id }}">
|
||||||
<h2>{{ alert.name }}</h2>
|
<h2>{{ alert.name }}</h2>
|
||||||
|
{% if alert.manager == request.user %}
|
||||||
<a class="small" href="/rowers/alerts/{{ alert.id }}/edit/" title="Edit">
|
<a class="small" href="/rowers/alerts/{{ alert.id }}/edit/" title="Edit">
|
||||||
<i class="fas fa-pencil-alt fa-fw"></i>
|
<i class="fas fa-pencil-alt fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
<a class="small" href="/rowers/alerts/{{ alert.id }}/delete/"
|
<a class="small" href="/rowers/alerts/{{ alert.id }}/delete/"
|
||||||
title="Delete">
|
title="Delete">
|
||||||
<i class="fas fa-trash-alt fa-fw"></i>
|
<i class="fas fa-trash-alt fa-fw"></i>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
$('#id_workouttype').on('change', function(){
|
$('#id_workouttype').on('change', function(){
|
||||||
if (
|
if (
|
||||||
$(this).val() == 'water'
|
$(this).val() == 'water'
|
||||||
|| $(this).val() == 'coastal'
|
|| $(this).val() == 'coastal'
|
||||||
|
|||||||
@@ -781,7 +781,7 @@ def mocked_requests(*args, **kwargs):
|
|||||||
if ststrokestester.match(args[0]).group(1) == '13':
|
if ststrokestester.match(args[0]).group(1) == '13':
|
||||||
return MockResponse(ststrokesjson_nogps,200)
|
return MockResponse(ststrokesjson_nogps,200)
|
||||||
else:
|
else:
|
||||||
return MockResponse(strokesjson,200)
|
return MockResponse(ststrokesjson,200)
|
||||||
if stuploadtester.match(args[0]):
|
if stuploadtester.match(args[0]):
|
||||||
json_data = {
|
json_data = {
|
||||||
"uris": [
|
"uris": [
|
||||||
|
|||||||
@@ -445,6 +445,19 @@ class STObjects(DjangoTestCase):
|
|||||||
|
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
@patch('rowers.imports.requests.get', side_effect=mocked_requests)
|
||||||
|
def test_sporttracks_import_all(self, mock_get):
|
||||||
|
|
||||||
|
response = self.c.get('/rowers/workout/sporttracksimport/all/',follow=True)
|
||||||
|
|
||||||
|
expected_url = reverse('workouts_view')
|
||||||
|
|
||||||
|
self.assertRedirects(response,
|
||||||
|
expected_url=expected_url,
|
||||||
|
status_code=302,target_status_code=200)
|
||||||
|
|
||||||
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
def test_strokedata(self, mocked_sqlalchemy):
|
def test_strokedata(self, mocked_sqlalchemy):
|
||||||
with open('rowers/tests/testdata/sporttrackstestdata.txt','r') as infile:
|
with open('rowers/tests/testdata/sporttrackstestdata.txt','r') as infile:
|
||||||
|
|||||||
@@ -317,7 +317,8 @@ def trendflexdata(workouts, options,userid=0):
|
|||||||
datadf['date'].replace(datemapping,inplace=True)
|
datadf['date'].replace(datemapping,inplace=True)
|
||||||
|
|
||||||
today = datetime.date.today()
|
today = datetime.date.today()
|
||||||
datadf['days ago'] = map(lambda x : x.days, datadf.date - today)
|
datadf['days ago'] = list(map(lambda x : x.days, datadf.date - today))
|
||||||
|
|
||||||
|
|
||||||
if groupby != 'date':
|
if groupby != 'date':
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1551,12 +1551,11 @@ def workout_getsporttracksworkout_all(request):
|
|||||||
])
|
])
|
||||||
newids = [stid for stid in stids if not stid in knownstids]
|
newids = [stid for stid in stids if not stid in knownstids]
|
||||||
for sporttracksid in newids:
|
for sporttracksid in newids:
|
||||||
res = sporttracksstuff.get_sporttracks_workout(
|
data,strokedata = sporttracksstuff.get_workout(
|
||||||
request.user,sporttracksid)
|
request.user,sporttracksid)
|
||||||
data = res.json()
|
|
||||||
|
|
||||||
id,message = add_workout_from_stdata(
|
id,message = sporttracksstuff.add_workout_from_data(
|
||||||
request.user,sporttracksid,data
|
request.user,sporttracksid,data,strokedata
|
||||||
)
|
)
|
||||||
if id==0:
|
if id==0:
|
||||||
messages.error(request,message)
|
messages.error(request,message)
|
||||||
|
|||||||
@@ -803,15 +803,18 @@ def get_thumbnails(request,id):
|
|||||||
|
|
||||||
|
|
||||||
def get_blog_posts(request):
|
def get_blog_posts(request):
|
||||||
response = requests.get(
|
try:
|
||||||
'https://analytics.rowsandall.com/wp-json/wp/v2/posts')
|
response = requests.get(
|
||||||
if response.status_code == 200:
|
'https://analytics.rowsandall.com/wp-json/wp/v2/posts')
|
||||||
blogs_json = response.json()
|
if response.status_code == 200:
|
||||||
# with open('blogs.txt','w') as o:
|
blogs_json = response.json()
|
||||||
# o.write(json.dumps(blogs_json,indent=2,sort_keys=True))
|
# with open('blogs.txt','w') as o:
|
||||||
else:
|
# o.write(json.dumps(blogs_json,indent=2,sort_keys=True))
|
||||||
blogs_json = []
|
else:
|
||||||
|
blogs_json = []
|
||||||
|
except ConnectionError:
|
||||||
|
pass
|
||||||
|
|
||||||
blogposts = []
|
blogposts = []
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user