Private
Public Access
1
0

force curve, comments, edit

This commit is contained in:
Sander Roosendaal
2018-10-09 20:35:37 +02:00
parent f8b09b7b6d
commit c693655966
9 changed files with 552 additions and 781 deletions

View File

@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "newbase.html" %}
{% load staticfiles %}
{% load rowerfilters %}
{% load tz %}
@@ -6,7 +6,7 @@
{% block title %} Force Curve Plot {% endblock %}
{% localtime on %}
{% block content %}
{% block main %}
{{ js_res | safe }}
{{ css_res| safe }}
@@ -19,54 +19,34 @@
{{ the_script |safe }}
<h1>Empower Force Curve</h1>
<style>
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
html, body {height: 100%; margin:5px;}
</style>
<div id="navigation" class="grid_12 alpha">
<ul class="main-content">
<li class="grid_4">
{% if user.is_authenticated and mayedit %}
<div class="grid_2 alpha">
<p>
<a class="button gray small" href="/rowers/workout/{{ id }}/edit">Edit Workout</a>
</p>
</div>
<div class="grid_2 suffix_2">
<p>
<a class="button gray small" href="/rowers/workout/{{ id }}/advanced">Advanced Edit</a>
</p>
</div>
{% endif %}
<div class="grid_2 suffix_4 omega tooltip">
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
{% csrf_token %}
{% if workstrokesonly %}
<input type="hidden" name="workstrokesonly" value="True">
<input class="grid_2 alpha button blue small" value="Remove Rest Strokes" type="Submit">
<input class="button blue small" value="Remove Rest Strokes" type="Submit">
{% else %}
<input class="grid_2 alpha button blue small" type="hidden" name="workstrokesonly" value="False">
<input class="grid_2 alpha button blue small" value="Include Rest Strokes" type="Submit">
{% endif %}
<input class="button blue small" type="hidden" name="workstrokesonly" value="False">
<input class="button blue small" value="Include Rest Strokes" type="Submit">
</form>
{% endif %}
<span class="tooltiptext">If your data source allows, this will show or hide strokes taken during rest intervals.</span>
</div>
</div>
<p>&nbsp;</p>
<div id="theplot" class="grid_12 alpha">
{% endif %}
</li>
<li class="grid_4">
{{ the_div|safe }}
</div>
</li>
</ul>
{% endblock %}
{% endlocaltime %}
{% block sidebar %}
{% include 'menu_workout.html' %}
{% endblock %}

View File

@@ -167,7 +167,6 @@ xo
<th> Max HR </th>
{% if not team %}
<th> &nbsp;</th>
<th> &nbsp;</th>
{% else %}
<th colspan="2">
Owner
@@ -216,11 +215,7 @@ xo
<td> {{ workout.duration |durationprint:"%H:%M:%S.%f" }} </td>
<td> {{ workout.averagehr }} </td>
<td> {{ workout.maxhr }} </td>
{% if not team %}
<td>
<a class="small" href="/rowers/workout/{{ workout.id }}/export">Export</a>
</td>
{% else %}
{% if team %}
<td colspan="2">
<a class="small" href="/rowers/{{ workout.user.id }}/list-workouts">
{{ workout.user.user.first_name }}

View File

@@ -28,6 +28,14 @@
</a>
</li>
{% endif %}
{% if user.is_authenticated %}
<li id="workout-comments">
<a href="/rowers/workout/{{ workout.id }}/comment">
<i class="fas fa-comments fa-fw"></i>&nbsp;Comments
({{ workout|aantalcomments }})
</a>
</li>
{% endif %}
<li id="workout-stats">
<a href="/rowers/workout/{{ workout.id }}/stats">
<i class="fal fa-table fa-fw"></i>&nbsp;Statistics
@@ -62,6 +70,11 @@
<i class="fas fa-map-marked-alt fa-fw"></i>&nbsp;Map
</a>
</li>
<li id="chart-empower">
<a href="/rowers/workout/{{ workout.id }}/forcecurve">
<i class="fas fa-dumbbell fa-fw"></i>&nbsp;Force Curve
</a>
</li>
<li id="chart-otwpower">
<a href="/rowers/workout/{{ workout.id }}/interactiveotwplot">
<i class="fal fa-calculator-alt fa-fw"></i>&nbsp;OTW Power

View File

@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "newbase.html" %}
{% load staticfiles %}
{% load rowerfilters %}
{% load tz %}
@@ -7,19 +7,13 @@
{% include "monitorjobs.html" %}
{% endblock %}
{% block title %}Change Workout {% endblock %}
{% block title %}Comment Workout {% endblock %}
{% block content %}
<div id="left" class="grid_6 alpha">
<div id="summary" class="grid_6 alpha">
{% if form.errors %}
<p style="color: red;">
Please correct the error{{ form.errors|pluralize }} below.
</p>
{% endif %}
<h1>Comments {{ workout.name }}</h1>
{% block main %}
<h1>Comments {{ workout.name }}</h1>
<ul class="main-content">
<li class="grid_4">
{% localtime on %}
<table width=100%>
<tr>
@@ -35,117 +29,39 @@
<td>
<a href="/rowers/workout/{{ workout.id }}">https://rowsandall.com/rowers/workout/{{ workout.id }}</a>
<td>
</tr><tr>
<th>Public link to interactive chart</th>
<td>
<a href="/rowers/workout/{{ workout.id }}/interactiveplot">https://rowsandall.com/rowers/workout/{{ workout.id }}/interactiveplot</a>
<td>
</tr>
</table>
{% endlocaltime %}
</div>
</li>
<li class="grid_2">
{% for c in comments %}
<div class="grid_6 alpha">
<div class="grid_2 alpha">
{{ c.created }}
<b>{{ c.user.first_name }} {{ c.user.last_name }}</b>
</div>
<div class="grid_4 omega">
<div class="talk-bubble tri-right left-top">
<div class="talktext">
{{ c.comment }}
</div>
</div>
</div>
</div>
{% endfor %}
<div id="form" class="grid_6 alpha">
<form enctype="multipart/form-data" action="/rowers/workout/{{ workout.id }}/comment" method="post">
<table width=100%>
{{ form.as_table }}
</table>
{% csrf_token %}
<div id="formbutton" class="grid_1 prefix_4 suffix_1 omega">
<input class="button green" type="submit" value="Save">
</div>
</form>
</div>
</div>
<div id="images" class="grid_6 omega">
<h1>Images linked to this workout</h1>
{% if graphs1 %}
{% for graph in graphs1 %}
{% if forloop.counter == 1 %}
<div id="thumb-container" class="grid_2 alpha">
</li>
{% for graph in graphs %}
<li>
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100"></a>
</div>
{% elif forloop.counter == 3 %}
<div id="thumb-container" class="grid_2 omega">
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100"></a>
</div>
{% else %}
<div id="thumb-container" class="grid_2">
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100"></a>
</div>
{% endif %}
alt="{{ graph.filename }}" width="120" height="100">
</a>
</li>
{% endfor %}
{% for graph in graphs2 %}
{% if forloop.counter == 1 %}
<div id="thumb-container" class="grid_2 alpha">
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100"></a>
</div>
{% elif forloop.counter == 3 %}
<div id="thumb-container" class="grid_2 omega">
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100"></a>
</div>
{% else %}
<div id="thumb-container" class="grid_2">
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100"></a>
</div>
{% endif %}
{% endfor %}
{% else %}
<p> No graphs found </p>
{% endif %}
</div>
<style>
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
html, body {height: 100%; margin:5px;}
</style>
<div id="summary" class="grid_6 omega">
<li class="grid_2">
<h1>Workout Summary</h1>
<p>
@@ -154,11 +70,9 @@
</pre>
</p>
</div>
</li>
<div id="interactiveplot" class="grid_6 omega">
<li class="grid_2">
<script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script>
<script async="true" type="text/javascript">
Bokeh.set_log_level("info");
@@ -166,22 +80,14 @@
{{ gmscript |safe }}
<style>
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
html, body, #map_canvas {
height: 100%;
width: 100%;
margin:0;
padding: 0;
}
#map_canvas_container {position: relative; top:0; right:0; bottom:0; left:0;}
#map_canvas {position: relative; top: 0; right: 0; bottom: 0; left: 0;}
</style>
<div id="map_canvas">
<div id="mapdiv">
{{ gmdiv|safe }}
</div>
</div>
</li>
</ul>
{% endblock %}
{% block sidebar %}
{% include 'menu_workout.html' %}
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "newbase.html" %}
{% load staticfiles %}
{% load rowerfilters %}
{% load tz %}
@@ -42,54 +42,24 @@ $('#id_workouttype').change();
</script>
{% endblock %}
{% block content %}
<div id="workouts" class="grid_6 alpha">
{% block main %}
{% if form.errors %}
<p style="color: red;">
Please correct the error{{ form.errors|pluralize }} below.
</p>
{% endif %}
<h1>Edit Workout {{ workout.name }}</h1>
<div class="grid_6 alpha">
<div class="grid_2 alpha">
<h1>Edit Workout {{ workout.name }}</h1>
<ul class="main-content">
<li class="grid_4">
<p>
<a class="button red small" href="/rowers/workout/{{ workout.id }}/deleteconfirm">Delete</a>
</p>
<div class="fb-share-button"
data-href="https://rowsandall.com/rowers/workout/{{ workout.id }}"
data-layout="button" data-size="small" data-mobile-iframe="false">
<a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://rowsandall.com/rowers/workout/{{ workout.id }}">Share</a>
</div>
<div class="grid_2">
</p>
<p>
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/export">Export</a>
<a class="twitter-share-button"
href="https://twitter.com/intent/tweet"
data-url="https://rowsandall.com/rowers/workout/{{ workout.id }}"
data-text="@rowsandall #rowingdata">Tweet</a>
</p>
</div>
<div class="grid_2 omega tooltip">
<p>
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/advanced">Advanced</a>
</p>
<span class="tooltiptext">Advanced Functionality (More interactive Charts)</span>
</div>
</div>
<div class="grid_6 alpha">
<div class="grid_2 alpha">
<p>
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/workflow">Workflow View</a>
</p>
</div>
<div class="grid_2">
<p>
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/map">Map View</a>
</p>
</div>
<div class="grid_2 omega">
<p>
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/stats">Statistics</a>
</p>
</div>
</div>
<div class="grid_6 alpha">
<table width=100%>
<tr>
{% localtime on %}
@@ -97,8 +67,8 @@ $('#id_workouttype').change();
<th>Rower:</th><td>{{ rower.user.first_name }} {{ rower.user.last_name }}</td>
</tr><tr>
{% endif %}
<th>Date/Time:</th><td>{{ workout.startdatetime|localtime}}</td>
{% endlocaltime %}
<th>Date/Time:</th><td>{{ workout.startdatetime|localtime}}</td>
{% endlocaltime %}
</tr><tr>
<th>Distance:</th><td>{{ workout.distance }}m</td>
</tr><tr>
@@ -108,137 +78,28 @@ $('#id_workouttype').change();
<td>
<a href="/rowers/workout/{{ workout.id }}">https://rowsandall.com/rowers/workout/{{ workout.id }}</a>
</td>
</tr><tr>
<th>Comments</th>
<td>
<a href="/rowers/workout/{{ workout.id }}/comment">Comment ({{ aantalcomments }})</a>
</td>
</tr><tr>
<th>Public link to interactive chart</th>
<td>
<a href="/rowers/workout/{{ workout.id }}/interactiveplot">https://rowsandall.com/rowers/workout/{{ workout.id }}/interactiveplot</a>
<td>
</tr>
</table>
</div>
<div id="form-div" class="grid_6 alpha">
</li>
<li class="grid_2">
{% if form.errors %}
<p style="color: red;">
Please correct the error{{ form.errors|pluralize }} below.
</p>
{% endif %}
<form id="importantform"
enctype="multipart/form-data" action="" method="post">
<table width=100%>
{{ form.as_table }}
</table>
{% csrf_token %}
<div id="formbutton" class="grid_1 prefix_2 suffix_1 omega">
<input class="button green" type="submit" value="Save">
</div>
</form>
</div>
</div>
<div id="images" class="grid_6 omega">
<h1>Images linked to this workout</h1>
<div class="grid_6 alpha">
<div class="grid_2 alpha">
<p>
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/addtimeplot">Add Time Plot</a>
</p>
</div>
<div class="grid_2">
<p>
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/adddistanceplot">Add Distance Plot</a>
</p>
</div>
<div class="grid_2 omega">
<p>
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/addpiechart">Add HR Pie Chart</a>
</p>
</div>
<div class="grid_6 alpha">
<div class="grid_2 alpha">
<p>
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/image">Attach Image</a>
</p>
</div>
<div class="grid_2 prefix_2 omega">
<p>
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/addpowerpiechart">Power Pie Chart</a>
</p>
</div>
<div class="grid_6">
<p>Generating images takes roughly 1 second per minute
of your workout's duration. Please reload after a minute or so.</p>
</div>
</div>
{% if graphs1 %}
</li>
<li class="grid_2">
{% for graph in graphs1 %}
{% if forloop.counter == 1 %}
<div id="thumb-container" class="grid_2 alpha">
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100"></a>
</div>
{% elif forloop.counter == 3 %}
<div id="thumb-container" class="grid_2 omega">
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100"></a>
</div>
{% else %}
<div id="thumb-container" class="grid_2">
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100"></a>
</div>
{% endif %}
{% endfor %}
{% for graph in graphs2 %}
{% if forloop.counter == 1 %}
<div id="thumb-container" class="grid_2 alpha">
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100"></a>
</div>
{% elif forloop.counter == 3 %}
<div id="thumb-container" class="grid_2 omega">
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100"></a>
</div>
{% else %}
<div id="thumb-container" class="grid_2">
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100"></a>
</div>
{% endif %}
{% endfor %}
{% else %}
<p> No graphs found </p>
{% endif %}
</div>
<style>
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
html, body {height: 100%; margin:5px;}
</style>
<div id="summary" class="grid_6 omega">
<div class="grid_5 alpha">
<h1>Workout Summary</h1>
<p>
@@ -246,57 +107,40 @@ $('#id_workouttype').change();
{{ workout.summary }}
</pre>
</p>
<div class="grid_2 alpha">
<p>
<a class="button green small" href="/rowers/workout/{{ workout.id }}/recalcsummary">Update Summary</a>
<a href="/rowers/workout/{{ workout.id }}/recalcsummary">Update Summary</a>
</p>
</div>
</div>
<div class="grid_1 omega">
<div class="grid_1 alpha">
<div class="fb-share-button" data-href="https://rowsandall.com/rowers/workout/{{ workout.id }}" data-layout="button" data-size="small" data-mobile-iframe="false">
<a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://rowsandall.com/rowers/workout/{{ workout.id }}">Share</a></div>
</div>
<div class="grid_1 alpha">
<p>&nbsp;</p>
<a class="twitter-share-button"
href="https://twitter.com/intent/tweet"
data-url="https://rowsandall.com/rowers/workout/{{ workout.id }}"
data-text="@rowsandall #rowingdata">Tweet</a>
</div>
</div>
</div>
<div id="interactiveplot" class="grid_6 omega">
</li>
{% if mapdiv %}
<li class="grid_2">
<script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script>
<script async="true" type="text/javascript">
Bokeh.set_log_level("info");
</script>
<style>
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
html, body, #map_canvas {
height: 100%;
width: 100%;
margin:0;
padding: 0;
}
#map_canvas_container {position: relative; top:0; right:0; bottom:0; left:0;}
#map_canvas {position: relative; top: 0; right: 0; bottom: 0; left: 0;}
</style>
<div class="mapdiv">
{{ mapdiv|safe }}
</div>
{{ mapscript|safe }}
</div>
</div>
</li>
{% endif %}
{% for graph in graphs %}
<li>
<a href="/rowers/graph/{{ graph.id }}/">
<img src="/{{ graph.filename }}"
onerror="this.src='/static/img/rowingtimer.gif'"
alt="{{ graph.filename }}" width="120" height="100">
</a>
</li>
{% endfor %}
</ul>
{% endblock %}
{% block sidebar %}
{% include 'menu_workout.html' %}
{% endblock %}

View File

@@ -8,7 +8,7 @@ import datetime
import re
register = template.Library()
from rowers.utils import calculate_age
from rowers.models import course_length
from rowers.models import course_length,WorkoutComment
from rowers.plannedsessions import (
race_can_register, race_can_submit,race_rower_status
)
@@ -55,6 +55,14 @@ def secondstotimestring(tdelta):
return res
@register.filter
def aantalcomments(workout):
comments = WorkoutComment.objects.filter(workout=workout)
aantalcomments = len(comments)
return aantalcomments
@register.filter
def water(workout):
try:

View File

@@ -226,7 +226,7 @@ urlpatterns = [
url(r'^workout/(?P<id>\d+)/task$',views.workout_test_task_view),
url(r'^workout/(?P<id>\d+)/forcecurve$',views.workout_forcecurve_view),
url(r'^workout/(?P<id>\d+)/unsubscribe$',views.workout_unsubscribe_view),
url(r'^workout/(?P<id>\d+)/export$',views.workout_export_view),
# url(r'^workout/(?P<id>\d+)/export$',views.workout_export_view),
url(r'^workout/(?P<id>\d+)/comment$',views.workout_comment_view),
url(r'^workout/(?P<id>\d+)/emailtcx$',views.workout_tcxemail_view),
url(r'^workout/(?P<id>\d+)/emailgpx$',views.workout_gpxemail_view),
@@ -328,8 +328,7 @@ urlpatterns = [
url(r'^workout/(?P<id>\d+)/underarmouruploadw/$',views.workout_underarmour_upload_view),
url(r'^workout/(?P<id>\d+)/tpuploadw/$',views.workout_tp_upload_view),
url(r'^multi-compare$',views.multi_compare_view),
url(r'^user-boxplot/(?P<userid>\d+)$',views.boxplot_view),
url(r'^user-boxplot/$',views.boxplot_view),
url(r'^user-boxplot/user/(?P<userid>\d+)$',views.boxplot_view),
url(r'^user-boxplot$',views.boxplot_view),
url(r'^user-boxplot-data$',views.boxplot_view_data),
url(r'^user-multiflex/(?P<userid>\d+)$',views.multiflex_view),

View File

@@ -2830,10 +2830,32 @@ def workout_forcecurve_view(request,id=0,workstrokesonly=False):
script,div,js_resources,css_resources = interactive_forcecurve([row],
workstrokesonly=workstrokesonly)
breadcrumbs = [
{
'url':'/rowers/list-workouts',
'name':'Workouts'
},
{
'url':get_workout_default_page(request,id),
'name': str(row.id)
},
{
'url':reverse(workout_forcecurve_view,kwargs={'id':id}),
'name': 'Empower Force Curve'
}
]
r = getrower(request.user)
return render(request,
'forcecurve_single.html',
{
'the_script':script,
'rower':r,
'workout':row,
'breadcrumbs':breadcrumbs,
'active':'nav-workouts',
'the_div':div,
'js_res': js_resources,
'css_res':css_resources,
@@ -8903,23 +8925,33 @@ def workout_comment_view(request,id=0):
except:
pass
rower = getrower(request.user)
breadcrumbs = [
{
'url':'/rowers/list-workouts',
'name':'Workouts'
},
{
'url':get_workout_default_page(request,id),
'name': str(w.id)
},
{
'url':reverse(workout_comment_view,kwargs={'id':id}),
'name': 'Comments'
}
]
if (len(g)<=3):
return render(request,
'workout_comments.html',
{'workout':w,
'rower':rower,
'breadcrumbs':breadcrumbs,
'active':'nav-workouts',
'teams':get_my_teams(request.user),
'graphs1':g[0:3],
'comments':comments,
'form':form,
})
else:
return render(request,
'workout_comments.html',
{'workout':w,
'teams':get_my_teams(request.user),
'graphs1':g[0:3],
'graphs1':g[3:6],
'graphs':g,
'comments':comments,
'form':form,
})
@@ -9083,6 +9115,9 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
row = get_workout(id)
if (checkworkoutuser(request.user,row)==False):
raise PermissionDenied("Access denied")
form = WorkoutForm(instance=row)
if request.method == 'POST':
@@ -9142,8 +9177,7 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
thetimezone = 'UTC'
# check if user is owner of this workout
if checkworkoutuser(request.user,row):
row.name = name
row.date = date
row.starttime = starttime
@@ -9180,12 +9214,6 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
'id':str(row.id),
})
response = HttpResponseRedirect(url)
else:
message = "You are not allowed to change this workout"
messages.error(request,message)
url = reverse(workouts_view)
response = HttpResponseRedirect(url)
#else: # form not POSTed
form = WorkoutForm(instance=row)
@@ -9203,15 +9231,6 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
pass
# check if user is owner of this workout
comments = WorkoutComment.objects.filter(workout=row)
aantalcomments = len(comments)
if (checkworkoutuser(request.user,row)==False):
raise PermissionDenied("Access denied")
# create interactive plot
f1 = row.csvfilename
u = row.user.user
@@ -9245,34 +9264,40 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
except KeyError:
pass
breadcrumbs = [
{
'url':'/rowers/list-workouts',
'name':'Workouts'
},
{
'url':get_workout_default_page(request,id),
'name': str(row.id)
},
{
'url':reverse(workout_edit_view,kwargs={'id':id}),
'name': 'Edit'
}
]
r = getrower(request.user)
# render page
if (len(g)<=3):
return render(request, 'workout_form.html',
{'form':form,
'workout':row,
'teams':get_my_teams(request.user),
'graphs1':g[0:3],
'mapscript':mapscript,
'aantalcomments':aantalcomments,
'mapdiv':mapdiv,
'graphs':g,
'breadcrumbs':breadcrumbs,
'rower':r,
})
else:
return render(request, 'workout_form.html',
{'form':form,
'teams':get_my_teams(request.user),
'workout':row,
'graphs1':g[0:3],
'graphs2':g[3:6],
'active':'nav-workouts',
'mapscript':mapscript,
'aantalcomments':aantalcomments,
'mapdiv':mapdiv,
'rower':r,
})
return HttpResponseRedirect(url)
@login_required()
def workout_map_view(request,id=0):

View File

@@ -332,6 +332,261 @@ th.rotate > div > span {
color: #fcd3a5;
}
/* CSS talk bubble */
.talk-bubble {
margin: 40px;
display: inline-block;
position: relative;
width: 200px;
height: auto;
background-color: lightyellow;
}
.border{
border: 8px solid #666;
}
.round{
border-radius: 30px;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
}
/* Right triangle placed top left flush. */
.tri-right.border.left-top:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: -40px;
right: auto;
top: -8px;
bottom: auto;
border: 32px solid;
border-color: #666 transparent transparent transparent;
}
.tri-right.left-top:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: -20px;
right: auto;
top: 0px;
bottom: auto;
border: 22px solid;
border-color: lightyellow transparent transparent transparent;
}
/* Right triangle, left side slightly down */
.tri-right.border.left-in:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: -40px;
right: auto;
top: 30px;
bottom: auto;
border: 20px solid;
border-color: #666 #666 transparent transparent;
}
.tri-right.left-in:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: -20px;
right: auto;
top: 38px;
bottom: auto;
border: 12px solid;
border-color: lightyellow lightyellow transparent transparent;
}
/*Right triangle, placed bottom left side slightly in*/
.tri-right.border.btm-left:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: -8px;
right: auto;
top: auto;
bottom: -40px;
border: 32px solid;
border-color: transparent transparent transparent #666;
}
.tri-right.btm-left:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: 0px;
right: auto;
top: auto;
bottom: -20px;
border: 22px solid;
border-color: transparent transparent transparent lightyellow;
}
/*Right triangle, placed bottom left side slightly in*/
.tri-right.border.btm-left-in:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: 30px;
right: auto;
top: auto;
bottom: -40px;
border: 20px solid;
border-color: #666 transparent transparent #666;
}
.tri-right.btm-left-in:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: 38px;
right: auto;
top: auto;
bottom: -20px;
border: 12px solid;
border-color: lightyellow transparent transparent lightyellow;
}
/*Right triangle, placed bottom right side slightly in*/
.tri-right.border.btm-right-in:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: 30px;
bottom: -40px;
border: 20px solid;
border-color: #666 #666 transparent transparent;
}
.tri-right.btm-right-in:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: 38px;
bottom: -20px;
border: 12px solid;
border-color: lightyellow lightyellow transparent transparent;
}
/*
left: -8px;
right: auto;
top: auto;
bottom: -40px;
border: 32px solid;
border-color: transparent transparent transparent #666;
left: 0px;
right: auto;
top: auto;
bottom: -20px;
border: 22px solid;
border-color: transparent transparent transparent lightyellow;
/*Right triangle, placed bottom right side slightly in*/
.tri-right.border.btm-right:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: -8px;
bottom: -40px;
border: 20px solid;
border-color: #666 #666 transparent transparent;
}
.tri-right.btm-right:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: 0px;
bottom: -20px;
border: 12px solid;
border-color: lightyellow lightyellow transparent transparent;
}
/* Right triangle, right side slightly down*/
.tri-right.border.right-in:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: -40px;
top: 30px;
bottom: auto;
border: 20px solid;
border-color: #666 transparent transparent #666;
}
.tri-right.right-in:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: -20px;
top: 38px;
bottom: auto;
border: 12px solid;
border-color: lightyellow transparent transparent lightyellow;
}
/* Right triangle placed top right flush. */
.tri-right.border.right-top:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: -40px;
top: -8px;
bottom: auto;
border: 32px solid;
border-color: #666 transparent transparent transparent;
}
.tri-right.right-top:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: -20px;
top: 0px;
bottom: auto;
border: 20px solid;
border-color: lightyellow transparent transparent transparent;
}
/* talk bubble contents */
.talktext{
padding: 1em;
text-align: left;
line-height: 1.5em;
word-wrap: break-word;
}
.talktext p{
/* remove webkit p margins */
-webkit-margin-before: 0em;
-webkit-margin-after: 0em;
}
.drop-files {
border: 1px solid #000;
color: #000;
}
.input {
font: 1.1em/1.5em sans-serif;
@@ -609,260 +864,6 @@ a.wh:hover {
padding: 5% 5%;
}
/* CSS talk bubble */
.talk-bubble {
margin: 40px;
display: inline-block;
position: relative;
width: 200px;
height: auto;
background-color: lightyellow;
}
.border{
border: 8px solid #666;
}
.round{
border-radius: 30px;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
}
/* Right triangle placed top left flush. */
.tri-right.border.left-top:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: -40px;
right: auto;
top: -8px;
bottom: auto;
border: 32px solid;
border-color: #666 transparent transparent transparent;
}
.tri-right.left-top:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: -20px;
right: auto;
top: 0px;
bottom: auto;
border: 22px solid;
border-color: lightyellow transparent transparent transparent;
}
/* Right triangle, left side slightly down */
.tri-right.border.left-in:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: -40px;
right: auto;
top: 30px;
bottom: auto;
border: 20px solid;
border-color: #666 #666 transparent transparent;
}
.tri-right.left-in:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: -20px;
right: auto;
top: 38px;
bottom: auto;
border: 12px solid;
border-color: lightyellow lightyellow transparent transparent;
}
/*Right triangle, placed bottom left side slightly in*/
.tri-right.border.btm-left:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: -8px;
right: auto;
top: auto;
bottom: -40px;
border: 32px solid;
border-color: transparent transparent transparent #666;
}
.tri-right.btm-left:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: 0px;
right: auto;
top: auto;
bottom: -20px;
border: 22px solid;
border-color: transparent transparent transparent lightyellow;
}
/*Right triangle, placed bottom left side slightly in*/
.tri-right.border.btm-left-in:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: 30px;
right: auto;
top: auto;
bottom: -40px;
border: 20px solid;
border-color: #666 transparent transparent #666;
}
.tri-right.btm-left-in:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: 38px;
right: auto;
top: auto;
bottom: -20px;
border: 12px solid;
border-color: lightyellow transparent transparent lightyellow;
}
/*Right triangle, placed bottom right side slightly in*/
.tri-right.border.btm-right-in:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: 30px;
bottom: -40px;
border: 20px solid;
border-color: #666 #666 transparent transparent;
}
.tri-right.btm-right-in:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: 38px;
bottom: -20px;
border: 12px solid;
border-color: lightyellow lightyellow transparent transparent;
}
/*
left: -8px;
right: auto;
top: auto;
bottom: -40px;
border: 32px solid;
border-color: transparent transparent transparent #666;
left: 0px;
right: auto;
top: auto;
bottom: -20px;
border: 22px solid;
border-color: transparent transparent transparent lightyellow;
/*Right triangle, placed bottom right side slightly in*/
.tri-right.border.btm-right:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: -8px;
bottom: -40px;
border: 20px solid;
border-color: #666 #666 transparent transparent;
}
.tri-right.btm-right:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: 0px;
bottom: -20px;
border: 12px solid;
border-color: lightyellow lightyellow transparent transparent;
}
/* Right triangle, right side slightly down*/
.tri-right.border.right-in:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: -40px;
top: 30px;
bottom: auto;
border: 20px solid;
border-color: #666 transparent transparent #666;
}
.tri-right.right-in:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: -20px;
top: 38px;
bottom: auto;
border: 12px solid;
border-color: lightyellow transparent transparent lightyellow;
}
/* Right triangle placed top right flush. */
.tri-right.border.right-top:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: -40px;
top: -8px;
bottom: auto;
border: 32px solid;
border-color: #666 transparent transparent transparent;
}
.tri-right.right-top:after{
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: -20px;
top: 0px;
bottom: auto;
border: 20px solid;
border-color: lightyellow transparent transparent transparent;
}
/* talk bubble contents */
.talktext{
padding: 1em;
text-align: left;
line-height: 1.5em;
word-wrap: break-word;
}
.talktext p{
/* remove webkit p margins */
-webkit-margin-before: 0em;
-webkit-margin-after: 0em;
}
.drop-files {
border: 1px solid #000;
color: #000;
}
.wrapwords{
-ms-word-break: break-all;