added robotx.txt & improved comparison chart
This commit is contained in:
@@ -711,6 +711,8 @@ class BasePlannedSessionFormSet(BaseFormSet):
|
||||
|
||||
# Check if workout is owned by this user
|
||||
def checkworkoutuser(user,workout):
|
||||
if user.is_anonymous():
|
||||
return False
|
||||
try:
|
||||
r = Rower.objects.get(user=user)
|
||||
teams = workout.team.all()
|
||||
|
||||
@@ -50,25 +50,16 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div id="other" class="grid_12 alpha">
|
||||
<div class="grid_2 alpha">
|
||||
<a class="button blue small"
|
||||
href="/rowers/workout/compare/{{ id2 }}/{{ id1 }}/{{ xparam }}/{{ yparam }}/{{ plottype }}">Swap Workouts</a>
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
<a class="button blue small"
|
||||
href="/rowers/workout/{{ id1 }}/edit">Edit Workout</a>
|
||||
</div>
|
||||
<div class="grid_2 suffix_6 omega">
|
||||
<a class="button blue small"
|
||||
href="/rowers/workout/{{ id1 }}/advanced">Advanced Edit</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<div id="plotbuttons" class="grid_12 alpha">
|
||||
<div id="x-axis" class="grid_6 alpha">
|
||||
<div class="grid_2 alpha">
|
||||
<p>
|
||||
<a class="button blue small"
|
||||
href="/rowers/workout/compare/{{ id2 }}/{{ id1 }}/{{ xparam }}/{{ yparam }}/{{ plottype }}">Swap Workouts</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid_2 alpha dropdown">
|
||||
<button class="grid_2 alpha button blue small dropbtn">X-axis</button>
|
||||
<div class="dropdown-content">
|
||||
@@ -90,7 +81,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="grid_2 suffix_2 omega dropdown">
|
||||
<div class="grid_2 omega dropdown">
|
||||
<button class="grid_2 alpha button blue small dropbtn">Y-axis</button>
|
||||
<div class="dropdown-content">
|
||||
{% for key, value in axchoicesbasic.items %}
|
||||
|
||||
@@ -7844,6 +7844,12 @@ def workout_comparison_view2(request,id1=0,id2=0,xparam='distance',
|
||||
row1 = Workout.objects.get(id=id1)
|
||||
row2 = Workout.objects.get(id=id2)
|
||||
|
||||
mayedit = 0
|
||||
if request.user == row1.user.user:
|
||||
mayedit=1
|
||||
if checkworkoutuser(request.user,row1):
|
||||
mayedit=1
|
||||
|
||||
if row1.workouttype != 'water' or row2.workouttype != 'water':
|
||||
axchoicespro.pop('slip')
|
||||
axchoicespro.pop('wash')
|
||||
@@ -7861,6 +7867,7 @@ def workout_comparison_view2(request,id1=0,id2=0,xparam='distance',
|
||||
'teams':get_my_teams(request.user),
|
||||
'id1':id1,
|
||||
'id2':id2,
|
||||
'mayedit':mayedit,
|
||||
'axchoicesbasic':axchoicesbasic,
|
||||
'axchoicespro':axchoicespro,
|
||||
'noylist':noylist,
|
||||
|
||||
Reference in New Issue
Block a user