share a graph facebook
This commit is contained in:
@@ -1,8 +1,16 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
|
{% load rowerfilters %}
|
||||||
|
|
||||||
{% block title %}{{ workout.name }}{% endblock %}
|
{% block title %}{{ workout.name }}{% endblock %}
|
||||||
|
{% block og_title %}{{ workout.name }} {% endblock %}
|
||||||
|
{% block description %}{{ workout.name }}
|
||||||
|
{{ workout.date }} - {{ workout.distance }}m - {{ workout.duration |durationprint:"%H:%M:%S.%f" }}{% endblock %}
|
||||||
|
{% block og_description %}{{ workout.name }}
|
||||||
|
{{ workout.date }} - {{ workout.distance }}m - {{ workout.duration |durationprint:"%H:%M:%S.%f" }}{% endblock %}
|
||||||
|
{% block og_image %}
|
||||||
|
<meta property="og:image" content="http://rowsandall.com/{{ graph.filename }}" />
|
||||||
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{{ workout.name }}</h1>
|
<h1>{{ workout.name }}</h1>
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,12 @@
|
|||||||
</pre>
|
</pre>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
{{ mapdiv|safe }}
|
||||||
|
|
||||||
|
|
||||||
|
{{ mapscript|safe }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="images" class="grid_6 omega">
|
<div id="images" class="grid_6 omega">
|
||||||
|
|
||||||
|
|||||||
@@ -4598,7 +4598,35 @@ def workout_view(request,id=0):
|
|||||||
res = interactive_chart(id)
|
res = interactive_chart(id)
|
||||||
script = res[0]
|
script = res[0]
|
||||||
div = res[1]
|
div = res[1]
|
||||||
|
|
||||||
|
# create map
|
||||||
|
f1 = row.csvfilename
|
||||||
|
u = row.user.user
|
||||||
|
r = getrower(u)
|
||||||
|
rowdata = rdata(f1)
|
||||||
|
hascoordinates = 1
|
||||||
|
if rowdata != 0:
|
||||||
|
try:
|
||||||
|
latitude = rowdata.df[' latitude']
|
||||||
|
if not latitude.std():
|
||||||
|
hascoordinates = 0
|
||||||
|
except KeyError,AttributeError:
|
||||||
|
hascoordinates = 0
|
||||||
|
|
||||||
|
else:
|
||||||
|
hascoordinates = 0
|
||||||
|
|
||||||
|
|
||||||
|
if hascoordinates:
|
||||||
|
mapscript,mapdiv = leaflet_chart(rowdata.df[' latitude'],
|
||||||
|
rowdata.df[' longitude'],
|
||||||
|
row.name)
|
||||||
|
|
||||||
|
|
||||||
|
else:
|
||||||
|
mapscript = ""
|
||||||
|
mapdiv = ""
|
||||||
|
|
||||||
|
|
||||||
# render page
|
# render page
|
||||||
if (len(g)<=3):
|
if (len(g)<=3):
|
||||||
@@ -4609,6 +4637,8 @@ def workout_view(request,id=0):
|
|||||||
'first_name':u.first_name,
|
'first_name':u.first_name,
|
||||||
'interactiveplot':script,
|
'interactiveplot':script,
|
||||||
'aantalcomments':aantalcomments,
|
'aantalcomments':aantalcomments,
|
||||||
|
'mapscript':mapscript,
|
||||||
|
'mapdiv':mapdiv,
|
||||||
'teams':get_my_teams(request.user),
|
'teams':get_my_teams(request.user),
|
||||||
'the_div':div})
|
'the_div':div})
|
||||||
else:
|
else:
|
||||||
@@ -4620,6 +4650,8 @@ def workout_view(request,id=0):
|
|||||||
'first_name':u.first_name,
|
'first_name':u.first_name,
|
||||||
'teams':get_my_teams(request.user),
|
'teams':get_my_teams(request.user),
|
||||||
'aantalcomments':aantalcomments,
|
'aantalcomments':aantalcomments,
|
||||||
|
'mapscript':mapscript,
|
||||||
|
'mapdiv':mapdiv,
|
||||||
'interactiveplot':script,
|
'interactiveplot':script,
|
||||||
'the_div':div})
|
'the_div':div})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user