Private
Public Access
1
0

gdpr-optin

This commit is contained in:
Sander Roosendaal
2018-10-10 13:59:53 +02:00
parent 830af9aa3a
commit 401fc7c82a
8 changed files with 145 additions and 128 deletions

View File

@@ -181,7 +181,7 @@ def interactive_boxchart(datadf,fieldname,extratitle=''):
tools=TOOLS, tools=TOOLS,
toolbar_location="above", toolbar_location="above",
toolbar_sticky=False, toolbar_sticky=False,
x_mapper_type='datetime') x_mapper_type='datetime',plot_width=920)
yrange1 = Range1d(start=yaxminima[fieldname],end=yaxmaxima[fieldname]) yrange1 = Range1d(start=yaxminima[fieldname],end=yaxmaxima[fieldname])
plot.y_range = yrange1 plot.y_range = yrange1
@@ -2365,7 +2365,7 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
plot = Figure(x_axis_type=x_axis_type,y_axis_type=y_axis_type, plot = Figure(x_axis_type=x_axis_type,y_axis_type=y_axis_type,
tools=TOOLS, tools=TOOLS,
toolbar_location="above", toolbar_location="above",
toolbar_sticky=False) #,plot_width=500,plot_height=500) toolbar_sticky=False,plot_width=920)
# add watermark # add watermark
plot.extra_y_ranges = {"watermark": watermarkrange} plot.extra_y_ranges = {"watermark": watermarkrange}

View File

@@ -1,53 +1,52 @@
{% extends "base.html" %} {% extends "newbase.html" %}
{% load staticfiles %} {% load staticfiles %}
{% load rowerfilters %} {% load rowerfilters %}
{% block title %}GDPR Opt-In{% endblock %} {% block title %}GDPR Opt-In{% endblock %}
{% block content %} {% block main %}
<div class="grid_12"> <h2>GDPR Opt-In</h2>
<h2>GDPR Opt-In</h2> <p>
<p> <b>
<b> To comply with the European Union General Data Protection Regulation,
To comply with the European Union General Data Protection Regulation, we need to record your consent to use personal data on this website.
we need to record your consent to use personal data on this website. Please take some time to review our data policies. If you agree and
Please take some time to review our data policies. If you agree and opt in, click the green button at the bottom to be taken to the site.
opt in, click the green button at the bottom to be taken to the site. If you do not agree, please use the red button to delete your
If you do not agree, please use the red button to delete your account. This will irreversibly delete all your data on rowsandall.com
account. This will irreversibly delete all your data on rowsandall.com and remove your account.
and remove your account. </b>
</b> </p>
</p> <hr>
<hr>
{% include "privacypolicy.html" %} {% include "privacypolicy.html" %}
<hr> <hr>
<p> <p>
To start or continue using the site, please give your consent by clicking on the green Opt In button below. To start or continue using the site, please give your consent by clicking on the green Opt In button below.
</p> </p>
<p> <p>
<div class="grid_2 suffix_10 alpha"> <a class="button gray small" href="/rowers/exportallworkouts">Download your data</a>
<p> </p>
<a class="button gray small" href="/rowers/exportallworkouts">Download your data</a>
</p> <p>
</div> <a class="button gray small" href="/rowers/me/gdpr-optin-confirm/?next={{ next }}">Opt in and continue</a>
</p> </p>
<div class="grid_2 alpha"> <p>
<a href="/rowers/me/gdpr-optin-confirm/?next={{ next }}" class="button green small">Opt in and continue</a>
</div>
<form method="POST" action="/rowers/me/delete" class="padding"> <form method="POST" action="/rowers/me/delete" class="padding">
{% csrf_token %} {% csrf_token %}
<input id="id_delete_user" type="hidden" name="delete_user" value="True"> <input id="id_delete_user" type="hidden" name="delete_user" value="True">
<div class="grid_2 prefix_2"> <input class="button red small" type="submit" name="action" value="DELETE ACCOUNT">
<input class="button red small" type="submit" name="action" value="DELETE ACCOUNT">
</div>
</form> </form>
</p>
</div>
{% endblock %} {% endblock %}
{% block sidebar %}
{% include 'menu_profile.html' %}
{% endblock %}

View File

@@ -1,10 +1,10 @@
{% extends "base.html" %} {% extends "newbase.html" %}
{% load staticfiles %} {% load staticfiles %}
{% load rowerfilters %} {% load rowerfilters %}
{% block title %}View Comparison {% endblock %} {% block title %}View Comparison {% endblock %}
{% block content %} {% block main %}
<script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script> <script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script>
<script async="true" type="text/javascript"> <script async="true" type="text/javascript">
@@ -15,58 +15,37 @@
</div> </div>
<script>
// Set things up to resize the plot on a window resize. You can play with
// the arguments of resize_width_height() to change the plot's behavior.
var plot_resize_setup = function () {
var plotid = Object.keys(Bokeh.index)[0]; // assume we have just one plot
var plot = Bokeh.index[plotid];
var plotresizer = function() {
// arguments: use width, use height, maintain aspect ratio
plot.resize_width_height(true, false, false);
};
window.addEventListener('resize', plotresizer);
plotresizer();
};
window.addEventListener('load', plot_resize_setup);
</script>
<style>
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
html, body {height: 100%; margin:5px;}
</style>
<div class="grid_12 alpha"> <h1>Trend Flex Chart</h1>
<h1>Trend Flex Chart</h1>
<div id="workouts" class="grid_8 alpha"> <ul class="main-content">
<li class="grid_4">
<div id="id_chart" class="grid_8 alpha flexplot"> <div id="id_chart" class="grid_8 alpha flexplot">
{{ the_div|safe }} {{ the_div|safe }}
</div> </div>
</div> </li>
<div class="grid_4 omega"> <li class="grid_2">
<div class="grid_4"> <form enctype="multipart/form-data" action="/rowers/user-multiflex/user/{{ userid }}" method="post">
<form enctype="multipart/form-data" action="/rowers/user-multiflex/{{ userid }}" method="post">
{% csrf_token %} {% csrf_token %}
<table> <table>
{{ chartform.as_table }} {{ chartform.as_table }}
</table> </table>
<div class="grid_1 prefix_2 suffix_1"> <p>
<p> <input name='workoutselectform' class="button green" type="submit" value="Submit">
<input name='workoutselectform' class="button green" type="submit" value="Submit"> </p>
</p>
</div>
</form> </form>
</div> </li>
<div class="grid_4"> <li class="grid_2">
<p> <p>
You can use the form above to change the metric or filter the data. You can use the form to change the metric or filter the data.
Set Min SPM and Max SPM to select only strokes in a certain range of Set Min SPM and Max SPM to select only strokes in a certain range of
stroke rates. stroke rates.
Set Work per Stroke to a minimum value to remove "paddle" strokes or turns. Set Work per Stroke to a minimum value to remove "paddle" strokes or turns.
</p> </p>
</div> </li>
</div> </ul>
</div>
{% endblock %} {% endblock %}
@@ -93,3 +72,7 @@
</script> </script>
{% endblock %} {% endblock %}
{% block sidebar %}
{% include 'menu_analytics.html' %}
{% endblock %}

View File

@@ -28,7 +28,9 @@
hidden.hide(); hidden.hide();
if (modality.val() == 'water') {
hidden.show();
}
// Setup an event listener for when the state of the // Setup an event listener for when the state of the
// checkbox changes. // checkbox changes.
@@ -70,8 +72,14 @@
{% endif %} {% endif %}
<ul class="main-content"> <ul class="main-content">
<li class="grid_4">
<p>You can use the date and search forms to search through all
workouts from this team.</p>
<p>TIP: Agree with your team members to put tags (e.g. '8x500m') in the notes section of
your workouts. That makes it easy to search.</p>
</li>
<li class="grid_2 maxheight"> <li class="grid_2 maxheight">
<form enctype="multipart/form-data" action="/rowers/user-multiflex/{{ theuser.id }}" method="post"> <form enctype="multipart/form-data" action="/rowers/user-multiflex/user/{{ theuser.id }}" method="post">
{% if workouts %} {% if workouts %}
<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/> <input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>
@@ -102,16 +110,6 @@
<table> <table>
{{ dateform.as_table }} {{ dateform.as_table }}
</table> </table>
{% csrf_token %}
<input name='daterange' class="button green" type="submit" value="Submit">
</form>
</li>
<li class="grid_2">
{% if theuser %}
<form enctype="multipart/form-data" action="/rowers/user-multiflex-select/user/{{ theuser.id }}/" method="post">
{% else %}
<form enctype="multipart/form-data" action="/rowers/user-multiflex-select/" method="post">
{% endif %}
<table> <table>
{{ modalityform.as_table }} {{ modalityform.as_table }}
</table> </table>
@@ -129,12 +127,6 @@
</form> </form>
</li> </li>
<li class="grid_2">
<p>You can use the date and search forms above to search through all
workouts from this team.</p>
<p>TIP: Agree with your team members to put tags (e.g. '8x500m') in the notes section of
your workouts. That makes it easy to search.</p>
</li>
</ul> </ul>

View File

@@ -1,11 +1,10 @@
{% extends "base.html" %} {% extends "newbase.html" %}
{% load staticfiles %} {% load staticfiles %}
{% load rowerfilters %} {% load rowerfilters %}
{% block title %}Deactivate your account{% endblock %} {% block title %}Deactivate your account{% endblock %}
{% block content %} {% block main %}
<div class="grid_12">
<h2>Deactivate your account</h2> <h2>Deactivate your account</h2>
<hr> <hr>
<p>Account deactivation is reversible. After you logout, you will not be <p>Account deactivation is reversible. After you logout, you will not be
@@ -17,6 +16,10 @@
<button class="btn btn-primary" type="submit" name="action">Confirm</button> <button class="btn btn-primary" type="submit" name="action">Confirm</button>
</form> </form>
</div>
{% endblock %}
{% block sidebar %}
{% include 'menu_profile.html' %}
{% endblock %} {% endblock %}

View File

@@ -1,12 +1,11 @@
{% extends "base.html" %} {% extends "newbase.html" %}
{% load staticfiles %} {% load staticfiles %}
{% load rowerfilters %} {% load rowerfilters %}
{% block title %}Delete your account{% endblock %} {% block title %}Delete your account{% endblock %}
{% block content %} {% block main %}
<div class="grid_12"> <h1>Delete your account</h1>
<h2>Delete your account</h2>
<hr> <hr>
<p><b>Warning: This will remove your account and all your data. <p><b>Warning: This will remove your account and all your data.
You will not be able to recover from this action. We cannot restore You will not be able to recover from this action. We cannot restore
@@ -17,6 +16,9 @@
<button class="btn btn-primary" type="submit" name="action">Confirm</button> <button class="btn btn-primary" type="submit" name="action">Confirm</button>
</form> </form>
</div>
{% endblock %} {% endblock %}
{% block sidebar %}
{% include 'menu_profile.html' %}
{% endblock %}

View File

@@ -329,9 +329,8 @@ urlpatterns = [
url(r'^user-boxplot/user/(?P<userid>\d+)$',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$',views.boxplot_view),
url(r'^user-boxplot-data$',views.boxplot_view_data), url(r'^user-boxplot-data$',views.boxplot_view_data),
url(r'^user-multiflex/(?P<userid>\d+)$',views.multiflex_view), url(r'^user-multiflex/user/(?P<userid>\d+)$',views.multiflex_view),
url(r'^user-multiflex/$',views.multiflex_view), url(r'^user-multiflex/$',views.multiflex_view),
url(r'^user-multiflex$',views.multiflex_view),
url(r'^user-multiflex-data$',views.multiflex_data), url(r'^user-multiflex-data$',views.multiflex_data),
url(r'^me/deactivate$',views.deactivate_user), url(r'^me/deactivate$',views.deactivate_user),
url(r'^me/delete$',views.remove_user), url(r'^me/delete$',views.remove_user),

View File

@@ -5437,17 +5437,14 @@ def user_multiflex_select(request,
except: except:
ploterrorbars = False ploterrorbars = False
if 'startdate' in request.session:
startdate = iso8601.parse_date(request.session['startdate'])
# if 'startdate' in request.session:
# startdate = iso8601.parse_date(request.session['startdate'])
# if 'enddate' in request.session: if 'enddate' in request.session:
# enddate = iso8601.parse_date(request.session['enddate']) enddate = iso8601.parse_date(request.session['enddate'])
if 'waterboattype' in request.session:
waterboattype = request.session['waterboattype'] waterboattype = request.session['waterboattype']
else: else:
waterboattype = types.waterboattype waterboattype = types.waterboattype
@@ -5468,7 +5465,7 @@ def user_multiflex_select(request,
modalities = [m[0] for m in types.workouttypes] modalities = [m[0] for m in types.workouttypes]
modality = 'all' modality = 'all'
if request.method == 'POST' and 'daterange' in request.POST: if request.method == 'POST':
dateform = DateRangeForm(request.POST) dateform = DateRangeForm(request.POST)
if dateform.is_valid(): if dateform.is_valid():
startdate = dateform.cleaned_data['startdate'] startdate = dateform.cleaned_data['startdate']
@@ -5477,13 +5474,6 @@ def user_multiflex_select(request,
enddatestring = enddate.strftime('%Y-%m-%d') enddatestring = enddate.strftime('%Y-%m-%d')
request.session['startdate'] = startdatestring request.session['startdate'] = startdatestring
request.session['enddate'] = enddatestring request.session['enddate'] = enddatestring
else:
dateform = DateRangeForm(initial={
'startdate':startdate,
'enddate':enddate,
})
if request.method == 'POST' and 'modality' in request.POST:
modalityform = TrendFlexModalForm(request.POST) modalityform = TrendFlexModalForm(request.POST)
if modalityform.is_valid(): if modalityform.is_valid():
modality = modalityform.cleaned_data['modality'] modality = modalityform.cleaned_data['modality']
@@ -5501,6 +5491,12 @@ def user_multiflex_select(request,
request.session['modalities'] = modalities request.session['modalities'] = modalities
request.session['waterboattype'] = waterboattype request.session['waterboattype'] = waterboattype
request.session['rankingonly'] = rankingonly request.session['rankingonly'] = rankingonly
else:
dateform = DateRangeForm(initial={
'startdate':startdate,
'enddate':enddate,
})
startdate = datetime.datetime.combine(startdate,datetime.time()) startdate = datetime.datetime.combine(startdate,datetime.time())
enddate = datetime.datetime.combine(enddate,datetime.time(23,59,59)) enddate = datetime.datetime.combine(enddate,datetime.time(23,59,59))
@@ -5577,9 +5573,25 @@ def user_multiflex_select(request,
request.session['modalities'] = modalities request.session['modalities'] = modalities
breadcrumbs = [
{
'url':'/rowers/analysis',
'name':'Analysis'
},
{
'url':reverse(user_multiflex_select,kwargs={'userid':userid}),
'name': 'Compare Select'
},
{
'url':reverse(multi_compare_view),
'name': 'Comparison Chart'
}
]
return render(request, 'user_multiflex_select.html', return render(request, 'user_multiflex_select.html',
{'workouts': workouts, {'workouts': workouts,
'dateform':dateform, 'dateform':dateform,
'breadcrumbs':breadcrumbs,
'startdate':startdate, 'startdate':startdate,
'enddate':enddate, 'enddate':enddate,
'theuser':user, 'theuser':user,
@@ -5846,6 +5858,13 @@ def multiflex_view(request,userid=0,
except KeyError: except KeyError:
palette = 'monochrome_blue' palette = 'monochrome_blue'
if 'startdate' in request.session:
startdate = iso8601.parse_date(request.session['startdate'])
if 'enddate' in request.session:
enddate = iso8601.parse_date(request.session['enddate'])
workstrokesonly = not includereststrokes workstrokesonly = not includereststrokes
if userid==0: if userid==0:
@@ -5946,10 +5965,30 @@ def multiflex_view(request,userid=0,
request.session['options'] = options request.session['options'] = options
r = getrequestrower(request,userid=userid)
breadcrumbs = [
{
'url':'/rowers/analysis',
'name':'Analysis'
},
{
'url':reverse(user_multiflex_select,kwargs={'userid':userid}),
'name': 'Trend Flex Select'
},
{
'url':reverse(multiflex_view),
'name': 'Trend Flex Chart'
}
]
return render(request,'multiflex.html', return render(request,'multiflex.html',
{'interactiveplot':'', {'interactiveplot':'',
'active':'nav-analysis',
'rower':r,
'breadcrumbs':breadcrumbs,
'the_div':div, 'the_div':div,
'active':'nav-analysis', 'active':'nav-analysis',
'chartform':chartform, 'chartform':chartform,
@@ -6135,11 +6174,11 @@ def user_boxplot_select(request,
request.session['startdate'] = startdatestring request.session['startdate'] = startdatestring
request.session['enddate'] = enddatestring request.session['enddate'] = enddatestring
r = getrower(request.user)
breadcrumbs = [ breadcrumbs = [
{ {
'url':'/rowers/list-workouts', 'url':'/rowers/analysis',
'name':'Workouts' 'name':'Analysis'
}, },
{ {
'url':reverse(user_boxplot_select,kwargs={'userid':userid}), 'url':reverse(user_boxplot_select,kwargs={'userid':userid}),
@@ -6343,8 +6382,8 @@ def boxplot_view(request,userid=0,
r = getrequestrower(request,userid=userid) r = getrequestrower(request,userid=userid)
breadcrumbs = [ breadcrumbs = [
{ {
'url':'/rowers/list-workouts', 'url':'/rowers/Analysis',
'name':'Workouts' 'name':'Analysis'
}, },
{ {
'url':reverse(user_boxplot_select,kwargs={'userid':userid}), 'url':reverse(user_boxplot_select,kwargs={'userid':userid}),