Private
Public Access
1
0

Merge branch 'feature/coxmatelogo' into develop

This commit is contained in:
Sander Roosendaal
2017-08-24 18:18:19 +02:00
6 changed files with 16 additions and 2 deletions
+1
View File
@@ -19,6 +19,7 @@
<img src="/static/img/essquare.png" alt="ErgStick icon" width="30" height="30"> <img src="/static/img/essquare.png" alt="ErgStick icon" width="30" height="30">
<img src="/static/img/bcsquare.png" alt="BoatCoach icon" width="30" height="30"> <img src="/static/img/bcsquare.png" alt="BoatCoach icon" width="30" height="30">
<img src="/static/img/pssquare.png" alt="PainSled icon" width="30" height="30"> <img src="/static/img/pssquare.png" alt="PainSled icon" width="30" height="30">
<img src="/static/img/coxmate.png" alt="CoxMate icon" width="30" height="30">
</p> </p>
</div> </div>
+1 -1
View File
@@ -59,7 +59,7 @@
</tr><tr> </tr><tr>
<th>Comments</th> <th>Comments</th>
<td> <td>
<a href="/rowers/workout/{{ workout.id }}/comment">Comment</a> <a href="/rowers/workout/{{ workout.id }}/comment">Comment ({{ aantalcomments }})</a>
</td> </td>
</tr><tr> </tr><tr>
+1 -1
View File
@@ -33,7 +33,7 @@
<tr> <tr>
<th>Comments</th> <th>Comments</th>
<td> <td>
<a href="/rowers/workout/{{ workout.id }}/comment">Comment</a> <a href="/rowers/workout/{{ workout.id }}/comment">Comment ({{ aantalcomments }})</a>
</td> </td>
</tr> </tr>
{% endif %} {% endif %}
+13
View File
@@ -4457,6 +4457,11 @@ def workout_view(request,id=0):
try: try:
# check if valid ID exists (workout exists) # check if valid ID exists (workout exists)
row = Workout.objects.get(id=id) row = Workout.objects.get(id=id)
comments = WorkoutComment.objects.filter(workout=row)
aantalcomments = len(comments)
if row.privacy == 'private': if row.privacy == 'private':
raise Http404("Not allowed to view this workout") raise Http404("Not allowed to view this workout")
@@ -4479,6 +4484,7 @@ def workout_view(request,id=0):
'last_name':u.last_name, 'last_name':u.last_name,
'first_name':u.first_name, 'first_name':u.first_name,
'interactiveplot':script, 'interactiveplot':script,
'aantalcomments':aantalcomments,
'teams':get_my_teams(request.user), 'teams':get_my_teams(request.user),
'the_div':div}) 'the_div':div})
else: else:
@@ -4489,6 +4495,7 @@ def workout_view(request,id=0):
'last_name':u.last_name, 'last_name':u.last_name,
'first_name':u.first_name, 'first_name':u.first_name,
'teams':get_my_teams(request.user), 'teams':get_my_teams(request.user),
'aantalcomments':aantalcomments,
'interactiveplot':script, 'interactiveplot':script,
'the_div':div}) 'the_div':div})
@@ -6200,6 +6207,10 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
g = GraphImage.objects.filter(workout=row).order_by("-creationdatetime") g = GraphImage.objects.filter(workout=row).order_by("-creationdatetime")
# check if user is owner of this workout # check if user is owner of this workout
comments = WorkoutComment.objects.filter(workout=row)
aantalcomments = len(comments)
if (checkworkoutuser(request.user,row)==False): if (checkworkoutuser(request.user,row)==False):
raise Http404("You are not allowed to edit this workout") raise Http404("You are not allowed to edit this workout")
@@ -6245,6 +6256,7 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
'teams':get_my_teams(request.user), 'teams':get_my_teams(request.user),
'graphs1':g[0:3], 'graphs1':g[0:3],
'mapscript':mapscript, 'mapscript':mapscript,
'aantalcomments':aantalcomments,
'mapdiv':mapdiv, 'mapdiv':mapdiv,
}) })
@@ -6256,6 +6268,7 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
'graphs1':g[0:3], 'graphs1':g[0:3],
'graphs2':g[3:6], 'graphs2':g[3:6],
'mapscript':mapscript, 'mapscript':mapscript,
'aantalcomments':aantalcomments,
'mapdiv':mapdiv, 'mapdiv':mapdiv,
}) })
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.