added authorization link
This commit is contained in:
@@ -162,6 +162,9 @@
|
||||
<div class="grid_2">
|
||||
<p><a href="/rowers/me/underarmourauthorize/"><img src="/static/img/UAbtn.png" alt="connect with Under Armour" width="120"></a></p>
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
<p><a href="/rowers/me/tpauthorize/"><img src="/static/img/TP_logo_horz_2_color.png" alt="connect with TrainingPeaks" width="150"></a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -208,7 +208,8 @@ def tp_check(access_token):
|
||||
|
||||
return resp
|
||||
|
||||
def uploadactivity(access_token,filename,description=''):
|
||||
def uploadactivity(access_token,filename,description='',
|
||||
name='Rowsandall.com workout'):
|
||||
data_gz = BytesIO()
|
||||
with file(filename,'rb') as inF:
|
||||
s = inF.read()
|
||||
@@ -226,6 +227,8 @@ def uploadactivity(access_token,filename,description=''):
|
||||
"UploadClient": "rowsandall",
|
||||
"Filename": filename,
|
||||
"SetWorkoutPublic": True,
|
||||
"Title":name,
|
||||
"Type": "rowing",
|
||||
"Comment": description,
|
||||
"Data": base64.b64encode(data_gz.getvalue()).decode("ascii")
|
||||
}
|
||||
|
||||
@@ -1230,7 +1230,7 @@ def workout_tp_upload_view(request,id=0):
|
||||
tcxfile = tpstuff.createtpworkoutdata(w)
|
||||
if tcxfile:
|
||||
res = tpstuff.uploadactivity(r.tptoken,tcxfile,
|
||||
description=w.notes)
|
||||
name=w.name)
|
||||
if res == 0:
|
||||
message = "Upload to TrainingPeaks failed"
|
||||
w.uploadedtotp = -1
|
||||
|
||||
BIN
static/img/TP_logo_horz_2_color.png
Normal file
BIN
static/img/TP_logo_horz_2_color.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
Reference in New Issue
Block a user