Merge branch 'release/histo'
This commit is contained in:
@@ -5,6 +5,8 @@ from rowingdata import cumcpdata,histodata
|
|||||||
|
|
||||||
from rowingdata import rowingdata as rrdata
|
from rowingdata import rowingdata as rrdata
|
||||||
|
|
||||||
|
from django.utils import timezone
|
||||||
|
|
||||||
from bokeh.plotting import figure, ColumnDataSource, Figure,curdoc
|
from bokeh.plotting import figure, ColumnDataSource, Figure,curdoc
|
||||||
from bokeh.models import CustomJS,Slider
|
from bokeh.models import CustomJS,Slider
|
||||||
from bokeh.charts import Histogram,HeatMap
|
from bokeh.charts import Histogram,HeatMap
|
||||||
@@ -570,7 +572,6 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
|
|
||||||
datadf = dataprep.smalldataprep(theworkouts,xparam,yparam1,yparam2)
|
datadf = dataprep.smalldataprep(theworkouts,xparam,yparam1,yparam2)
|
||||||
|
|
||||||
|
|
||||||
axlabels = {
|
axlabels = {
|
||||||
'time': 'Time',
|
'time': 'Time',
|
||||||
'distance': 'Distance (m)',
|
'distance': 'Distance (m)',
|
||||||
@@ -631,11 +632,16 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
return ['','<p>No non-zero data in selection</p>','','']
|
return ['','<p>No non-zero data in selection</p>','','']
|
||||||
|
|
||||||
|
|
||||||
datadf['x1'] = datadf.ix[:,xparam]
|
# datadf['x1'] = datadf.ix[:,xparam]
|
||||||
|
datadf = datadf.rename(columns={
|
||||||
datadf['y1'] = datadf.ix[:,yparam1]
|
xparam:'x1',
|
||||||
|
yparam1:'y1',
|
||||||
|
})
|
||||||
|
|
||||||
|
# datadf['y1'] = datadf.ix[:,yparam1]
|
||||||
if yparam2 != 'None':
|
if yparam2 != 'None':
|
||||||
datadf['y2'] = datadf.ix[:,yparam2]
|
# datadf['y2'] = datadf.ix[:,yparam2]
|
||||||
|
datadf = datadf.rename(columns={yparam2:'y2'})
|
||||||
else:
|
else:
|
||||||
datadf['y2'] = datadf['y1']
|
datadf['y2'] = datadf['y1']
|
||||||
|
|
||||||
@@ -674,6 +680,8 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
datadf.copy()
|
datadf.copy()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
print "jet",timezone.now()
|
||||||
|
|
||||||
# Add hover to this comma-separated string and see what changes
|
# Add hover to this comma-separated string and see what changes
|
||||||
if (promember==1):
|
if (promember==1):
|
||||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,resize,crosshair'
|
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,resize,crosshair'
|
||||||
|
|||||||
@@ -7,115 +7,132 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div id="workouts" class="grid_6 alpha">
|
<div id="workouts" class="grid_6 alpha">
|
||||||
|
|
||||||
{% if form.errors %}
|
{% if form.errors %}
|
||||||
<p style="color: red;">
|
<p style="color: red;">
|
||||||
Please correct the error{{ form.errors|pluralize }} below.
|
Please correct the error{{ form.errors|pluralize }} below.
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h1>Advanced Workout Editor</h1>
|
<h1>Advanced Workout Editor</h1>
|
||||||
{% if user.rower.rowerplan == 'basic' %}
|
{% if user.rower.rowerplan == 'basic' %}
|
||||||
<p>This is a preview of the page with advanced functionality for Pro users. See <a href="/rowers/promembership">the page about Pro membership</a> for more information and to sign up for Pro Membership</a>
|
<p>This is a preview of the page with advanced functionality for Pro users.
|
||||||
{% endif %}
|
See
|
||||||
<div class="grid_2 alpha">
|
<a href="/rowers/promembership">the page about Pro membership</a> for more information and to sign up for Pro Membership</a>
|
||||||
<p>
|
{% endif %}
|
||||||
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/edit">Edit Workout</a>
|
<div class="grid_2 alpha">
|
||||||
</p>
|
<p>
|
||||||
</div>
|
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/edit">Edit Workout</a>
|
||||||
<div class="grid_2 suffix_2 omega">
|
</p>
|
||||||
<p>
|
</div>
|
||||||
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/export">Export</a>
|
<div class="grid_2 suffix_2 omega">
|
||||||
</p>
|
<p>
|
||||||
|
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/export">Export</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="grid_6 alpha">
|
<div class="grid_6 alpha">
|
||||||
|
|
||||||
<table width=100%>
|
<table width=100%>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Date:</th><td>{{ workout.date }}</td>
|
<th>Date:</th><td>{{ workout.date }}</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<th>Time:</th><td>{{ workout.starttime }}</td>
|
<th>Time:</th><td>{{ workout.starttime }}</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<th>Distance:</th><td>{{ workout.distance }}m</td>
|
<th>Distance:</th><td>{{ workout.distance }}m</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<th>Duration:</th><td>{{ workout.duration |durationprint:"%H:%M:%S.%f" }}</td>
|
<th>Duration:</th><td>{{ workout.duration |durationprint:"%H:%M:%S.%f" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<th>Public link to this workout</th>
|
<th>Public link to this workout</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="/rowers/workout/{{ workout.id }}">http://rowsandall.com/rowers/workout/{{ workout.id }}</a>
|
<a href="/rowers/workout/{{ workout.id }}">https://rowsandall.com/rowers/workout/{{ workout.id }}</a>
|
||||||
<td>
|
<td>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid_6 alpha">
|
<div class="grid_6 alpha">
|
||||||
<div class="grid_2 alpha">
|
<div class="grid_2 alpha">
|
||||||
{% if user.rower.rowerplan == 'pro' %}
|
{% if user.rower.rowerplan == 'pro' %}
|
||||||
<a class="button blue small" href="/rowers/workout/compare/{{ workout.id }}">Compare Workouts</a>
|
<a class="button blue small" href="/rowers/workout/compare/{{ workout.id }}">Compare Workouts</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="button blue small" href="/rowers/promembership/">Compare Workouts</a>
|
<a class="button blue small" href="/rowers/promembership/">Compare Workouts</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p>
|
<p>
|
||||||
Compare this workout to other workouts. Plot HR, SPM, or pace vs time or distance for the two workouts.
|
Compare this workout to other workouts. Plot HR, SPM, or pace vs time or distance for the two workouts.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid_2">
|
<div class="grid_2">
|
||||||
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/flexchart">
|
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/flexchart">
|
||||||
Flexible Interactive Plot
|
Flexible Interactive Plot
|
||||||
</a>
|
</a>
|
||||||
<p>
|
<p>
|
||||||
Flexible Interactive plot. Pick your own X and Y axis parameters.
|
Flexible Interactive plot. Pick your own X and Y axis parameters.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid_2 omega tooltip">
|
<div class="grid_2 omega tooltip">
|
||||||
<p>
|
<p>
|
||||||
{% if user.rower.rowerplan == 'pro' %}
|
{% if user.rower.rowerplan == 'pro' %}
|
||||||
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/editintervals">Edit Intervals</a>
|
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/editintervals">Edit Intervals</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="button blue small" href="/rowers/promembership">Edit Intervals</a>
|
<a class="button blue small" href="/rowers/promembership">Edit Intervals</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
<span class="tooltiptext">Enter or change the interval and summary data for your workout</span>
|
<span class="tooltiptext">Enter or change the interval and summary data for your workout</span>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Enter or change the interval and summary data for your workout
|
Enter or change the interval and summary data for your workout
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid_6 alpha">
|
<div class="grid_6 alpha">
|
||||||
|
|
||||||
<div class="grid_2 alpha">
|
<div class="grid_2 alpha">
|
||||||
<p>
|
<p>
|
||||||
{% if user.rower.rowerplan == 'pro' %}
|
{% if user.rower.rowerplan == 'pro' %}
|
||||||
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/adddistanceplot2">Dist Metrics Plot</a>
|
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/adddistanceplot2">Dist Metrics Plot</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="button blue small" href="/rowers/promembership">Dist Metrics Plot</a>
|
<a class="button blue small" href="/rowers/promembership">Dist Metrics Plot</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Various advanced stroke metrics plotted versus distance.
|
Various advanced stroke metrics plotted versus distance.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid_2">
|
<div class="grid_2">
|
||||||
<p>
|
<p>
|
||||||
{% if user.rower.rowerplan == 'pro' %}
|
{% if user.rower.rowerplan == 'pro' %}
|
||||||
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/addtimeplot2">Time Metrics Plot</a>
|
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/addtimeplot2">Time Metrics Plot</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="button blue small" href="/rowers/promembership">Time Metrics Plot</a>
|
<a class="button blue small" href="/rowers/promembership">Time Metrics Plot</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Various advanced stroke metrics plotted versus time.
|
Various advanced stroke metrics plotted versus time.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid_2 omega">
|
<div class="grid_2 omega">
|
||||||
<p>
|
<p>
|
||||||
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/interactiveplot">Big Interactive Plot</a>
|
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/interactiveplot">Big Interactive Plot</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
See (and save) the big interactive plot
|
See (and save) the big interactive plot
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="grid_6 alpha">
|
||||||
|
|
||||||
|
<div class="grid_2 suffix_4 alpha">
|
||||||
|
<p>
|
||||||
|
{% if user.rower.rowerplan == 'pro' %}
|
||||||
|
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/histo">Power Histogram</a>
|
||||||
|
{% else %}
|
||||||
|
<a class="button blue small" href="/rowers/promembership">Dist Metrics Plot</a>
|
||||||
|
{% endif %}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Plot the Power Histogram of this workout
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -155,4 +172,4 @@ Enter or change the interval and summary data for your workout
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<th>Public link to this workout</th>
|
<th>Public link to this workout</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="/rowers/workout/{{ workout.id }}">http://rowsandall.com/rowers/workout/{{ workout.id }}</a>
|
<a href="/rowers/workout/{{ workout.id }}">https://rowsandall.com/rowers/workout/{{ workout.id }}</a>
|
||||||
<td>
|
<td>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div id="workouts" class="grid_4 alpha">
|
<div id="workouts" class="grid_4 alpha">
|
||||||
|
<div class="grid_4 alpha">
|
||||||
|
|
||||||
<h1>Workout {{ id }}</h1>
|
<h1>Workout {{ id }}</h1>
|
||||||
<table width=100%>
|
<table width=100%>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -30,6 +29,35 @@
|
|||||||
<th>Weight Category:</th><td>{{ workout.weightcategory }}</td>
|
<th>Weight Category:</th><td>{{ workout.weightcategory }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="grid_4 alpha">
|
||||||
|
<p>
|
||||||
|
<form id="searchform" action=""
|
||||||
|
method="get" accept-charset="utf-8">
|
||||||
|
<button class="button blue small" type="submit">
|
||||||
|
Search
|
||||||
|
</button>
|
||||||
|
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||||
|
</form>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
Select start and end date for a date range:
|
||||||
|
<div class="grid_4 alpha">
|
||||||
|
<p>
|
||||||
|
<form enctype="multipart/form-data" action="/rowers/workout/compare/{{ id }}/" method="post">
|
||||||
|
|
||||||
|
<table>
|
||||||
|
{{ dateform.as_table }}
|
||||||
|
</table>
|
||||||
|
{% csrf_token %}
|
||||||
|
</div>
|
||||||
|
<div class="grid_2 suffix_2 omega">
|
||||||
|
<input name='daterange' class="button green" type="submit" value="Submit"> </form>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="comparison" class="grid_8 omega">
|
<div id="comparison" class="grid_8 omega">
|
||||||
@@ -73,5 +101,21 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<p> No workouts found </p>
|
<p> No workouts found </p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<div class="grid_2 prefix_5 suffix_1 omega">
|
||||||
|
<span class="button gray small">
|
||||||
|
{% if workouts.has_previous %}
|
||||||
|
<a class="wh" href="/rowers/workout/compare/{{ id }}/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}?page={{ workouts.previous_page_number }}"><</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<span>
|
||||||
|
Page {{ workouts.number }} of {{ workouts.paginator.num_pages }}.
|
||||||
|
</span>
|
||||||
|
|
||||||
|
{% if workouts.has_next %}
|
||||||
|
<a class="wh" href="/rowers/workout/compare/{{ id }}/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}?page={{ workouts.next_page_number }}">></a>
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
between {{ startdate|date }} and {{ enddate|date }}</p>
|
between {{ startdate|date }} and {{ enddate|date }}</p>
|
||||||
|
|
||||||
<p>Direct link for other Pro users:
|
<p>Direct link for other Pro users:
|
||||||
<a href="/rowers/{{ id }}/histo/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">http://rowsandall.com/rowers/{{ id }}/histo/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}</a>
|
<a href="/rowers/{{ id }}/histo/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">https://rowsandall.com/rowers/{{ id }}/histo/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="form" class="grid_6 omega">
|
<div id="form" class="grid_6 omega">
|
||||||
@@ -82,4 +82,4 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
66
rowers/templates/histo_single.html
Normal file
66
rowers/templates/histo_single.html
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
{% load staticfiles %}
|
||||||
|
{% load rowerfilters %}
|
||||||
|
|
||||||
|
{% block title %}View Workout {% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
{{ interactiveplot |safe }}
|
||||||
|
|
||||||
|
<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 id="navigation" class="grid_12 alpha">
|
||||||
|
{% 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_8 omega">
|
||||||
|
<p>
|
||||||
|
<a class="button gray small" href="/rowers/workout/{{ id }}/advanced">Advanced Edit</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="title" class="grid_12 alpha">
|
||||||
|
<h1>Indoor Rower Power Histogram</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="graph" class="grid_12 alpha">
|
||||||
|
|
||||||
|
{{ the_div|safe }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<p>Summary of the past 12 months for {{ theuser.first_name }} {{ theuser.last_name }}</p>
|
<p>Summary of the past 12 months for {{ theuser.first_name }} {{ theuser.last_name }}</p>
|
||||||
|
|
||||||
<p>Direct link for other Pro users:
|
<p>Direct link for other Pro users:
|
||||||
<a href="/rowers/{{ id }}/histo-all">http://rowsandall.com/rowers/{{ id }}/histo-all</a>
|
<a href="/rowers/{{ id }}/histo-all">https://rowsandall.com/rowers/{{ id }}/histo-all</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="grid_12 alpha">
|
<div class="grid_12 alpha">
|
||||||
|
|||||||
@@ -6,6 +6,14 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Recent Graphs</h1>
|
<h1>Recent Graphs</h1>
|
||||||
|
|
||||||
|
<form id="searchform" action="."
|
||||||
|
method="get" accept-charset="utf-8">
|
||||||
|
<button class="button blue small" type="submit">
|
||||||
|
Search
|
||||||
|
</button>
|
||||||
|
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||||
|
</form>
|
||||||
{% if graphs1 %}
|
{% if graphs1 %}
|
||||||
<div class="grid_1 alpha">
|
<div class="grid_1 alpha">
|
||||||
<p> </p>
|
<p> </p>
|
||||||
|
|||||||
@@ -5,8 +5,27 @@
|
|||||||
{% block title %}Workouts{% endblock %}
|
{% block title %}Workouts{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<div class="grid_12">
|
||||||
|
|
||||||
|
Select start and end date for a date range:
|
||||||
|
<div class="grid_4 alpha">
|
||||||
|
|
||||||
|
<form enctype="multipart/form-data" action="/rowers/list-workouts/" method="post">
|
||||||
|
|
||||||
|
<table>
|
||||||
|
{{ dateform.as_table }}
|
||||||
|
</table>
|
||||||
|
{% csrf_token %}
|
||||||
|
</div>
|
||||||
|
<div class="grid_2 suffix_6 omega">
|
||||||
|
<input name='daterange' class="button green" type="submit" value="Submit"> </form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<h1>My Workouts</h1>
|
<h1>My Workouts</h1>
|
||||||
{% if workouts %}
|
|
||||||
|
{% if workouts %}
|
||||||
<table width="70%" class="listtable">
|
<table width="70%" class="listtable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -49,4 +68,35 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<p> No workouts found </p>
|
<p> No workouts found </p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="grid_6 alpha">
|
||||||
|
<form id="searchform" action="/rowers/list-workouts/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}"
|
||||||
|
method="get" accept-charset="utf-8">
|
||||||
|
<div class="grid_3 prefix_1 alpha">
|
||||||
|
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
|
||||||
|
</div>
|
||||||
|
<div class="grid_1 suffix_1 omega">
|
||||||
|
<button class="button blue small" type="submit">
|
||||||
|
Search
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="grid_2 prefix_3 omega">
|
||||||
|
<span class="button gray small">
|
||||||
|
{% if workouts.has_previous %}
|
||||||
|
<a class="wh" href="?page={{ workouts.previous_page_number }}"><</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<span>
|
||||||
|
Page {{ workouts.number }} of {{ workouts.paginator.num_pages }}.
|
||||||
|
</span>
|
||||||
|
|
||||||
|
{% if workouts.has_next %}
|
||||||
|
<a class="wh" href="?page={{ workouts.next_page_number }}">></a>
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<th>Public link to this workout</th>
|
<th>Public link to this workout</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="/rowers/workout/{{ workout.id }}">http://rowsandall.com/rowers/workout/{{ workout.id }}</a>
|
<a href="/rowers/workout/{{ workout.id }}">https://rowsandall.com/rowers/workout/{{ workout.id }}</a>
|
||||||
<td>
|
<td>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
between {{ startdate|date }} and {{ enddate|date }}</p>
|
between {{ startdate|date }} and {{ enddate|date }}</p>
|
||||||
|
|
||||||
<p>Direct link for other users:
|
<p>Direct link for other users:
|
||||||
<a href="/rowers/{{ id }}/ote-bests/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">http://rowsandall.com/rowers/{{ id }}/ote-bests/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}</a>
|
<a href="/rowers/{{ id }}/ote-bests/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">https://rowsandall.com/rowers/{{ id }}/ote-bests/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>The table gives the best efforts achieved on the official Concept2 ranking pieces in the selected date range.</p>
|
<p>The table gives the best efforts achieved on the official Concept2 ranking pieces in the selected date range.</p>
|
||||||
|
|||||||
@@ -48,12 +48,12 @@
|
|||||||
</tr><tr>
|
</tr><tr>
|
||||||
<th>Public link to this workout</th>
|
<th>Public link to this workout</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="/rowers/workout/{{ workout.id }}">http://rowsandall.com/rowers/workout/{{ workout.id }}</a>
|
<a href="/rowers/workout/{{ workout.id }}">https://rowsandall.com/rowers/workout/{{ workout.id }}</a>
|
||||||
<td>
|
<td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<th>Public link to interactive chart</th>
|
<th>Public link to interactive chart</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="/rowers/workout/{{ workout.id }}/interactiveplot">http://rowsandall.com/rowers/workout/{{ workout.id }}/interactiveplot</a>
|
<a href="/rowers/workout/{{ workout.id }}/interactiveplot">https://rowsandall.com/rowers/workout/{{ workout.id }}/interactiveplot</a>
|
||||||
<td>
|
<td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -48,12 +48,12 @@
|
|||||||
</tr><tr>
|
</tr><tr>
|
||||||
<th>Public link to this workout</th>
|
<th>Public link to this workout</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="/rowers/workout/{{ workout.id }}">http://rowsandall.com/rowers/workout/{{ workout.id }}</a>
|
<a href="/rowers/workout/{{ workout.id }}">https://rowsandall.com/rowers/workout/{{ workout.id }}</a>
|
||||||
<td>
|
<td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<th>Public link to interactive chart</th>
|
<th>Public link to interactive chart</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="/rowers/workout/{{ workout.id }}/interactiveplot">http://rowsandall.com/rowers/workout/{{ workout.id }}/interactiveplot</a>
|
<a href="/rowers/workout/{{ workout.id }}/interactiveplot">https://rowsandall.com/rowers/workout/{{ workout.id }}/interactiveplot</a>
|
||||||
<td>
|
<td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -425,6 +425,9 @@ class ViewTest(TestCase):
|
|||||||
response = self.c.get('/rowers/workout/1/interactiveplot', form_data, follow=True)
|
response = self.c.get('/rowers/workout/1/interactiveplot', form_data, follow=True)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
response = self.c.get('/rowers/workout/1/histo', form_data, follow=True)
|
||||||
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
w = Workout.objects.get(id=1)
|
w = Workout.objects.get(id=1)
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ urlpatterns = [
|
|||||||
url(r'^list-workouts/c/(?P<message>\w+.*)/$',views.workouts_view),
|
url(r'^list-workouts/c/(?P<message>\w+.*)/$',views.workouts_view),
|
||||||
url(r'^list-workouts/s/(?P<successmessage>\w+.*)/$',views.workouts_view),
|
url(r'^list-workouts/s/(?P<successmessage>\w+.*)/$',views.workouts_view),
|
||||||
url(r'^list-workouts/c/(?P<message>\w+.*)/s/(?P<successmessage>\w+.*)$',views.workouts_view),
|
url(r'^list-workouts/c/(?P<message>\w+.*)/s/(?P<successmessage>\w+.*)$',views.workouts_view),
|
||||||
|
url(r'^list-workouts/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.workouts_view),
|
||||||
url(r'^list-workouts/$',views.workouts_view),
|
url(r'^list-workouts/$',views.workouts_view),
|
||||||
url(r'^list-graphs/$',views.graphs_view),
|
url(r'^list-graphs/$',views.graphs_view),
|
||||||
url(r'^dashboard/c/(?P<message>\w+.*)/$',views.dashboard_view),
|
url(r'^dashboard/c/(?P<message>\w+.*)/$',views.dashboard_view),
|
||||||
@@ -55,6 +56,7 @@ urlpatterns = [
|
|||||||
url(r'^graph/(\d+)/delete$',views.graph_delete_view),
|
url(r'^graph/(\d+)/delete$',views.graph_delete_view),
|
||||||
url(r'^workout/upload/$',views.workout_upload_view),
|
url(r'^workout/upload/$',views.workout_upload_view),
|
||||||
url(r'^workout/upload/(.+.*)$',views.workout_upload_view),
|
url(r'^workout/upload/(.+.*)$',views.workout_upload_view),
|
||||||
|
url(r'^workout/(?P<id>\d+)/histo$',views.workout_histo_view),
|
||||||
url(r'^workout/(?P<id>\d+)/export/c/(?P<message>\w+.*)/s/(?P<successmessage>\w+.*)$',views.workout_export_view),
|
url(r'^workout/(?P<id>\d+)/export/c/(?P<message>\w+.*)/s/(?P<successmessage>\w+.*)$',views.workout_export_view),
|
||||||
url(r'^workout/(?P<id>\d+)/export/c/(?P<message>\w+.*)$',views.workout_export_view),
|
url(r'^workout/(?P<id>\d+)/export/c/(?P<message>\w+.*)$',views.workout_export_view),
|
||||||
url(r'^workout/(?P<id>\d+)/export/s/(?P<successmessage>\w+.*)$',views.workout_export_view),
|
url(r'^workout/(?P<id>\d+)/export/s/(?P<successmessage>\w+.*)$',views.workout_export_view),
|
||||||
@@ -63,6 +65,7 @@ urlpatterns = [
|
|||||||
url(r'^workout/(\d+)/emailcsv$',views.workout_csvemail_view),
|
url(r'^workout/(\d+)/emailcsv$',views.workout_csvemail_view),
|
||||||
url(r'^workout/compare/(\d+)/$',views.workout_comparison_list),
|
url(r'^workout/compare/(\d+)/$',views.workout_comparison_list),
|
||||||
url(r'^workout/compare2/(?P<id1>\d+)/(?P<id2>\d+)/(?P<xparam>\w+.*)/(?P<yparam>\w+.*)/$',views.workout_comparison_view),
|
url(r'^workout/compare2/(?P<id1>\d+)/(?P<id2>\d+)/(?P<xparam>\w+.*)/(?P<yparam>\w+.*)/$',views.workout_comparison_view),
|
||||||
|
url(r'^workout/compare/(?P<id>\d+)/(?P<startdatestring>\d+-\d+-\d+)/(?P<enddatestring>\w+.*)$',views.workout_comparison_list),
|
||||||
url(r'^workout/(?P<id>\d+)/export/c/(?P<message>\w+.*)/s/(?P<successmessage>\w+.*)$',views.workout_edit_view),
|
url(r'^workout/(?P<id>\d+)/export/c/(?P<message>\w+.*)/s/(?P<successmessage>\w+.*)$',views.workout_edit_view),
|
||||||
url(r'^workout/(?P<id>\d+)/edit/c/(?P<message>.+.*)$',views.workout_edit_view),
|
url(r'^workout/(?P<id>\d+)/edit/c/(?P<message>.+.*)$',views.workout_edit_view),
|
||||||
url(r'^workout/(?P<id>\d+)/edit/s/(?P<successmessage>.+.*)$',views.workout_edit_view),
|
url(r'^workout/(?P<id>\d+)/edit/s/(?P<successmessage>.+.*)$',views.workout_edit_view),
|
||||||
|
|||||||
164
rowers/views.py
164
rowers/views.py
@@ -1,11 +1,14 @@
|
|||||||
import time
|
import time
|
||||||
|
import operator
|
||||||
from django.views.generic.base import TemplateView
|
from django.views.generic.base import TemplateView
|
||||||
|
from django.db.models import Q
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.http import HttpResponse, HttpResponseRedirect
|
from django.http import HttpResponse, HttpResponseRedirect
|
||||||
from django.contrib.auth import authenticate, login, logout
|
from django.contrib.auth import authenticate, login, logout
|
||||||
from rowers.forms import LoginForm,DocumentsForm,UploadOptionsForm
|
from rowers.forms import LoginForm,DocumentsForm,UploadOptionsForm
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
|
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils.datastructures import MultiValueDictKeyError
|
from django.utils.datastructures import MultiValueDictKeyError
|
||||||
from django.utils import timezone,translation
|
from django.utils import timezone,translation
|
||||||
@@ -1339,6 +1342,36 @@ def cum_flex(request,theuser=0,
|
|||||||
'promember':promember,
|
'promember':promember,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@login_required()
|
||||||
|
def workout_histo_view(request,id=0):
|
||||||
|
row = Workout.objects.get(id=id)
|
||||||
|
promember=0
|
||||||
|
mayedit=0
|
||||||
|
if not request.user.is_anonymous():
|
||||||
|
r = Rower.objects.get(user=request.user)
|
||||||
|
result = request.user.is_authenticated() and r.rowerplan=='pro'
|
||||||
|
if result:
|
||||||
|
promember=1
|
||||||
|
if request.user == row.user.user:
|
||||||
|
mayedit=1
|
||||||
|
|
||||||
|
if not promember:
|
||||||
|
return HttpResponseRedirect("/rowers/about/")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
res = interactive_histoall([row])
|
||||||
|
script = res[0]
|
||||||
|
div = res[1]
|
||||||
|
|
||||||
|
return render(request,
|
||||||
|
'histo_single.html',
|
||||||
|
{'interactiveplot':script,
|
||||||
|
'the_div':div,
|
||||||
|
'id':id,
|
||||||
|
'mayedit':mayedit,
|
||||||
|
})
|
||||||
|
|
||||||
@login_required()
|
@login_required()
|
||||||
def histo(request,theuser=0,
|
def histo(request,theuser=0,
|
||||||
@@ -1569,8 +1602,8 @@ def rankings_view(request,theuser=0,
|
|||||||
for rankingduration in rankingdurations:
|
for rankingduration in rankingdurations:
|
||||||
|
|
||||||
workouts = Workout.objects.filter(user=r,duration=rankingduration,
|
workouts = Workout.objects.filter(user=r,duration=rankingduration,
|
||||||
workouttype='rower',
|
workouttype='rower',
|
||||||
startdatetime__gte=startdate,
|
startdatetime__gte=startdate,
|
||||||
startdatetime__lte=enddate).order_by('-distance')
|
startdatetime__lte=enddate).order_by('-distance')
|
||||||
if workouts:
|
if workouts:
|
||||||
thedistances.append(workouts[0].distance)
|
thedistances.append(workouts[0].distance)
|
||||||
@@ -1764,29 +1797,133 @@ def workout_recalcsummary_view(request,id=0):
|
|||||||
|
|
||||||
|
|
||||||
@login_required()
|
@login_required()
|
||||||
def workouts_view(request,message='',successmessage=''):
|
def workouts_view(request,message='',successmessage='',
|
||||||
|
startdatestring="",enddatestring="",
|
||||||
|
startdate=timezone.now()-datetime.timedelta(days=365),
|
||||||
|
enddate=timezone.now()):
|
||||||
try:
|
try:
|
||||||
r = Rower.objects.get(user=request.user)
|
r = Rower.objects.get(user=request.user)
|
||||||
# res = mailprocessing.safeprocessattachments()
|
# res = mailprocessing.safeprocessattachments()
|
||||||
#if len(res)>0 and np.cumsum(np.array(res)).max()>0:
|
#if len(res)>0 and np.cumsum(np.array(res)).max()>0:
|
||||||
# successmessage = 'New Workouts have been created from email'
|
# successmessage = 'New Workouts have been created from email'
|
||||||
|
|
||||||
workouts = Workout.objects.filter(user=r).order_by("-date", "-starttime")
|
if request.method == 'POST':
|
||||||
|
dateform = DateRangeForm(request.POST)
|
||||||
|
if dateform.is_valid():
|
||||||
|
startdate = dateform.cleaned_data['startdate']
|
||||||
|
enddate = dateform.cleaned_data['enddate']
|
||||||
|
else:
|
||||||
|
dateform = DateRangeForm(initial={
|
||||||
|
'startdate':startdate,
|
||||||
|
'enddate':enddate,
|
||||||
|
})
|
||||||
|
|
||||||
|
startdate = datetime.datetime.combine(startdate,datetime.time())
|
||||||
|
enddate = datetime.datetime.combine(enddate,datetime.time(23,59,59))
|
||||||
|
|
||||||
|
if startdatestring:
|
||||||
|
startdate = iso8601.parse_date(startdatestring)
|
||||||
|
if enddatestring:
|
||||||
|
enddate = iso8601.parse_date(enddatestring)
|
||||||
|
|
||||||
|
if enddate < startdate:
|
||||||
|
s = enddate
|
||||||
|
enddate = startdate
|
||||||
|
startdate = s
|
||||||
|
|
||||||
|
|
||||||
|
workouts = Workout.objects.filter(user=r,
|
||||||
|
startdatetime__gte=startdate,
|
||||||
|
startdatetime__lte=enddate).order_by("-date", "-starttime")
|
||||||
|
|
||||||
|
query = request.GET.get('q')
|
||||||
|
if query:
|
||||||
|
query_list = query.split()
|
||||||
|
workouts = workouts.filter(
|
||||||
|
reduce(operator.and_,
|
||||||
|
(Q(name__icontains=q) for q in query_list)) |
|
||||||
|
reduce(operator.and_,
|
||||||
|
(Q(notes__icontains=q) for q in query_list))
|
||||||
|
)
|
||||||
|
|
||||||
|
paginator = Paginator(workouts,20) # show 25 workouts per page
|
||||||
|
page = request.GET.get('page')
|
||||||
|
|
||||||
|
try:
|
||||||
|
workouts = paginator.page(page)
|
||||||
|
except PageNotAnInteger:
|
||||||
|
workouts = paginator.page(1)
|
||||||
|
except EmptyPage:
|
||||||
|
workouts = paginator.page(paginator.num_pages)
|
||||||
|
|
||||||
return render(request, 'list_workouts.html',
|
return render(request, 'list_workouts.html',
|
||||||
{'workouts': workouts,
|
{'workouts': workouts,
|
||||||
'message': message,
|
'message': message,
|
||||||
'successmessage':successmessage,
|
'successmessage':successmessage,
|
||||||
|
'dateform':dateform,
|
||||||
|
'startdate':startdate,
|
||||||
|
'enddate':enddate,
|
||||||
})
|
})
|
||||||
except Rower.DoesNotExist:
|
except Rower.DoesNotExist:
|
||||||
return HttpResponse("Admin has no rower instance")
|
return HttpResponse("Admin has no rower instance")
|
||||||
|
|
||||||
@user_passes_test(promember,login_url="/login")
|
@user_passes_test(promember,login_url="/login")
|
||||||
def workout_comparison_list(request,id=0,message='',successmessage=''):
|
def workout_comparison_list(request,id=0,message='',successmessage='',
|
||||||
|
startdatestring="",enddatestring="",
|
||||||
|
startdate=timezone.now()-datetime.timedelta(days=365),
|
||||||
|
enddate=timezone.now()):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
r = Rower.objects.get(user=request.user)
|
r = Rower.objects.get(user=request.user)
|
||||||
u = User.objects.get(id=r.user.id)
|
u = User.objects.get(id=r.user.id)
|
||||||
workouts = Workout.objects.filter(user=r).order_by("-date", "-starttime").exclude(id=id)
|
if request.method == 'POST':
|
||||||
|
dateform = DateRangeForm(request.POST)
|
||||||
|
if dateform.is_valid():
|
||||||
|
startdate = dateform.cleaned_data['startdate']
|
||||||
|
enddate = dateform.cleaned_data['enddate']
|
||||||
|
else:
|
||||||
|
dateform = DateRangeForm(initial={
|
||||||
|
'startdate':startdate,
|
||||||
|
'enddate':enddate,
|
||||||
|
})
|
||||||
|
|
||||||
|
if startdatestring:
|
||||||
|
startdate = iso8601.parse_date(startdatestring)
|
||||||
|
if enddatestring:
|
||||||
|
enddate = iso8601.parse_date(enddatestring)
|
||||||
|
|
||||||
|
startdate = datetime.datetime.combine(startdate,datetime.time())
|
||||||
|
enddate = datetime.datetime.combine(enddate,datetime.time(23,59,59))
|
||||||
|
|
||||||
|
if enddate < startdate:
|
||||||
|
s = enddate
|
||||||
|
enddate = startdate
|
||||||
|
startdate = s
|
||||||
|
|
||||||
|
workouts = Workout.objects.filter(user=r,
|
||||||
|
startdatetime__gte=startdate,
|
||||||
|
startdatetime__lte=enddate).order_by("-date", "-starttime").exclude(id=id)
|
||||||
|
|
||||||
|
query = request.GET.get('q')
|
||||||
|
if query:
|
||||||
|
query_list = query.split()
|
||||||
|
workouts = workouts.filter(
|
||||||
|
reduce(operator.and_,
|
||||||
|
(Q(name__icontains=q) for q in query_list)) |
|
||||||
|
reduce(operator.and_,
|
||||||
|
(Q(notes__icontains=q) for q in query_list))
|
||||||
|
)
|
||||||
|
|
||||||
|
paginator = Paginator(workouts,15) # show 25 workouts per page
|
||||||
|
page = request.GET.get('page')
|
||||||
|
|
||||||
|
try:
|
||||||
|
workouts = paginator.page(page)
|
||||||
|
except PageNotAnInteger:
|
||||||
|
workouts = paginator.page(1)
|
||||||
|
except EmptyPage:
|
||||||
|
workouts = paginator.page(paginator.num_pages)
|
||||||
|
|
||||||
row = Workout.objects.get(id=id)
|
row = Workout.objects.get(id=id)
|
||||||
|
|
||||||
return render(request, 'comparison_list.html',
|
return render(request, 'comparison_list.html',
|
||||||
@@ -1797,6 +1934,9 @@ def workout_comparison_list(request,id=0,message='',successmessage=''):
|
|||||||
'first_name':u.first_name,
|
'first_name':u.first_name,
|
||||||
'message': message,
|
'message': message,
|
||||||
'successmessage':successmessage,
|
'successmessage':successmessage,
|
||||||
|
'dateform':dateform,
|
||||||
|
'startdate':startdate,
|
||||||
|
'enddate':enddate,
|
||||||
})
|
})
|
||||||
except Rower.DoesNotExist:
|
except Rower.DoesNotExist:
|
||||||
return HttpResponse("Admin has no rower instance")
|
return HttpResponse("Admin has no rower instance")
|
||||||
@@ -3942,6 +4082,16 @@ def graphs_view(request):
|
|||||||
try:
|
try:
|
||||||
r = Rower.objects.get(user=request.user)
|
r = Rower.objects.get(user=request.user)
|
||||||
workouts = Workout.objects.filter(user=r).order_by("-date", "-starttime")
|
workouts = Workout.objects.filter(user=r).order_by("-date", "-starttime")
|
||||||
|
query = request.GET.get('q')
|
||||||
|
if query:
|
||||||
|
query_list = query.split()
|
||||||
|
workouts = workouts.filter(
|
||||||
|
reduce(operator.and_,
|
||||||
|
(Q(name__icontains=q) for q in query_list)) |
|
||||||
|
reduce(operator.and_,
|
||||||
|
(Q(notes__icontains=q) for q in query_list))
|
||||||
|
)
|
||||||
|
|
||||||
g = GraphImage.objects.filter(workout__in=workouts).order_by("-creationdatetime")
|
g = GraphImage.objects.filter(workout__in=workouts).order_by("-creationdatetime")
|
||||||
if (len(g)<=5):
|
if (len(g)<=5):
|
||||||
return render(request, 'list_graphs.html',
|
return render(request, 'list_graphs.html',
|
||||||
|
|||||||
@@ -17,14 +17,19 @@ a {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
a:visited { color:#000; }
|
a:visited { color:#000; }
|
||||||
|
|
||||||
a:link { color: #000; }
|
a:link { color: #000; }
|
||||||
|
|
||||||
|
|
||||||
a:hover {
|
a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
/* font-family: Georgia, serif; */
|
/* font-family: Georgia, serif; */
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
@@ -471,4 +476,16 @@ a.button {
|
|||||||
.flexplot {
|
.flexplot {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.wh:link {
|
||||||
|
color: #e9e9e9;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.wh:visited {
|
||||||
|
color: #e9e9e9;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.wh:hover {
|
||||||
|
color: #e9e9e9;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user