Private
Public Access
1
0

completed functionality and tested

This commit is contained in:
Sander Roosendaal
2017-03-24 10:49:54 +01:00
parent 44afa5ef47
commit 89f33ea804
4 changed files with 64 additions and 50 deletions

View File

@@ -1 +0,0 @@
E408191@CZ27LT9RCGN72.9372:1490257958

View File

@@ -201,7 +201,9 @@ def createrunkeeperworkoutdata(w):
for e in zip(t,lat,lon):
point = {'timestamp':e[0],
'latitude':e[1],
'longitude':e[2],}
'longitude':e[2],
'altitude':0,
"type":"gps"}
locdata.append(point)
hrdata = []
@@ -230,7 +232,7 @@ def createrunkeeperworkoutdata(w):
"average_heart_rate": averagehr,
"path": locdata,
"distance": distancedata,
"heartrate": hrdata,
"heart_rate": hrdata,
"post_to_twitter":"false",
"post_to_facebook":"false",
}
@@ -243,7 +245,7 @@ def createrunkeeperworkoutdata(w):
"notes": w.notes,
"avg_heartrate": averagehr,
"distance": distancedata,
"heartrate": hrdata,
"heart_rate": hrdata,
"post_to_twitter":"false",
"post_to_facebook":"false",
}

View File

@@ -3,62 +3,77 @@
{% block content %}
<div class="grid_6 alpha">
<h3>Import Workouts</h3>
<h3>Import Workouts</h3>
<div class="grid_6">
<div class="grid_3 alpha">
<p>
<div class="grid_6">
<div class="grid_3 alpha">
<p>
<a href="/rowers/workout/stravaimport"><img src="/static/img/stravalogo.png" alt="strava logo" width="140"></a>
</p>
</div>
<div class="grid_3 omega">
<p>Import workouts from Strava</p>
</div>
</div>
<div class="grid_6">
<div class="grid_3 alpha">
<p>
</p>
</div>
<div class="grid_3 omega">
<p>Import workouts from Strava</p>
</div>
</div>
<div class="grid_6">
<div class="grid_3 alpha">
<p>
<a href="/rowers/workout/c2import"><img src="/static/img/blueC2logo.png" alt="Concept2 logo" width="140"></a>
</p>
</div>
<div class="grid_3 omega">
<p>Import workouts from the Concept2 logbook</p>
</div>
<div class="grid_3 alpha">
<p>
</p>
</div>
<div class="grid_3 omega">
<p>Import workouts from the Concept2 logbook</p>
</div>
<div class="grid_3 alpha">
<p>
<a href="/rowers/workout/sporttracksimport"><img src="/static/img/sporttracks-button.png" alt="SportTracks logo" width="140"></a>
</p>
</div>
<div class="grid_3 omega">
<p>Import workouts from SportTracks</p>
</div>
</div>
</p>
</div>
<div class="grid_3 omega">
<p>Import workouts from SportTracks</p>
</div>
</div>
<div class="grid_6">
<div class="grid_3 alpha">
<p>
<a href="/rowers/workout/runkeeperimport"><img src="/static/img/rk-logo.png" alt="Runkeeper logo" width="140"></a>
</p>
</div>
<div class="grid_3 omega">
<p>Import workouts from RunKeeper</p>
</div>
</div>
</div>
<div class="grid_6 omega">
<h3>Connect</h3>
<h3>Connect</h3>
<div class="grid_6">
<p>Click one of the below logos to connect to the service of your choice.
You only need to do this once. After that, the site will have access until you
revoke the authorization for the "rowingdata" app.</p>
<div class="grid_6">
<p>Click one of the below logos to connect to the service of your choice.
You only need to do this once. After that, the site will have access until you
revoke the authorization for the "rowingdata" app.</p>
<div class="grid_2 alpha">
<p><a href="/rowers/me/stravaauthorize/"><img src="/static/img/ConnectWithStrava.png" alt="connect with strava" width="120"></a></p>
<div class="grid_2 alpha">
<p><a href="/rowers/me/stravaauthorize/"><img src="/static/img/ConnectWithStrava.png" alt="connect with strava" width="120"></a></p>
</div>
<div class="grid_2">
<p><a href="/rowers/me/c2authorize/"><img src="/static/img/blueC2logo.png" alt="connect with Concept2" width="120"></a></p>
</div>
</div>
<div class="grid_2">
<p><a href="/rowers/me/c2authorize/"><img src="/static/img/blueC2logo.png" alt="connect with Concept2" width="120"></a></p>
</div>
<div class="grid_2 omega">
<p><a href="/rowers/me/sporttracksauthorize/"><img src="/static/img/sporttracks-button.png" alt="connect with SportTracks" width="120"></a></p>
</div>
<div class="grid_2 omega">
<p><a href="/rowers/me/sporttracksauthorize/"><img src="/static/img/sporttracks-button.png" alt="connect with SportTracks" width="120"></a></p>
</div>
</div>
</div>
<div class="grid_6">
<div class="grid_2 alpha suffix_4">
<p><a href="/rowers/me/runkeeperauthorize/"><img src="/static/img/rk-logo.png" alt="connect with RunKeeper" width="120"></a></p>
</div>
</div>
</div>
{% endblock content %}

View File

@@ -540,7 +540,7 @@ def add_workout_from_runkeeperdata(user,importid,data):
rowdatetime = datetime.datetime.strptime(data['date'],"%Y-%m-%d %H:%M:%S")
rowdatetime = thetimezone.localize(rowdatetime).astimezone(utc)
starttimeunix = mktime(rowdatetime.utctimetuple())
startimeunix += utcoffset*3600
starttimeunix += utcoffset*3600
try:
@@ -1204,9 +1204,7 @@ def workout_runkeeper_upload_view(request,id=0):
return HttpResponseRedirect(url)
else:
s = response
print dir(s)
print s.text
message = "Something went wrong in workout_runkeeper_upload_view: %s" % s.reason
message = "Something went wrong in workout_runkeeper_upload_view: %s - %s" % (s.reason,s.text)
else:
message = "You are not authorized to upload this workout"