Private
Public Access
1
0

show and unshow fav chart notes according user setting

This commit is contained in:
Sander Roosendaal
2017-10-25 21:26:40 +02:00
parent 8778ee7106
commit 336ccb1c74
3 changed files with 12 additions and 5 deletions

View File

@@ -191,8 +191,8 @@
{% endif %}
</div>
{% if favoritechartnotes %}
<div class="grid_12 alpha">
<p>{{ favoritechartnotes }}</p>
<div class="grid_6 prefix_6 alpha">
<p>Chart {{ favoritenr|add:1 }}:{{ favoritechartnotes }}</p>
</div>
{% endif %}
</div>

View File

@@ -8,7 +8,9 @@
<a href="/rowers/workout/{{ workout.id }}/flexchart?favoritechart={{ forloop.counter |add:"-1" }}">
{{ chart.div | safe }}
</a>
{% if rower.showfavoritechartnotes %}
<span class="tooltiptext">{{ chart.notes }}</span>
{% endif %}
</div>
</div>
{% endfor %}

View File

@@ -6034,6 +6034,7 @@ def workout_workflow_view(request,id):
'mapscript':mapscript,
'mapdiv':mapdiv,
'statcharts':statcharts,
'rower':r,
})
# The famous flex chart
@@ -6052,7 +6053,7 @@ def workout_flexchart3_view(request,*args,**kwargs):
try:
favoritenr = int(request.GET['favoritechart'])
except:
favoritenr = 0
favoritenr = -1
try:
@@ -6088,7 +6089,7 @@ def workout_flexchart3_view(request,*args,**kwargs):
try:
t = favorites[favoritenr].xparam
except IndexError:
favoritenr=0
favoritenr=-1
if 'xparam' in kwargs:
xparam = kwargs['xparam']
@@ -6118,10 +6119,12 @@ def workout_flexchart3_view(request,*args,**kwargs):
else:
yparam2 = 'hr'
if favoritenr and r.showfavoritechartnotes:
print favoritenr
if favoritenr>=0 and r.showfavoritechartnotes:
favoritechartnotes = favorites[favoritenr].notes
else:
favoritechartnotes = ''
favoritenr = 0
if 'plottype' in kwargs:
plottype = kwargs['plottype']
@@ -8770,6 +8773,7 @@ def rower_edit_view(request,message=""):
email = ucd['email']
defaultlandingpage = cd['defaultlandingpage']
weightcategory = cd['weightcategory']
showfavoritechartnotes = cd['showfavoritechartnotes']
getemailnotifications = cd['getemailnotifications']
defaulttimezone=cd['defaulttimezone']
u = request.user
@@ -8786,6 +8790,7 @@ def rower_edit_view(request,message=""):
r.weightcategory = weightcategory
r.getemailnotifications = getemailnotifications
r.defaultlandingpage = defaultlandingpage
r.showfavoritechartnotes = showfavoritechartnotes
r.save()
form = RowerForm(instance=r)
powerform = RowerPowerForm(instance=r)