From ee4fa4c3b891af7d0f46502101fd1d902b694aac Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 28 Feb 2019 20:10:38 +0100 Subject: [PATCH 1/2] css and js for bokeh 1.0.4 --- rowers/templates/advancededit.html | 227 ---------------- rowers/templates/advancedotw.html | 284 -------------------- rowers/templates/agegroupchart.html | 2 +- rowers/templates/agegroupcp.html | 2 +- rowers/templates/basebase.html | 232 ---------------- rowers/templates/bases.html | 194 ------------- rowers/templates/biginteractive1.html | 60 ----- rowers/templates/boxplot.html | 2 +- rowers/templates/comparisonchart.html | 77 ------ rowers/templates/comparisonchart2.html | 131 --------- rowers/templates/cum_flex.html | 13 +- rowers/templates/cumstats.html | 12 +- rowers/templates/disqualification_view.html | 2 +- rowers/templates/fitnessmetric.html | 2 +- rowers/templates/flexchart2.html | 182 ------------- rowers/templates/forcecurve_single.html | 4 +- rowers/templates/histo.html | 13 +- rowers/templates/histo_single.html | 2 +- rowers/templates/map_view.html | 2 +- rowers/templates/multicompare.html | 2 +- rowers/templates/multiflex.html | 2 +- rowers/templates/oterankings.html | 2 +- rowers/templates/otwgeeky.html | 2 +- rowers/templates/otwinteractive.html | 2 +- rowers/templates/otwrankings.html | 2 +- rowers/templates/rankings.html | 2 +- rowers/templates/splitworkout.html | 2 +- rowers/templates/streamedit.html | 2 +- rowers/templates/summary_edit.html | 2 +- rowers/templates/test.html | 54 ---- rowers/templates/windedit.html | 2 +- rowers/templates/workflow.html | 2 +- rowers/templates/workout_comments.html | 2 +- rowers/templates/workout_form.html | 2 +- rowers/templates/workout_view.html | 2 +- templates/newbase.html | 2 +- templates/newbasefront.html | 2 +- 37 files changed, 38 insertions(+), 1493 deletions(-) delete mode 100644 rowers/templates/advancededit.html delete mode 100644 rowers/templates/advancedotw.html delete mode 100644 rowers/templates/basebase.html delete mode 100644 rowers/templates/bases.html delete mode 100644 rowers/templates/biginteractive1.html delete mode 100644 rowers/templates/comparisonchart.html delete mode 100644 rowers/templates/comparisonchart2.html delete mode 100644 rowers/templates/flexchart2.html delete mode 100644 rowers/templates/test.html diff --git a/rowers/templates/advancededit.html b/rowers/templates/advancededit.html deleted file mode 100644 index 66a6c8c8..00000000 --- a/rowers/templates/advancededit.html +++ /dev/null @@ -1,227 +0,0 @@ -{% extends "base.html" %} -{% load staticfiles %} -{% load rowerfilters %} - -{% block title %}{{ workout.name }} Advanced {% endblock %} - -{% block content %} -
-
- {% if form.errors %} -

- Please correct the error{{ form.errors|pluralize }} below. -

- {% endif %} - -

{{ workout.name }} - Advanced

- {% if user.rower.rowerplan == 'basic' %} -

Functionality marked with an asterisk (*) is limited to the paid plans. See - the page about Pro membership - for more information and to sign up for Pro Membership

- {% endif %} -
-
-
-

- Edit Workout -

-
-
-

- Workflow View -

-
-
-

- Export -

-
-
- -
- - - - - - - - - - - - -
Date:{{ workout.date }}
Time:{{ workout.starttime }}
Distance:{{ workout.distance }}m
Duration:{{ workout.duration |durationprint:"%H:%M:%S.%f" }}
Public link to this workout - https://rowsandall.com/rowers/workout/{{ workout.id|encode }} - -
-
- -
-
- {% if user|is_promember %} - Compare Workouts - {% else %} - Compare Workouts* - {% endif %} -

- Compare this workout to other workouts. Plot HR, SPM, or pace vs time or distance for the two workouts. -

-
-
- - Flexible Interactive Plot - -

- Flexible Interactive plot. Pick your own X and Y axis parameters. -

-
- -
-

- {% if user|is_promember %} - Edit Intervals - {% else %} - Edit Intervals* - {% endif %} -

- Enter or change the interval and summary data for your workout - -

- Enter or change the interval and summary data for your workout -

-
-
-
-
-

- {% if user|is_promember %} - Dist Metrics Plot - {% else %} - Dist Metrics Plot* - {% endif %} -

-

- Various advanced stroke metrics plotted versus distance. -

-
-
-

- {% if user|is_promember %} - Time Metrics Plot - {% else %} - Time Metrics Plot* - {% endif %} -

-

- Various advanced stroke metrics plotted versus time. -

-
-
-

- {% if user|is_promember %} - Power Histogram - {% else %} - Power Histogram* - {% endif %} -

-

- Plot the Power Histogram of this workout -

-
-
-
-
-

- {% if user|is_promember %} - Glue - {% else %} - Glue* - {% endif %} -

-

- Glue multiple workouts together (into one workout). For example, to combine separately recorded intervals. -

-
- -
-

- {% if user|is_promember %} - Sensor Fusion - {% else %} - Sensor Fusion* - {% endif %} -

-

- Merge data from another source into this workout -

-
-
-

- {% if user|is_promember %} - Split Workout - {% else %} - Split Workout* - {% endif %} -

-

- Split workout into two seperate workouts -

-
-
-
-
-

- Big Interactive Plot -

-

- See (and save) the big interactive plot -

-
-
-

- In-Stroke Metrics

-

- If your workout has in-stroke metrics (like a stroke power curve or boat acceleration curve), you will find it here. -

-
-
-
-
-
- - - - - {{ interactiveplot |safe }} - - - - - -
- {{ the_div |safe }} -
-
-
- -{% endblock %} diff --git a/rowers/templates/advancedotw.html b/rowers/templates/advancedotw.html deleted file mode 100644 index 59bd5ccf..00000000 --- a/rowers/templates/advancedotw.html +++ /dev/null @@ -1,284 +0,0 @@ -{% extends "base.html" %} -{% load staticfiles %} -{% load rowerfilters %} - -{% block title %}{{ workout.name }} Advanced {% endblock %} - -{% block content %} -
- - {% if form.errors %} -

- Please correct the error{{ form.errors|pluralize }} below. -

- {% endif %} - -

{{ workout.name }} - Advanced OTW

- {% if user.rower.rowerplan == 'basic' %} -

Functionality marked with an asterisk (*) is limited to the paid plans. See - the page about Pro membership - for more information and to sign up for Pro Membership

-{% endif %} -
-

- Edit Workout -

-
-
-

- Workflow View -

-
-
-

- Export -

- -
-
- - - - - - - - - - - - -
Date:{{ workout.date }}
Time:{{ workout.starttime }}
Distance:{{ workout.distance }}m
Duration:{{ workout.duration |durationprint:"%H:%M:%S.%f" }}
Public link to this workout - https://rowsandall.com/rowers/workout/{{ workout.id|encode }} - -
-
- -
-
-

- {% if user|is_promember %} - Compare Workouts - {% else %} - Compare Workouts* - {% endif %} -

-

- Compare this workout to other workouts. Plot HR, SPM, or pace vs time or distance for the two workouts. -

-
- -
-

- Flexible Interactive Plot -

-

- Flexible Interactive plot. Pick your own X and Y axis parameters. -

-
- -
-

- {% if user|is_promember %} - Edit Intervals - {% else %} - Edit Intervals* - {% endif %} -

- Enter or change the interval and summary data for your workout - -

- Enter or change the interval and summary data for your workout -

-
-
- -
-
-

- {% if user|is_promember %} - CrewNerd Summary - {% else %} - CrewNerd Summary* - {% endif %} - -

-

- Upload a CrewNerd Summary (CSV file) to this workout. -

-
- -
-

- {% if user|is_promember %} - Stroke Profile (Empower) - {% else %} - Stroke Profile (Empower)* - {% endif %} -

- Analyze your stroke force profile (need Empower Oarlock data)

- Interactive plot of Stroke Profile (with Empower Oarlock) -

-
- -
-

- {% if user|is_promember %} - OTW Power Plot - {% else %} - OTW Power Plot* - {% endif %} -

- Note: You must run the OTW calculations under Geeky Stuff first. Otherwise the plot will be empty - -

- Pace, wind corrected pace, power, equivalent erg power in a static plot -

-
- - -
- -
- -
-

- {% if user|is_promember %} - Geeky Stuff - {% else %} - Geeky Stuff* - {% endif %} - -

-

- Add weather and current data and OTW power calculations. -

-
- - -
-

- {% if user|is_promember %} - Smooth out Pace Data - {% else %} - Smooth out Pace Data* - {% endif %} - -

- This will reduce noise on your pace data. The smoothing is irreversible but you can use the reset smoothing button. - -

- Pace data too noisy? Press this button! -

-
- - -
-

- {% if user|is_promember %} - Raw Data - {% else %} - Reset Smoothing* - {% endif %} -

-

- Reset pace data to values before smoothing -

-
-
- -
-
-

- {% if user|is_promember %} - Glue - {% else %} - Glue* - {% endif %} -

-

- Glue multiple workouts together (into one workout). For example, to combine separately recorded intervals. -

-
-
-

- {% if user|is_promember %} - Sensor Fusion - {% else %} - Sensor Fusion* - {% endif %} -

-

- Merge data from another source into this workout -

-
-
-

- {% if user|is_promember %} - Split Workout - {% else %} - Split Workout* - {% endif %} -

-

- Split workout into two seperate workouts -

-
- -
-
-
-

- Big Interactive Plot -

-

- See (and save) the big interactive plot -

-
-
-

- In-Stroke Metrics

-

- If your workout has in-stroke metrics (like a stroke power curve or boat acceleration curve), you will find it here. -

-
- -
-
-
-
- - - - - {{ interactiveplot |safe }} - - - - - -
- {{ the_div |safe }} -
-
-
-{% endblock %} diff --git a/rowers/templates/agegroupchart.html b/rowers/templates/agegroupchart.html index 606c2f84..2a8e0cc3 100644 --- a/rowers/templates/agegroupchart.html +++ b/rowers/templates/agegroupchart.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/agegroupcp.html b/rowers/templates/agegroupcp.html index 5c466d40..183db44c 100644 --- a/rowers/templates/agegroupcp.html +++ b/rowers/templates/agegroupcp.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/basebase.html b/rowers/templates/basebase.html deleted file mode 100644 index 98f30743..00000000 --- a/rowers/templates/basebase.html +++ /dev/null @@ -1,232 +0,0 @@ -{% load cookielaw_tags %} -{% load leaflet_tags %} -{% load tz_detect %} -{% tz_detect %} -{% load analytical %} -{% block filters %} -{% endblock %} - - - - {% block headtext %}{% endblock %} - - {% analytical_head_top %} - {% if GOOGLE_ANALYTICS_PROPERTY_ID %} - {% include "ga.html" %} - {% endif %} - - - - - - - - - - - - - - {% block title %}Rowsandall{% endblock %} - - - - - - - {% block meta %} {% endblock %} - {% analytical_head_bottom %} - - - {% analytical_body_top %} - {% block body_top %}{% endblock %} -
-
-   -
-
- -
-
-
- -
- -
- -
-
-

Free Data and Analysis. For Rowers. By Rowers.

-
-
- -
-
- {% if user.is_authenticated %} -

- {{ user.first_name }} -

- Edit user account, e.g. heart rate zones, power zones, email, teams - - {% else %} -

login

- {% endif %} -
-
- {% if user.is_authenticated %} -

logout

- {% else %} -

 

- {% endif %} -
-
-
- {% if user.rower.rowerplan == 'pro' or user.rower.rowerplan == 'coach' %} -
Pro Member
- {% else %} - - {% endif %} -
-
-
- - -
-
- {% if user.is_authenticated %} -

Upload

- Upload CSV, TCX, FIT data files to rowsandall.com - {% else %} -

Register (free)

- {% endif %} -
-
- {% if user.is_authenticated %} -

- Import -

- Import workouts from Strava, SportTracks, and C2 logbook - {% else %} -

 

- {% endif %} -
-
- {% if user.is_authenticated %} -

- Workouts -

- See your list of workouts - {% else %} -

 

- {% endif %} -
-
- {% if user.is_authenticated %} -

- Graphs -

- See your most recent charts - {% else %} -

 

- {% endif %} -
-
- {% if user.is_authenticated %} -

- Analysis -

- Analysis of workouts over a period of time - {% else %} -

 

- {% endif %} -
-
- {% block teams %} - {% endblock %} -
-
- - -
-
- {% block message %} - {% if message %} -

- {{ message }} -

- {% endif %} - {% if successmessage %} -

- {{ successmessage }} -

- {% endif %} - {% endblock %} -
-
- {% load tz %} - - {% block content %}{% endblock %} -
-
- -
- {% block footer %} - - -
- -
-
- -
-
- -
-
- -
-
- -
-
- -
- - - {% endblock %} -
- {% cookielaw_banner %} -
- - {% analytical_body_bottom %} - {% block body_bottom %}{% endblock %} - - diff --git a/rowers/templates/bases.html b/rowers/templates/bases.html deleted file mode 100644 index 6b242cf2..00000000 --- a/rowers/templates/bases.html +++ /dev/null @@ -1,194 +0,0 @@ -{% load rowerfilters %} - - - - - - - - - - - - Rowsandall - - - - - {% block meta %} {% endblock %} - - -
- -
-

 

-
- {% if user.is_authenticated %} -

Password Change

- {% else %} -

Forgotten Password?

- {% endif %} -
-
- - -
-
-

Free Data and Analysis. For Rowers. By Rowers.

-
-
- {% if user|is_promember %} -
Pro Member
- {% else %} -

 

- {% endif %} -
-
- {% if user.is_authenticated %} -

logout

- - {% else %} -

 

- {% endif %} - -
-
- -
-
- {% if user.is_authenticated %} -

Upload

- Upload CSV, TCX, FIT data files to rowsandall.com - {% else %} -

Register (free)

- {% endif %} -
-
- {% if user.is_authenticated %} -

- Import -

- Import workouts from Strava, SportTracks, and C2 logbook - {% else %} -

 

- {% endif %} -
-
- {% if user.is_authenticated %} -

- Workouts -

- See your list of workouts - {% else %} -

 

- {% endif %} -
-
- {% if user.is_authenticated %} -

- Graphs -

- See your most recent charts - {% else %} -

 

- {% endif %} -
-
- {% if user.is_authenticated %} -

- Analysis -

- Analysis of workouts over a period of time - {% else %} -

 

- {% endif %} -
-
- {% if user.is_authenticated %} -

- {{ user.first_name }} -

- Edit user data, e.g. heart rate zones - - {% else %} -

login

- {% endif %} -
-
- - -
-
- {% block message %} - {% if message %} -

- {{ message }} -

- {% endif %} - {% if successmessage %} -

- {{ successmessage }} -

- {% endif %} - {% endblock %} -
-
- {% load tz %} - - {% block content %}{% endblock %} -
-
- -
- {% block footer %} - - -
- -
-
- -
-
- -
-
- -
-
- -
-
- -
- -
- -
- {% endblock %} -
-
- - - diff --git a/rowers/templates/biginteractive1.html b/rowers/templates/biginteractive1.html deleted file mode 100644 index 99ab4f4c..00000000 --- a/rowers/templates/biginteractive1.html +++ /dev/null @@ -1,60 +0,0 @@ -{% extends "base.html" %} -{% load staticfiles %} -{% load rowerfilters %} - -{% block title %}Rowsandall {% endblock %} - -{% block content %} - - - - - {{ interactiveplot |safe }} - - - - - -
- - -

Interactive Plot

- - {% if user.is_authenticated and mayedit %} -
-

- Edit Workout -

-
-
-

- Advanced Edit -

- -
- {% endif %} - - {{ the_div|safe }} - -
- -{% endblock %} diff --git a/rowers/templates/boxplot.html b/rowers/templates/boxplot.html index 4b95cfaf..341bfb21 100644 --- a/rowers/templates/boxplot.html +++ b/rowers/templates/boxplot.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/comparisonchart.html b/rowers/templates/comparisonchart.html deleted file mode 100644 index 7975c406..00000000 --- a/rowers/templates/comparisonchart.html +++ /dev/null @@ -1,77 +0,0 @@ -{% extends "base.html" %} -{% load staticfiles %} -{% load rowerfilters %} - -{% block title %}Compare Workouts {% endblock %} - -{% block content %} - - - - - {{ interactiveplot |safe }} - - - - - -
- -
- -

 

- -
-
-
- Time -
-
- Distance -
-
- -
-
- Pace -
- -
- SPM -
-
- -
- -
- - - {{ the_div|safe }} - -
- -{% endblock %} \ No newline at end of file diff --git a/rowers/templates/comparisonchart2.html b/rowers/templates/comparisonchart2.html deleted file mode 100644 index 93a996b8..00000000 --- a/rowers/templates/comparisonchart2.html +++ /dev/null @@ -1,131 +0,0 @@ -{% extends "base.html" %} -{% load staticfiles %} -{% load rowerfilters %} - -{% block title %} Comparison Plot {% endblock %} - -{% block content %} - - - - -{{ interactiveplot |safe }} - - - - - - - - - -
-
-
-

- Swap Workouts -

-
- - - - - - -
- -
-
- Line Plot -
- -
- -
- -
- - - {{ the_div|safe }} - -
- -{% endblock %} diff --git a/rowers/templates/cum_flex.html b/rowers/templates/cum_flex.html index fc4af5bb..50a26c5b 100644 --- a/rowers/templates/cum_flex.html +++ b/rowers/templates/cum_flex.html @@ -58,18 +58,13 @@ -
- - + +
- - + +
diff --git a/rowers/templates/cumstats.html b/rowers/templates/cumstats.html index 548fbbf9..c92eb7ea 100644 --- a/rowers/templates/cumstats.html +++ b/rowers/templates/cumstats.html @@ -60,16 +60,12 @@
- - + +
- - + +
diff --git a/rowers/templates/disqualification_view.html b/rowers/templates/disqualification_view.html index fe7b61a5..3ad7b75e 100644 --- a/rowers/templates/disqualification_view.html +++ b/rowers/templates/disqualification_view.html @@ -98,7 +98,7 @@ {% endif %}
  • - + diff --git a/rowers/templates/fitnessmetric.html b/rowers/templates/fitnessmetric.html index 76110d0f..aa7abc5b 100644 --- a/rowers/templates/fitnessmetric.html +++ b/rowers/templates/fitnessmetric.html @@ -48,7 +48,7 @@ }); - + diff --git a/rowers/templates/flexchart2.html b/rowers/templates/flexchart2.html deleted file mode 100644 index 253bc0c7..00000000 --- a/rowers/templates/flexchart2.html +++ /dev/null @@ -1,182 +0,0 @@ -{% extends "base.html" %} -{% load staticfiles %} -{% load rowerfilters %} -{% load tz %} - -{% block title %} Flexible Plot {% endblock %} - -{% localtime on %} -{% block content %} - - - - - - {{ interactiveplot |safe }} - - {{ widgetscript | safe }} - - - - - - - -

     

    - -
    - - - - -
    -
    -
    - {% csrf_token %} - {% if workstrokesonly %} - - {% else %} - - {% endif %} - -
    - If your data source allows, this will show or hide strokes taken during rest intervals. -
    -
    - Line Plot -
    - -
    - -
    - -
    - - - {{ the_div|safe }} - -
    - -
    - - - {{ widgetdiv1|safe }} - {{ widgetdiv2|safe }} - -
    - -{% endblock %} -{% endlocaltime %} diff --git a/rowers/templates/forcecurve_single.html b/rowers/templates/forcecurve_single.html index e99669c3..7d7a06a9 100644 --- a/rowers/templates/forcecurve_single.html +++ b/rowers/templates/forcecurve_single.html @@ -11,8 +11,8 @@ {{ js_res | safe }} {{ css_res| safe }} - - + + diff --git a/rowers/templates/histo.html b/rowers/templates/histo.html index b64d4cf5..5fe9f287 100644 --- a/rowers/templates/histo.html +++ b/rowers/templates/histo.html @@ -60,17 +60,12 @@
    - - + +
    - - - + +
    diff --git a/rowers/templates/histo_single.html b/rowers/templates/histo_single.html index e1ee3677..17f59dc1 100644 --- a/rowers/templates/histo_single.html +++ b/rowers/templates/histo_single.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/map_view.html b/rowers/templates/map_view.html index e2f3c7b7..06da45d9 100644 --- a/rowers/templates/map_view.html +++ b/rowers/templates/map_view.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/multicompare.html b/rowers/templates/multicompare.html index 78d59f2c..9cb78fd5 100644 --- a/rowers/templates/multicompare.html +++ b/rowers/templates/multicompare.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/multiflex.html b/rowers/templates/multiflex.html index 4af8901d..4a981481 100644 --- a/rowers/templates/multiflex.html +++ b/rowers/templates/multiflex.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/oterankings.html b/rowers/templates/oterankings.html index 43f48ef2..6dca78f9 100644 --- a/rowers/templates/oterankings.html +++ b/rowers/templates/oterankings.html @@ -10,7 +10,7 @@ {% block main %} - + diff --git a/rowers/templates/otwgeeky.html b/rowers/templates/otwgeeky.html index c0db3273..855b8aea 100644 --- a/rowers/templates/otwgeeky.html +++ b/rowers/templates/otwgeeky.html @@ -138,7 +138,7 @@
    - + diff --git a/rowers/templates/otwinteractive.html b/rowers/templates/otwinteractive.html index 099cdaf4..43ec3507 100644 --- a/rowers/templates/otwinteractive.html +++ b/rowers/templates/otwinteractive.html @@ -6,7 +6,7 @@ {% block main %} - + diff --git a/rowers/templates/otwrankings.html b/rowers/templates/otwrankings.html index db15a099..ca4d2b62 100644 --- a/rowers/templates/otwrankings.html +++ b/rowers/templates/otwrankings.html @@ -10,7 +10,7 @@ {% block main %} - + diff --git a/rowers/templates/rankings.html b/rowers/templates/rankings.html index 2625df22..aa85aa07 100644 --- a/rowers/templates/rankings.html +++ b/rowers/templates/rankings.html @@ -13,7 +13,7 @@ {% block main %} - + diff --git a/rowers/templates/splitworkout.html b/rowers/templates/splitworkout.html index 0e233c0a..e00aac01 100644 --- a/rowers/templates/splitworkout.html +++ b/rowers/templates/splitworkout.html @@ -23,7 +23,7 @@
  • - + diff --git a/rowers/templates/streamedit.html b/rowers/templates/streamedit.html index 8a0b00c3..d2df3584 100644 --- a/rowers/templates/streamedit.html +++ b/rowers/templates/streamedit.html @@ -31,7 +31,7 @@
  • - + diff --git a/rowers/templates/summary_edit.html b/rowers/templates/summary_edit.html index 39dccc10..71416879 100644 --- a/rowers/templates/summary_edit.html +++ b/rowers/templates/summary_edit.html @@ -62,7 +62,7 @@
  • - + diff --git a/rowers/templates/test.html b/rowers/templates/test.html deleted file mode 100644 index 32dd9782..00000000 --- a/rowers/templates/test.html +++ /dev/null @@ -1,54 +0,0 @@ -{% extends "base.html" %} -{% load staticfiles %} -{% load rowerfilters %} - -{% block title %} Flexible Plot {% endblock %} - -{% block content %} - - {{ js_res | safe }} - {{ css_res| safe }} - - - - - - {{ the_script |safe }} - - - - - - -

     

    - - - - -
    - - - {{ the_div|safe }} - -
    - -{% endblock %} \ No newline at end of file diff --git a/rowers/templates/windedit.html b/rowers/templates/windedit.html index d37930d1..22020333 100644 --- a/rowers/templates/windedit.html +++ b/rowers/templates/windedit.html @@ -53,7 +53,7 @@
  • - + diff --git a/rowers/templates/workflow.html b/rowers/templates/workflow.html index 502323a4..f2b5e5b8 100644 --- a/rowers/templates/workflow.html +++ b/rowers/templates/workflow.html @@ -13,7 +13,7 @@ {{ workout.date }} - {{ workout.distance }}m - {{ workout.duration |durationprint:"%H:%M:%S.%f" }}{% endblock %} {% block meta %} - + diff --git a/rowers/templates/workout_comments.html b/rowers/templates/workout_comments.html index 77ffd868..8a514aad 100644 --- a/rowers/templates/workout_comments.html +++ b/rowers/templates/workout_comments.html @@ -86,7 +86,7 @@
  • - + diff --git a/rowers/templates/workout_form.html b/rowers/templates/workout_form.html index 5cc68de1..05e61f1b 100644 --- a/rowers/templates/workout_form.html +++ b/rowers/templates/workout_form.html @@ -130,7 +130,7 @@ $('#id_workouttype').change(); {% endif %} {% if mapdiv %}
  • - + diff --git a/rowers/templates/workout_view.html b/rowers/templates/workout_view.html index f7b107b4..0edfc280 100644 --- a/rowers/templates/workout_view.html +++ b/rowers/templates/workout_view.html @@ -121,7 +121,7 @@
  • {% endif %}
  • - + diff --git a/templates/newbase.html b/templates/newbase.html index 6dea7a87..46b2ac2e 100644 --- a/templates/newbase.html +++ b/templates/newbase.html @@ -58,7 +58,7 @@ - + diff --git a/templates/newbasefront.html b/templates/newbasefront.html index 791d6dd7..ea72d0e4 100644 --- a/templates/newbasefront.html +++ b/templates/newbasefront.html @@ -56,7 +56,7 @@ - + From faeea73b0a642968e5692b0376cc428c883835d2 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 28 Feb 2019 22:52:59 +0100 Subject: [PATCH 2/2] passing all tests on py3 --- rowers/c2stuff.py | 19 +++++++++++++++---- rowers/imports.py | 2 +- rowers/management/commands/processemail.py | 11 ++++++++++- rowers/ownapistuff.py | 2 +- rowers/polarstuff.py | 2 +- rowers/runkeeperstuff.py | 8 +++++++- rowers/sporttracksstuff.py | 9 ++++++++- rowers/tests/test_errorpages.py | 5 +++-- rowers/tests/testdata/testdata.csv.gz | Bin 12543 -> 12543 bytes rowers/underarmourstuff.py | 9 ++++++++- rowers/uploads.py | 5 +++++ rowers/views/importviews.py | 12 +++++++++--- rowers/views/statements.py | 11 +++++++---- rowers/views/workoutviews.py | 2 +- 14 files changed, 76 insertions(+), 21 deletions(-) diff --git a/rowers/c2stuff.py b/rowers/c2stuff.py index f58102fb..691f121b 100644 --- a/rowers/c2stuff.py +++ b/rowers/c2stuff.py @@ -16,6 +16,8 @@ import rowers.mytypes as mytypes from rowers.mytypes import otwtypes from iso8601 import ParseError +import numpy + from rowsandall_app.settings import ( C2_CLIENT_ID, C2_REDIRECT_URI, C2_CLIENT_SECRET ) @@ -424,7 +426,11 @@ def createc2workoutdata(w): hr = 0*d stroke_data = [] for i in range(len(t)): - thisrecord = {"t":t[i],"d":d[i],"p":p[i],"spm":spm[i],"hr":hr[i]} + thisrecord = {"t":t[i].astype(int), + "d":d[i].astype(int), + "p":p[i].astype(int), + "spm":spm[i].astype(int), + "hr":hr[i].astype(int)} stroke_data.append(thisrecord) try: @@ -440,7 +446,7 @@ def createc2workoutdata(w): startdatetime = w.startdatetime.isoformat() except AttributeError: startdate = datetime.datetime.combine(w.date,datetime.time()) - + data = { "type": mytypes.c2mapping[workouttype], "date": w.startdatetime.isoformat(), @@ -551,7 +557,7 @@ def make_authorization_url(request): params = {"client_id": C2_CLIENT_ID, "response_type": "code", "redirect_uri": C2_REDIRECT_URI} - url = "https://log.concept2.com/oauth/authorize?"+ urllib.urlencode(params) + url = "https://log.concept2.com/oauth/authorize?"+ urllib.parse.urlencode(params) url += "&scope="+scope return HttpResponseRedirect(url) @@ -697,6 +703,10 @@ def process_callback(request): return HttpResponse("got a user name: %s" % username) +def default(o): + if isinstance(o, numpy.int64): return int(o) + raise TypeError + # Uploading workout def workout_c2_upload(user,w): message = 'trying C2 upload' @@ -717,6 +727,7 @@ def workout_c2_upload(user,w): raise NoTokenError data = createc2workoutdata(w) + if data == 0: return "Error: No data file. Contact info@rowsandall.com if the problem persists",0 @@ -726,7 +737,7 @@ def workout_c2_upload(user,w): 'Content-Type': 'application/json'} import urllib url = "https://log.concept2.com/api/users/%s/results" % (c2userid) - response = requests.post(url,headers=headers,data=json.dumps(data)) + response = requests.post(url,headers=headers,data=json.dumps(data,default=default)) if (response.status_code == 409 ): message = "Concept2 Duplicate error" diff --git a/rowers/imports.py b/rowers/imports.py index ad3f2f4b..6114ad79 100644 --- a/rowers/imports.py +++ b/rowers/imports.py @@ -280,7 +280,7 @@ def imports_make_authorization_url(oauth_data): import urllib - url = oauth_data['authorizaton_uri']+urllib.urlencode(params) + url = oauth_data['authorizaton_uri']+urllib.parse.urlencode(params) return HttpResponseRedirect(url) diff --git a/rowers/management/commands/processemail.py b/rowers/management/commands/processemail.py index ea187d00..6918fe70 100644 --- a/rowers/management/commands/processemail.py +++ b/rowers/management/commands/processemail.py @@ -1,13 +1,17 @@ #!/srv/venv/bin/python + """ Process emails """ import sys import os +PY3K = sys.version_info >= (3, 0) import zipfile import re import time from time import strftime +import io + from django.core.management.base import BaseCommand from django_mailbox.models import Message, MessageAttachment,Mailbox from django.core.urlresolvers import reverse @@ -62,7 +66,7 @@ def processattachment(rower, fileobj, title, uploadoptions,testing=False): # test if file exists and is not empty try: - with open('media/'+filename,'r') as fop: + with io.open('media/'+filename,'rb') as fop: line = fop.readline() except (IOError, UnicodeEncodeError): if testing: @@ -164,6 +168,11 @@ def get_from_address(message): except IndexError: first_line = '' + try: + first_line = first_line.decode('utf-8') + except AttributeError: + pass + if "quiske" in first_line: match = re.search(r'[\w\.-]+@[\w\.-]+', first_line) return match.group(0) diff --git a/rowers/ownapistuff.py b/rowers/ownapistuff.py index da548559..49c53e3f 100644 --- a/rowers/ownapistuff.py +++ b/rowers/ownapistuff.py @@ -128,7 +128,7 @@ def make_authorization_url(request): import urllib - url = "http://localhost:8000/rowers/o/authorize" +urllib.urlencode(params) + url = "http://localhost:8000/rowers/o/authorize" +urllib.parse.urlencode(params) return HttpResponseRedirect(url) diff --git a/rowers/polarstuff.py b/rowers/polarstuff.py index 6e251328..21b0792e 100644 --- a/rowers/polarstuff.py +++ b/rowers/polarstuff.py @@ -106,7 +106,7 @@ def make_authorization_url(): "redirect_uri": POLAR_REDIRECT_URI, "scope":"write"} import urllib - url = "https://flow.polar.com/oauth2/authorization" +urllib.urlencode(params) + url = "https://flow.polar.com/oauth2/authorization" +urllib.parse.urlencode(params) return HttpResponseRedirect(url) diff --git a/rowers/runkeeperstuff.py b/rowers/runkeeperstuff.py index 5f9cd15f..0800c08a 100644 --- a/rowers/runkeeperstuff.py +++ b/rowers/runkeeperstuff.py @@ -29,6 +29,8 @@ oauth_data = { } +import numpy + def splitrunkeeperlatlongdata(lijst,tname,latname,lonname): t = [] lat = [] @@ -262,6 +264,10 @@ def get_userid(access_token): return str(res) +def default(o): + if isinstance(o, numpy.int64): return int(o) + raise TypeError + def workout_runkeeper_upload(user,w): message = "Uploading to Runkeeper" rkid = 0 @@ -287,7 +293,7 @@ def workout_runkeeper_upload(user,w): 'Content-Length':'nnn'} url = "https://api.runkeeper.com/fitnessActivities" - response = requests.post(url,headers=headers,data=json.dumps(data)) + response = requests.post(url,headers=headers,data=json.dumps(data,default=default)) # check for duplicate error first if (response.status_code == 409 ): diff --git a/rowers/sporttracksstuff.py b/rowers/sporttracksstuff.py index 186340e0..9729d69d 100644 --- a/rowers/sporttracksstuff.py +++ b/rowers/sporttracksstuff.py @@ -6,6 +6,8 @@ from __future__ import unicode_literals from __future__ import unicode_literals, absolute_import # All the functionality to connect to SportTracks +import numpy + from rowers.imports import * import re from rowsandall_app.settings import ( @@ -235,6 +237,11 @@ def getidfromresponse(response): return int(id) +def default(o): + if isinstance(o, numpy.int64): return int(o) + raise TypeError + + def workout_sporttracks_upload(user,w): message = "Uploading to SportTracks" @@ -257,7 +264,7 @@ def workout_sporttracks_upload(user,w): 'Content-Type': 'application/json'} url = "https://api.sporttracks.mobi/api/v2/fitnessActivities.json" - response = requests.post(url,headers=headers,data=json.dumps(data)) + response = requests.post(url,headers=headers,data=json.dumps(data,default=default)) # check for duplicate error first if (response.status_code == 409 ): diff --git a/rowers/tests/test_errorpages.py b/rowers/tests/test_errorpages.py index 6d973366..671514df 100644 --- a/rowers/tests/test_errorpages.py +++ b/rowers/tests/test_errorpages.py @@ -16,11 +16,12 @@ class TestErrorPages(TestCase): factory = RequestFactory() request = factory.get('/') response = error404_view(request) + self.assertEqual(response.status_code, 404) - self.assertIn('404 Page not found', unicode(response)) + self.assertIn('404 Page not found', str(response.content)) response = error500_view(request) self.assertEqual(response.status_code, 500) - self.assertIn('500 Internal Server Error', unicode(response)) + self.assertIn('500 Internal Server Error', str(response.content)) response = error400_view(request) self.assertEqual(response.status_code, 400) diff --git a/rowers/tests/testdata/testdata.csv.gz b/rowers/tests/testdata/testdata.csv.gz index 3098c1b69ebecf455efddc569bb0f26102b13177..3798b4a7b98f1ff1b992f89f329af0107f222aa5 100644 GIT binary patch delta 16 XcmeyL_&0: + elif cached_progress is not None and cached_progress>0: progress = cached_progress else: progress = 0 diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index b60b2c91..9b65d9f3 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -4595,7 +4595,7 @@ def workout_split_view(request,id=0): pass qdict = {'q':rowname} - url+='?'+urllib.urlencode(qdict) + url+='?'+urllib.parse.urlencode(qdict) return HttpResponseRedirect(url)