From 113c2d0f05a15df7baf339360475b97395109541 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 27 Dec 2021 10:13:24 +0100 Subject: [PATCH 01/20] als tabel --- rowers/templates/list_workouts.html | 133 +++++----------------------- 1 file changed, 20 insertions(+), 113 deletions(-) diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index d7fa0479..10d32c13 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -153,134 +153,41 @@

-
  • +
  • {% if workouts %} - - - - - - - - - - - - - {% if not team %} - - {% else %} - - {% endif %} - - +
    R Date Time Name Type Distance Duration Avg HR Max HR   - Owner -
    {% for workout in workouts %} - {% if workout.rankingpiece %} - - {% else %} - {% endif %} - - - - {% if workout|may_edit:request %} - {% if workout.name != '' %} + - {% else %} - {% endif %} - {% else %} - {% if workout.name != '' %} - - {% else %} - - {% endif %} - {% endif %} - - - - - - {% if team %} - - {% endif %} - - - - - - - +

    + {% endfor %} From d7af00a65eaa8fc2f34e1e665c10e7085e7ca21a Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 27 Dec 2021 11:16:02 +0100 Subject: [PATCH 02/20] nicer design --- rowers/templates/list_workouts.html | 69 ++++++++++++++++------------- rowers/views/workoutviews.py | 2 +- static/css/rowsandall2.css | 12 +++++ templates/newbase.html | 2 +- 4 files changed, 51 insertions(+), 34 deletions(-) diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index 10d32c13..2e430538 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -46,8 +46,11 @@ #mypointer { cursor: pointer; } + div.columns { width: 100%; } + div.columns div { width: 20%; padding: 10px; float: left; } + {% if team %}

    {{ team.name }} Team Workouts

    {% else %} @@ -153,50 +156,52 @@

    -
  • {% if workouts %} -
  • - {% if workout.rankingpiece %} - - {% else %} - - {% endif %} - {{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }} - + {{ workout.workouttype }} + + {% if workout.name != '' %} +

    {{ workout.name }} - +

    + {% else %} +

    + No Name +

    + {% endif %} +

    {{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }}

    +

    {{ workout.distance }}m {{ workout.duration |durationprint:"%H:%M:%S.%f" }}

    - No Name - {{ workout.name }}No Name {{ workout.workouttype }} {{ workout.distance }}m {{ workout.duration |durationprint:"%H:%M:%S.%f" }} {{ workout.averagehr }} {{ workout.maxhr }} - {% if workout|may_edit:request %} - - {{ workout.user.user.first_name }} - {{ workout.user.user.last_name }} - - {% else %} - {{ workout.user.user.first_name }} - {{ workout.user.user.last_name }} - {% endif %} - - {% if workout|may_edit:request %} +

    {% if workout|may_edit:request %} - + {% else %}   {% endif %} -

    - - - - - - - - - - - - - - - - - {% if workout|may_edit:request %} - - - - {% else %} -   - {% endif %} -
    - {% for workout in workouts %} - - - - - + href={% url rower.defaultlandingpage id=workout.id|encode %} + title="Edit"> + + {% else %} +   + {% endif %} + + + {% endfor %} - -
    - {{ workout.workouttype }} - - {% if workout.name != '' %} -

    +
  • +
    + {% if workout.name != '' %} +

    {{ workout.name }}

    - {% else %} -

    + {% else %} +

    No Name

    - {% endif %} -

    {{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }}

    -

    {{ workout.distance }}m {{ workout.duration |durationprint:"%H:%M:%S.%f" }}

    -
  • -

    {% if workout|may_edit:request %} + {% endif %} + +

    +
    + {{ workout.workouttype }} +
    +
    + {{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }} +
    +
    + {{ workout.distance }}m +
    +
    + {{ workout.duration |durationprint:"%H:%M:%S.%f" }} +
    +
    + {% if workout|may_edit:request %} - - - {% else %} -   - {% endif %} -

    -
    + {% else %} -

    No workouts found

    +
  • No workouts found
  • {% endif %} - {% if announcements %}
  • What's New?

    diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index 00b1e4a5..ccb11dea 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -2357,7 +2357,7 @@ def workouts_view(request,message='',successmessage='', else: searchform = SearchForm() - paginator = Paginator(workouts,20) # show 25 workouts per page + paginator = Paginator(workouts,10) # show 25 workouts per page page = request.GET.get('page',1) try: diff --git a/static/css/rowsandall2.css b/static/css/rowsandall2.css index e4054cb8..9c62a2e5 100644 --- a/static/css/rowsandall2.css +++ b/static/css/rowsandall2.css @@ -1,3 +1,5 @@ + + #main { background-color: transparent; -webkit-background-size: cover; @@ -320,6 +322,16 @@ th.rotate > div > span { margin: 2px; } +.divlines { + display: block; + overflow-x: hidden; + border-width: 1px 0 0 0; + border-color: #333 #333 #333 #333; + border-style: solid; + padding: 5px; + margin: 2px; +} + .whiteborder { border: solid 2px #aaa; } diff --git a/templates/newbase.html b/templates/newbase.html index 5273af76..b05a4421 100644 --- a/templates/newbase.html +++ b/templates/newbase.html @@ -46,7 +46,7 @@ - + {% block meta %} {% endblock %}
    From f3643b1f91139a204a275439cf47e908326775c4 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 27 Dec 2021 12:19:33 +0100 Subject: [PATCH 03/20] adding workout view --- rowers/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rowers/utils.py b/rowers/utils.py index b6feb80a..cb198fb7 100644 --- a/rowers/utils.py +++ b/rowers/utils.py @@ -36,6 +36,7 @@ import arrow lbstoN = 4.44822 landingpages = ( + ('workout_view', 'Workout View'), ('workout_edit_view','Edit View'), ('workout_workflow_view','Workflow View'), ('workout_stats_view','Stats View'), From 0c3d8f408b8fd090db8ac2880bb995b027949011 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 27 Dec 2021 12:34:36 +0100 Subject: [PATCH 04/20] adding time and dsitance --- rowers/templates/list_workouts.html | 4 +++- rowers/templatetags/rowerfilters.py | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index 2e430538..b2591943 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -179,9 +179,11 @@ {{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }}
    - {{ workout.distance }}m + Distance
    + {{ workout.distance|distanceprint }}
    + Time
    {{ workout.duration |durationprint:"%H:%M:%S.%f" }}
    diff --git a/rowers/templatetags/rowerfilters.py b/rowers/templatetags/rowerfilters.py index d51f18ac..05f6edde 100644 --- a/rowers/templatetags/rowerfilters.py +++ b/rowers/templatetags/rowerfilters.py @@ -375,6 +375,14 @@ def ddays(ddelta): def spacetohtml(t): return t.replace(" ","%20") +@register.filter +def distanceprint(d): + if d<10000: + return "{d} m".format(d=d) + + d2 = d/1000. + return "%.2f km" % d2 + @register.filter def durationprint(d,dstring): if (d == None): # pragma: no cover From b45c50978d72f93becc94b91f7fa0abcc4ccce72 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 27 Dec 2021 12:37:33 +0100 Subject: [PATCH 05/20] moving start date/time --- rowers/templates/list_workouts.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index b2591943..2ca57e6f 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -160,6 +160,7 @@ {% if workouts %} {% for workout in workouts %}
  • + {{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }}
    {% if workout.name != '' %}

    @@ -175,9 +176,6 @@
    {{ workout.workouttype }}
    -
    - {{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }} -
    Distance
    {{ workout.distance|distanceprint }} From e9770ce018e5ac03267b0abaa91e11e72f5786de Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 27 Dec 2021 13:51:29 +0100 Subject: [PATCH 06/20] preparing for icon set --- rowers/mytypes.py | 33 +++++++++++++++++++++++++++++ rowers/templates/list_workouts.html | 2 +- rowers/templatetags/rowerfilters.py | 15 +++++++++++++ static/css/rowsandall2.css | 4 ++-- 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/rowers/mytypes.py b/rowers/mytypes.py index 8ba51758..9249b0a6 100644 --- a/rowers/mytypes.py +++ b/rowers/mytypes.py @@ -41,6 +41,39 @@ workouttypes_ordered = collections.OrderedDict({ } ) +workouttypes_icons = collections.OrderedDict({ + 'water':'far fa-water', + 'rower':'far fa-tire', + 'skierg':'far fa-tire', + 'bikeerg':'far fa-biking', + 'dynamic':'far fa-tire', + 'slides':'far fa-tire', + 'paddle':'far fa-utensil-spoon', + 'snow':'far fa-snowflakes', + 'coastal':'far fa-water', + 'c-boat':'far fa-water', + 'churchboat':'far fa-water', + 'Ride':'far fa-biking', + 'bike':'far fa-biking', + 'Run':'far fa-running', + 'NordicSki':'far fa-skiing-nordic', + 'Swim':'far fa-swimmer', + 'Hike':'far fa-hiking', + 'Walk':'far fa-walking', + 'Canoeing':'far fa-blind', + 'Crossfit':'far fa-dumbbell', + 'StandUpPaddling':'far fa-blind', + 'IceSkate':'far fa-skating', + 'WeightTraining':'far fa-dumbbell', + 'InlineSkate':'far fa-skating', + 'Kayaking':'far fa-water', + 'Workout':'far fa-dumbbell', + 'Yoga':'far fa-pray', +# 'bike':'Bike', + 'other':'far fa-biking', + } +) + workouttypes = tuple((key, value) for key, value in workouttypes_ordered.items()) def Reverse(tuples): diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index 2ca57e6f..cf3dca27 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -174,7 +174,7 @@
    - {{ workout.workouttype }} + {{ workout.workouttype|icon|safe }}
    Distance
    diff --git a/rowers/templatetags/rowerfilters.py b/rowers/templatetags/rowerfilters.py index 05f6edde..18c2b1d4 100644 --- a/rowers/templatetags/rowerfilters.py +++ b/rowers/templatetags/rowerfilters.py @@ -25,6 +25,7 @@ from rowers.c2stuff import c2_open from rowers.rower_rules import is_coach_user, is_workout_user, isplanmember,ispromember from rowers.mytypes import ( otwtypes,adaptivetypes,sexcategories,weightcategories,workouttypes, + workouttypes_icons, ) from rowers.utils import NoTokenError, step_to_string @@ -488,6 +489,20 @@ def jsdict(dict,key): # pragma: no cover s = dict.get(key) return mark_safe(json.dumps(s)) +@register.filter +def icon(workouttype): + try: + s = workouttypes_icons.get(workouttype) + except KeyError: + s = "far fa-biking" + + iconstring = """ + + + + """.format(s=s) + + return iconstring @register.filter diff --git a/static/css/rowsandall2.css b/static/css/rowsandall2.css index 9c62a2e5..8efecb58 100644 --- a/static/css/rowsandall2.css +++ b/static/css/rowsandall2.css @@ -328,8 +328,8 @@ th.rotate > div > span { border-width: 1px 0 0 0; border-color: #333 #333 #333 #333; border-style: solid; - padding: 5px; - margin: 2px; + padding: 2px; + margin: 0px; } .whiteborder { From 8faff699dd86517cbcb3bc0f88dced8ed845caab Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 27 Dec 2021 14:44:31 +0100 Subject: [PATCH 07/20] fix font --- rowers/templates/list_workouts.html | 8 ++++---- static/css/rowsandall2.css | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index cf3dca27..19db849e 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -163,13 +163,13 @@ {{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }}
    {% if workout.name != '' %} -

    +

    {{ workout.name }} -

    +

    {% else %} -

    +

    No Name -

    + {% endif %}
    diff --git a/static/css/rowsandall2.css b/static/css/rowsandall2.css index 8efecb58..1aba5066 100644 --- a/static/css/rowsandall2.css +++ b/static/css/rowsandall2.css @@ -332,6 +332,13 @@ th.rotate > div > span { margin: 0px; } + +.divlines h3 { + font-size: 1.2em; + font-weight: bold; + padding: 0px; + margin: 0px; +} .whiteborder { border: solid 2px #aaa; } From fdb706ca580128d13d23e2b7becd882d75b1c9e1 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 27 Dec 2021 19:24:40 +0100 Subject: [PATCH 08/20] removing onlyranking --- rowers/forms.py | 11 +++-------- rowers/urls.py | 4 ---- rowers/views/workoutviews.py | 28 +--------------------------- 3 files changed, 4 insertions(+), 39 deletions(-) diff --git a/rowers/forms.py b/rowers/forms.py index deee532d..cd8015fd 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -1057,9 +1057,7 @@ class AnalysisOptionsForm(forms.Form): waterboattype = forms.MultipleChoiceField(choices=boattypes, label='Water Boat Type', initial = mytypes.waterboattype) - rankingonly = forms.BooleanField(initial=False, - label='Only Ranking Pieces', - required=False) + # form to select modality and boat type for trend flex @@ -1070,17 +1068,14 @@ class TrendFlexModalForm(forms.Form): waterboattype = forms.MultipleChoiceField(choices=boattypes, label='Water Boat Type', initial = mytypes.waterboattype) - rankingonly = forms.BooleanField(initial=False, - label='Only Ranking Pieces', - required=False) + # This form sets options for the summary stats page class StatsOptionsForm(forms.Form): includereststrokes = forms.BooleanField(initial=False,label='Include Rest Strokes',required=False) - rankingonly = forms.BooleanField(initial=False, - label='Only Ranking Pieces',required=False) + water = forms.BooleanField(initial=False,required=False) waterboattype = forms.MultipleChoiceField(choices=boattypes, label='Water Boat Type', diff --git a/rowers/urls.py b/rowers/urls.py index 25bbf732..fdbf58aa 100644 --- a/rowers/urls.py +++ b/rowers/urls.py @@ -261,14 +261,10 @@ urlpatterns = [ views.agegrouprecordview,name='agegrouprecordview'), re_path(r'^agegrouprecords/$', views.agegrouprecordview,name='agegrouprecordview'), - re_path(r'^list-workouts/ranking/$',views.workouts_view,{'rankingonly':True}, - name='workouts_view'), re_path(r'^list-workouts/team/(?P\d+)/$',views.workouts_view, name='workouts_view'), re_path(r'^(?P\d+)/list-workouts/$',views.workouts_view, name='workouts_view'), - re_path(r'^list-workouts/ranking/user/(?P\d+)/$',views.workouts_view,{'rankingonly':True}, - name='workouts_view'), re_path(r'^list-workouts/user/(?P\d+)/$',views.workouts_view, name='workouts_view'), re_path(r'^virtualevents/$',views.virtualevents_view,name='virtualevents_view'), diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index ccb11dea..af4fde3f 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -867,7 +867,6 @@ defaultoptions = { 'includereststrokes': False, 'workouttypes':['rower','dynamic','slides'], 'waterboattype': mytypes.waterboattype, - 'rankingonly': False, 'function':'boxplot' } @@ -901,12 +900,6 @@ def video_selectworkout(request,userid=0): modality = 'all' - - try: - rankingonly = options['rankingonly'] - except KeyError: # pragma: no cover - rankingonly = False - query = request.GET.get('q') if query: # pragma: no cover query_list = query.split() @@ -1002,9 +995,6 @@ def video_selectworkout(request,userid=0): ).exclude(boattype__in=negtypes) - if rankingonly: # pragma: no cover - workouts = workouts.exclude(rankingpiece=False) - startdatestring = startdate.strftime('%Y-%m-%d') enddatestring = enddate.strftime('%Y-%m-%d') request.session['startdate'] = startdatestring @@ -1276,11 +1266,6 @@ def team_comparison_select(request, else: waterboattype = mytypes.waterboattype - if 'rankingonly' in request.session: # pragma: no cover - rankingonly = request.session['rankingonly'] - else: - rankingonly = False - if 'modalities' in request.session: modalities = request.session['modalities'] if len(modalities) > 1: # pragma: no cover @@ -1314,11 +1299,6 @@ def team_comparison_select(request, waterboattype = [b[0] for b in mytypes.boattypes] - if 'rankingonly' in modalityform.cleaned_data: - rankingonly = modalityform.cleaned_data['rankingonly'] - else: # pragma: no cover - rankingonly = False - request.session['modalities'] = modalities request.session['waterboattype'] = waterboattype else: @@ -1329,7 +1309,6 @@ def team_comparison_select(request, modalityform = TrendFlexModalForm(initial={ 'modality':modality, 'waterboattype':waterboattype, - 'rankingonly':rankingonly, }) @@ -1388,8 +1367,6 @@ def team_comparison_select(request, startdatetime__lte=enddate, workouttype__in=modalities).order_by("-date", "-starttime").exclude(boattype__in=negtypes) - if rankingonly: # pragma: no cover - workouts = workouts.exclude(rankingpiece=False) query = request.GET.get('q') if query: # pragma: no cover @@ -2208,7 +2185,7 @@ def multi_compare_view(request,id=0,userid=0): # List Workouts @login_required() def workouts_view(request,message='',successmessage='', - teamid=0,rankingonly=False,rowerid=0,userid=0): + teamid=0,rowerid=0,userid=0): startdate,enddate = get_dates_timeperiod(request,defaulttimeperiod='lastyear') request.session['referer'] = absolute(request)['PATH'] @@ -2333,8 +2310,6 @@ def workouts_view(request,message='',successmessage='', g_startdate = (timezone.now()-timedelta(days=15)) - if rankingonly: - workouts = workouts.exclude(rankingpiece=False) workoutsnohr = workouts.exclude(averagehr__isnull=False) for w in workoutsnohr: # pragma: no cover @@ -2413,7 +2388,6 @@ def workouts_view(request,message='',successmessage='', 'enddate':enddate, 'announcements':announcements[0:4], 'team':theteam, - 'rankingonly':rankingonly, 'teams':get_my_teams(request.user), 'interactiveplot':script, 'the_div':div, From 99cce5dc0c0346410c816d0b4ed531d10d5a4750 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 27 Dec 2021 20:06:46 +0100 Subject: [PATCH 09/20] removing tests for ranking --- rowers/templates/list_workouts.html | 36 ----------------------------- rowers/tests/test_analysis.py | 7 ------ rowers/tests/test_urls.py | 2 -- rowers/views/analysisviews.py | 15 ------------ 4 files changed, 60 deletions(-) diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index 19db849e..64aa921e 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -12,32 +12,6 @@ type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'> - {% endblock %} @@ -100,16 +74,6 @@

    - {% if rankingonly and not team %} - - Show All Workouts - - {% elif not team %} - - Show Only Ranking Pieces - - {% endif %} -

    {% if workouts.has_previous %} diff --git a/rowers/tests/test_analysis.py b/rowers/tests/test_analysis.py index 819ab6a8..d0025d6a 100644 --- a/rowers/tests/test_analysis.py +++ b/rowers/tests/test_analysis.py @@ -298,7 +298,6 @@ class WorkoutCompareTestNew(TestCase): 'includereststrokes':False, 'modality':'all', 'waterboattype':['1x','2x','4x'], - 'rankingonly':False, 'workouts':[1,2,3] } @@ -396,7 +395,6 @@ class WorkoutBoxPlotTestNew(TestCase): 'includereststrokes':False, 'modality':'all', 'waterboattype':['1x','2x','4x'], - 'rankingonly':False, 'workouts':[1,2,3] } @@ -494,7 +492,6 @@ class WorkoutHistoTestNew(TestCase): 'includereststrokes':False, 'modality':'all', 'waterboattype':['1x','2x','4x'], - 'rankingonly':False, 'workouts':[1,2,3] } @@ -779,7 +776,6 @@ class WorkoutFlexallTestNew(TestCase): 'includereststrokes':False, 'modality':'all', 'waterboattype':['1x','2x','4x'], - 'rankingonly':False, 'workouts':[1,2,3] } @@ -884,7 +880,6 @@ class WorkoutStatsTestNew(TestCase): 'includereststrokes':False, 'modality':'all', 'waterboattype':['1x','2x','4x'], - 'rankingonly':False, 'ids':[1,2,3], 'userid':self.u.id, } @@ -947,7 +942,6 @@ class WorkoutStatsTestNew(TestCase): 'includereststrokes':False, 'modality':'all', 'waterboattype':['1x','2x','4x'], - 'rankingonly':False, 'ids':[1,2,3], 'userid':self.u.id, 'function':'boxplot' @@ -1019,7 +1013,6 @@ class WorkoutStatsTestNew(TestCase): 'includereststrokes':False, 'modality':'all', 'waterboattype':['1x','2x','4x'], - 'rankingonly':False, 'workouts':[1,2,3] } diff --git a/rowers/tests/test_urls.py b/rowers/tests/test_urls.py index c34057d8..bd1fc5b1 100644 --- a/rowers/tests/test_urls.py +++ b/rowers/tests/test_urls.py @@ -93,7 +93,6 @@ class URLTests(TestCase): '/rowers/list-graphs/', '/rowers/list-jobs/', '/rowers/list-workouts/', - '/rowers/list-workouts/ranking/', '/rowers/list-workouts/user/1/', '/rowers/me/calcdps/', '/rowers/me/edit/', @@ -157,7 +156,6 @@ class URLTests(TestCase): '/rowers/workout/'+encoded1+'/split/', '/rowers/workout/'+encoded1+'/stats/', '/rowers/workout/'+encoded1+'/stream/', - '/rowers/workout/'+encoded1+'/toggle-ranking/', '/rowers/workout/'+encoded1+'/undosmoothenpace/', '/rowers/workout/'+encoded1+'/unsubscribe/', '/rowers/workout/'+encoded1+'/view/', diff --git a/rowers/views/analysisviews.py b/rowers/views/analysisviews.py index 9f62d9bf..3323fb9b 100644 --- a/rowers/views/analysisviews.py +++ b/rowers/views/analysisviews.py @@ -26,7 +26,6 @@ defaultoptions = { 'includereststrokes': False, 'workouttypes':['rower','dynamic','slides'], 'waterboattype': mytypes.waterboattype, - 'rankingonly': False, 'function':'boxplot' } @@ -78,11 +77,6 @@ def analysis_new(request,userid=0,function='boxplot',teamid=0,id=''): worldclass = False - try: - rankingonly = options['rankingonly'] - except KeyError: # pragma: no cover - rankingonly = False - try: includereststrokes = options['includereststrokes'] except KeyError: # pragma: no cover @@ -129,12 +123,6 @@ def analysis_new(request,userid=0,function='boxplot',teamid=0,id=''): if modality != 'water': waterboattype = [b[0] for b in mytypes.boattypes] - - if 'rankingonly' in optionsform.cleaned_data: - rankingonly = optionsform.cleaned_data['rankingonly'] - else: # pragma: no cover - rankingonly = False - options['modalities'] = modalities options['waterboattype'] = waterboattype try: @@ -224,8 +212,6 @@ def analysis_new(request,userid=0,function='boxplot',teamid=0,id=''): ).exclude(boattype__in=negtypes) - if rankingonly: # pragma: no cover - workouts = workouts.exclude(rankingpiece=False) query = request.POST.get('q') if query: # pragma: no cover @@ -257,7 +243,6 @@ def analysis_new(request,userid=0,function='boxplot',teamid=0,id=''): optionsform = AnalysisOptionsForm(initial={ 'modality':modality, 'waterboattype':waterboattype, - 'rankingonly':rankingonly, }) From f7868789e25276aa5d11a5dfe571ddc375e16f76 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 28 Dec 2021 10:14:53 +0100 Subject: [PATCH 10/20] removing older compare functions --- rowers/forms.py | 9 ++ rowers/templates/menu_workout.html | 2 +- rowers/tests/statements.py | 2 +- rowers/urls.py | 15 --- rowers/views/workoutviews.py | 149 ----------------------------- 5 files changed, 11 insertions(+), 166 deletions(-) diff --git a/rowers/forms.py b/rowers/forms.py index deee532d..81dcf643 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -1291,6 +1291,15 @@ class AnalysisChoiceForm(forms.Form): label='Include Rest Strokes') + def __init__(self, *args, **kwargs): + super(AnalysisChoiceForm, self).__init__(*args, **kwargs) + + if 'initial' in kwargs and kwargs['initial']['function'] == 'compare': + self.fields['xaxis'].initial = 'time' + self.fields['yaxis1'].initial = 'hr' + self.fields['plottype'].initial = 'line' + + class BoxPlotChoiceForm(forms.Form): yparam = forms.ChoiceField(choices=parchoices,initial='spm', diff --git a/rowers/templates/menu_workout.html b/rowers/templates/menu_workout.html index e161ca7a..16b38908 100644 --- a/rowers/templates/menu_workout.html +++ b/rowers/templates/menu_workout.html @@ -48,7 +48,7 @@

  • - +  Compare
  • diff --git a/rowers/tests/statements.py b/rowers/tests/statements.py index 7d4f8187..74f2a1b8 100644 --- a/rowers/tests/statements.py +++ b/rowers/tests/statements.py @@ -36,7 +36,7 @@ from django.core.files.uploadedfile import SimpleUploadedFile from io import StringIO from django.test.client import RequestFactory -from rowers.views import c2_open, multi_compare_view +from rowers.views import c2_open from rowers.forms import ( diff --git a/rowers/urls.py b/rowers/urls.py index 25bbf732..6f55af06 100644 --- a/rowers/urls.py +++ b/rowers/urls.py @@ -312,17 +312,6 @@ urlpatterns = [ re_path(r'^standards/upload/(?P\d+)/$',views.standards_upload_view,name='standards_upload_view'), re_path(r'^workout/addmanual/(?P\d+)/$',views.addmanual_view,name='addmanual_view'), re_path(r'^workout/addmanual/$',views.addmanual_view,name='addmanual_view'), - re_path(r'^team-compare-select/workout/(?P\d+)/team/(?P\d+)/user/(?P\d+)/$',views.team_comparison_select,name='team_comparison_select'), - re_path(r'^team-compare-select/workout/(?P\b[0-9A-Fa-f]+\b)/team/(?P\d+)/$',views.team_comparison_select,name='team_comparison_select'), - re_path(r'^team-compare-select/workout/(?P\b[0-9A-Fa-f]+\b)/team/(?P\d+)/$',views.team_comparison_select,name='team_comparison_select'), - re_path(r'^team-compare-select/workout/(?P\b[0-9A-Fa-f]+\b)/team/(?P\d+)/user/(?P\d+)/$',views.team_comparison_select,name='team_comparison_select'), - re_path(r'^team-compare-select/(?P\d+-\d+-\d+)/(?P\d+-\d+-\d+)/$',views.team_comparison_select,name='team_comparison_select'), - re_path(r'^team-compare-select/workout/(?P\b[0-9A-Fa-f]+\b)/user/(?P\d+)/$',views.team_comparison_select,name='team_comparison_select'), - re_path(r'^team-compare-select/team/(?P\d+)/user/(?P\d+)/$',views.team_comparison_select,name='team_comparison_select'), - re_path(r'^team-compare-select/workout/(?P\b[0-9A-Fa-f]+\b)/$',views.team_comparison_select,name='team_comparison_select'), - re_path(r'^team-compare-select/team/(?P\d+)/$',views.team_comparison_select,name='team_comparison_select'), - re_path(r'^team-compare-select/user/(?P\d+)/$',views.team_comparison_select,name='team_comparison_select'), - re_path(r'^team-compare-select/$',views.team_comparison_select,name='team_comparison_select'), re_path(r'^workouts-join/$',views.workouts_join_view,name='workouts_join_view'), re_path(r'^workouts-join/user/(?P\d+)$',views.workouts_join_view,name='workouts_join_view'), re_path(r'^workouts-join-select/$',views.workouts_join_select,name='workouts_join_select'), @@ -522,10 +511,6 @@ urlpatterns = [ re_path(r'^workout/(?P\b[0-9A-Fa-f]+\b)/recalcsummary/$',views.workout_recalcsummary_view,name='workout_recalcsummary_view'), re_path(r'^workout/(?P\b[0-9A-Fa-f]+\b)/sporttracksuploadw/$',views.workout_sporttracks_upload_view,name='workout_sporttracks_upload_view'), re_path(r'^workout/(?P\b[0-9A-Fa-f]+\b)/tpuploadw/$',views.workout_tp_upload_view,name='workout_tp_upload_view'), - re_path(r'^multi-compare/workout/(?P\b[0-9A-Fa-f]+\b)/user/(?P\d+)/$',views.multi_compare_view, - name='multi_compare_view'), - re_path(r'^multi-compare/workout/(?P\b[0-9A-Fa-f]+\b)/$',views.multi_compare_view,name='multi_compare_view'), - re_path(r'^multi-compare/$',views.multi_compare_view,name='multi_compare_view'), re_path(r'^alerts/user/(?P\d+)/$',views.alerts_view,name='alerts_view'), re_path(r'^alerts/$',views.alerts_view,name='alerts_view'), re_path(r'^alerts/(?P\d+)/delete/$',views.AlertDelete.as_view(),name='alert_delete_view'), diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index 00b1e4a5..2a8b783d 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -2055,155 +2055,6 @@ def plannedsession_compare_view(request,id=0,userid=0): return HttpResponseRedirect(url) -# Team comparison -@login_required() -def multi_compare_view(request,id=0,userid=0): - promember=0 - if not request.user.is_anonymous: - r = getrower(request.user) - result = request.user.is_authenticated and ispromember(request.user) - if result: - promember=1 - - if request.method == 'POST' and 'workouts' in request.POST: - form = WorkoutMultipleCompareForm(request.POST) - chartform = ChartParamChoiceForm(request.POST) - if form.is_valid() and chartform.is_valid(): - cd = form.cleaned_data - workouts = cd['workouts'] - xparam = chartform.cleaned_data['xparam'] - yparam = chartform.cleaned_data['yparam'] - plottype = chartform.cleaned_data['plottype'] - teamid = chartform.cleaned_data['teamid'] - ids = [int(w.id) for w in workouts] - request.session['ids'] = ids - - labeldict = { - int(w.id): w.__str__() for w in workouts - } - - else: # pragma: no cover - return HttpResponse("Form is not valid") - elif request.method == 'POST' and 'ids' in request.session: - chartform = ChartParamChoiceForm(request.POST) - if chartform.is_valid(): - xparam = chartform.cleaned_data['xparam'] - yparam = chartform.cleaned_data['yparam'] - plottype = chartform.cleaned_data['plottype'] - teamid = chartform.cleaned_data['teamid'] - ids = request.session['ids'] - request.session['ids'] = ids - workouts = [] - for id in ids: - try: - workouts.append(Workout.objects.get(id=id)) - except Workout.DoesNotExist: # pragma: no cover - pass - - labeldict = { - int(w.id): w.__str__() for w in workouts - } - elif 'ids' in request.session and 'plottype' in request.session: - xparam = request.session['xparam'] - yparam = request.session['yparam'] - plottype = request.session['plottype'] - teamid = 0 - ids = request.session['ids'] - workouts = [] - for id in ids: - try: - workouts.append(Workout.objects.get(id=id)) - except Workout.DoesNotExist: # pragma: no cover - pass - - labeldict = { - int(w.id): w.__str__() for w in workouts - } - chartform = ChartParamChoiceForm( - initial = { - 'xparam':xparam, - 'yparam':yparam, - 'plottype':plottype, - 'teamid':teamid - } - ) - - else: - url = reverse('team_comparison_select', - kwargs={ - 'id':id, - 'teamid':0}) - return HttpResponseRedirect(url) - - - res = interactive_multiple_compare_chart(ids,xparam,yparam, - promember=promember, - plottype=plottype, - labeldict=labeldict) - script = res[0] - div = res[1] - errormessage = res[3] - if errormessage != '': # pragma: no cover - messages.error(request,errormessage) - - r = getrower(request.user) - - breadcrumbs = [ - { - 'url':'/rowers/list-workouts/', - 'name':'Workouts' - }, - { - 'url':reverse('team_comparison_select',kwargs={'teamid':teamid}), - 'name': 'Compare Select' - }, - { - 'url':reverse('multi_compare_view'), - 'name': 'Comparison Chart' - } - ] - - if 'ps' in request.session: # pragma: no cover - ps = PlannedSession.objects.get(id=int(request.session['ps'])) - breadcrumbs = [ - { - 'url': reverse('plannedsessions_view', - kwargs={'userid':userid}), - 'name': 'Sessions' - }, - { - 'url':reverse('plannedsession_view', - kwargs={ - 'userid':userid, - 'id':ps.id, - } - ), - 'name': ps.id - }, - { - 'url':reverse('plannedsession_compare_view', - kwargs={ - 'userid':userid, - 'id':ps.id, - } - ), - 'name': 'Compare' - } - ] - - - return render(request,'multicompare.html', - {'interactiveplot':script, - 'the_div':div, - 'breadcrumbs':breadcrumbs, - 'rower':r, - 'active':'nav-workouts', - 'promember':promember, - 'teamid':teamid, - 'chartform':chartform, - 'teams':get_my_teams(request.user), - }) - # List Workouts @login_required() From a5c33a8fac9ecf0848c7e418c9b4a8fd7de12806 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 28 Dec 2021 10:21:24 +0100 Subject: [PATCH 11/20] removing obsolete tests --- rowers/tests/test_aworkouts.py | 64 ---------------------------------- rowers/tests/test_team.py | 64 ---------------------------------- rowers/tests/test_urls.py | 2 -- rowers/tests/viewnames.csv | 2 -- 4 files changed, 132 deletions(-) diff --git a/rowers/tests/test_aworkouts.py b/rowers/tests/test_aworkouts.py index 5754eaaa..b9f6f85f 100644 --- a/rowers/tests/test_aworkouts.py +++ b/rowers/tests/test_aworkouts.py @@ -214,70 +214,6 @@ class WorkoutViewTest(TestCase): expected_url=expected_url, status_code=302,target_status_code=200) - @patch('rowers.dataprep.create_engine') - @patch('rowers.dataprep.getsmallrowdata_db') - @patch('rowers.middleware.myqueue') - def test_compares(self, mocked_sqlalchemy, mocked_getsmallrowdata_db, - mocked_myqueue): - login = self.c.login(username=self.u.username, password=self.password) - self.assertTrue(login) - - - session = self.c.session - session['ids'] = [self.werg1.id,self.werg2.id] - session.save() - - response = self.c.get('/') - - url = reverse('team_comparison_select') - response = self.c.get(url) - self.assertEqual(response.status_code,200) - - d1 = self.werg1.date-datetime.timedelta(days=2) - d2 = self.werg2.date+datetime.timedelta(days=2) - - form_data = { - 'startdate': d1.strftime('%Y-%m-%d'), - 'enddate': d2.strftime('%Y-%m-%d'), - 'modality':'water', - 'waterboattype':['1x'], - } - - form = DateRangeForm(form_data) - self.assertTrue(form.is_valid()) - - form = TrendFlexModalForm(form_data) - self.assertTrue(form.is_valid()) - - response = self.c.post(url,form_data) - self.assertEqual(response.status_code,200) - - url = reverse('multi_compare_view',kwargs={ - 'userid':self.u.id, - 'id':encoder.encode_hex(self.werg1.id), - }) - - form_data = { - 'xparam':'time', - 'yparam':'power', - 'plottype':'line', - 'teamid': '', - } - - - response = self.c.post(url,form_data,follow=True) - self.assertEqual(response.status_code,200) - - session['plottype'] = 'scatter' - session['xparam'] = 'time' - session['yparam'] = 'hr' - - session.save() - - response = self.c.get('/') - - response = self.c.get(url,follow=True) - self.assertEqual(response.status_code,200) @patch('rowers.dataprep.create_engine') @patch('rowers.dataprep.getsmallrowdata_db') diff --git a/rowers/tests/test_team.py b/rowers/tests/test_team.py index ae4a0687..10c43b91 100644 --- a/rowers/tests/test_team.py +++ b/rowers/tests/test_team.py @@ -169,70 +169,6 @@ class TeamTest(TestCase): response = self.c.get(url) self.assertEqual(response.status_code, 200) - @patch('rowers.dataprep.create_engine') - @patch('rowers.dataprep.getsmallrowdata_db') - @patch('rowers.middleware.myqueue') - def test_compares(self, mocked_sqlalchemy, mocked_getsmallrowdata_db, - mocked_myqueue): - login = self.c.login(username=self.u.username, password=self.password) - self.assertTrue(login) - - - session = self.c.session - session['ids'] = [self.werg1.id,self.werg2.id] - session.save() - - response = self.c.get('/') - - url = reverse('team_comparison_select',kwargs={'teamid':self.t.id}) - response = self.c.get(url) - self.assertEqual(response.status_code,200) - - d1 = self.werg1.date-timedelta(days=2) - d2 = self.werg2.date+timedelta(days=2) - - form_data = { - 'startdate': d1.strftime('%Y-%m-%d'), - 'enddate': d2.strftime('%Y-%m-%d'), - 'modality':'water', - 'waterboattype':['1x'], - } - - form = DateRangeForm(form_data) - self.assertTrue(form.is_valid()) - - form = TrendFlexModalForm(form_data) - self.assertTrue(form.is_valid()) - - response = self.c.post(url,form_data) - self.assertEqual(response.status_code,200) - - url = reverse('multi_compare_view',kwargs={ - 'userid':self.u.id, - 'id':encoder.encode_hex(self.werg1.id), - }) - - form_data = { - 'xparam':'time', - 'yparam':'power', - 'plottype':'line', - 'teamid': '', - } - - - response = self.c.post(url,form_data,follow=True) - self.assertEqual(response.status_code,200) - - session['plottype'] = 'scatter' - session['xparam'] = 'time' - session['yparam'] = 'hr' - - session.save() - - response = self.c.get('/') - - response = self.c.get(url,follow=True) - self.assertEqual(response.status_code,200) def test_teamsview(self): diff --git a/rowers/tests/test_urls.py b/rowers/tests/test_urls.py index c34057d8..1baeb62d 100644 --- a/rowers/tests/test_urls.py +++ b/rowers/tests/test_urls.py @@ -125,8 +125,6 @@ class URLTests(TestCase): '/rowers/sessions/multicreate/', '/rowers/sessions/print/', '/rowers/sessions/teamcreate/', - '/rowers/team-compare-select/', - '/rowers/team-compare-select/workout/'+encoded1+'/', '/rowers/workout/'+encoded1+'/', '/rowers/workout/'+encoded1+'/adddistanceplot/', '/rowers/workout/'+encoded1+'/adddistanceplot2/', diff --git a/rowers/tests/viewnames.csv b/rowers/tests/viewnames.csv index a9b88233..34c2b7cd 100644 --- a/rowers/tests/viewnames.csv +++ b/rowers/tests/viewnames.csv @@ -23,7 +23,6 @@ 22,24,courses_view,see race courses,TRUE,200,FALSE,200,302,FALSE,200,302,FALSE,200,302,FALSE,FALSE,FALSE,TRUE,TRUE, 23,25,course_upload_view,upload a new course,TRUE,302,basic,200,302,FALSE,200,302,FALSE,200,302,FALSE,FALSE,FALSE,TRUE,TRUE, 24,26,addmanual_view,upload a manual workout,TRUE,302,basic,200,302,basic,200,302,coach,200,302,FALSE,FALSE,FALSE,TRUE,TRUE, -25,27,team_comparison_select,compare with a team member workout,TRUE,302,pro,200,302,pro,200,302,coach,200,302,FALSE,TRUE,TRUE,TRUE,TRUE, 26,28,workouts_join_view,join workouts,TRUE,302,pro,302,302,pro,403,403,coach,302,403,FALSE,TRUE,FALSE,TRUE,TRUE, 27,29,workouts_join_select,select workouts to join,TRUE,404,pro,200,302,pro,403,403,coach,200,403,FALSE,TRUE,FALSE,TRUE,TRUE, 29,31,analysis_new,analysis front page,TRUE,302,pro,200,302,FALSE,200,302,coach,200,302,FALSE,TRUE,FALSE,TRUE,TRUE, @@ -97,7 +96,6 @@ 111,137,workout_recalcsummary_view,recalculates workout summary,TRUE,403,basic,302,403,basic,403,403,coach,302,403,FALSE,FALSE,TRUE,TRUE,TRUE, 112,138,workout_sporttracks_upload_view,uploads workout to C2,TRUE,200,basic,200,302,basic,200,302,coach,200,302,FALSE,FALSE,TRUE,FALSE,FALSE, 115,141,workout_tp_upload_view,uploads workout to C2,TRUE,200,basic,200,302,basic,200,302,coach,200,302,FALSE,FALSE,TRUE,FALSE,FALSE, -116,142,multi_compare_view,compare workouts ,TRUE,302,basic,302,403,basic,302,403,coach,302,302,FALSE,FALSE,TRUE,TRUE,TRUE, 117,145,alerts_view,view alerts,TRUE,302,basic,200,403,basic,403,403,coach,200,302,FALSE,TRUE,FALSE,TRUE,TRUE, 118,147,AlertDelete,delete alert,TRUE,200,basic,200,302,basic,200,302,coach,200,302,FALSE,FALSE,FALSE,FALSE,FALSE, 119,148,alert_edit_view,edit alert,TRUE,200,basic,200,302,basic,200,302,coach,200,302,FALSE,FALSE,FALSE,FALSE,FALSE, From f90ab8ea3a1e00dbe4eb9a6f6a73e996c72dd725 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 28 Dec 2021 10:33:12 +0100 Subject: [PATCH 12/20] removing more obsolete tests --- rowers/tests/test_analysis.py | 64 ----------------------------------- 1 file changed, 64 deletions(-) diff --git a/rowers/tests/test_analysis.py b/rowers/tests/test_analysis.py index 819ab6a8..bca8a55a 100644 --- a/rowers/tests/test_analysis.py +++ b/rowers/tests/test_analysis.py @@ -11,70 +11,6 @@ nu = datetime.datetime.now() from rowers.views import * from rowers.views.analysisviews import histodata -class WorkoutCompareTest(TestCase): - def setUp(self): - self.u = UserFactory() - - self.r = Rower.objects.create(user=self.u, - birthdate=faker.profile()['birthdate'], - gdproptin=True,surveydone=True, - gdproptindate=timezone.now(), - rowerplan='coach') - - self.c = Client() - self.user_workouts = WorkoutFactory.create_batch(5, user=self.r) - self.factory = RequestFactory() - self.password = faker.word() - self.u.set_password(self.password) - self.u.save() - - def tearDown(self): - for workout in self.user_workouts: - try: - os.remove(workout.csvfilename) - except (IOError, FileNotFoundError, OSError): - pass - - @patch('rowers.dataprep.create_engine') - @patch('rowers.dataprep.getsmallrowdata_db') - def test_workouts_compare(self, mocked_sqlalchemy, - mocked_getsmallrowdata_db): - - login = self.c.login(username=self.u.username, password=self.password) - self.assertTrue(login) - - url = '/rowers/team-compare-select/workout/'+encoded1+'/team/0/user/1/' - - response = self.c.get(url) - self.assertEqual(response.status_code,200) - - @patch('rowers.dataprep.create_engine') - @patch('rowers.dataprep.getsmallrowdata_db', side_effect=mocked_getsmallrowdata_db) - def test_workouts_compare_submit(self, mocked_sqlalchemy, - mocked_getsmallrowdata_db): - - login = self.c.login(username=self.u.username,password=self.password) - self.assertTrue(login) - - form_data = { - 'chartform':'Compare', - 'plottype':'scatter', - 'teamid':0, - 'workouts':['1','2','3'], - 'xparam':'distance', - 'yparam':'hr', - } - - form = WorkoutMultipleCompareForm(form_data) - chartform = ChartParamChoiceForm(form_data) - self.assertTrue(form.is_valid()) - self.assertTrue(chartform.is_valid()) - - response = self.c.post('/rowers/multi-compare/',form_data) - - self.assertEqual(response.status_code,200) - - class ListWorkoutTest(TestCase): From 222c9afa50a9f0d8e2bafcff73f23d6ea4239482 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 28 Dec 2021 10:43:30 +0100 Subject: [PATCH 13/20] fixed menu --- rowers/templates/menu_workouts.html | 4 ++-- rowers/tests/testdata/testdata.tcx.gz | Bin 0 -> 4001 bytes 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 rowers/tests/testdata/testdata.tcx.gz diff --git a/rowers/templates/menu_workouts.html b/rowers/templates/menu_workouts.html index 4d0e2d02..93b4d31a 100644 --- a/rowers/templates/menu_workouts.html +++ b/rowers/templates/menu_workouts.html @@ -10,10 +10,10 @@
  • {% if team %} - +  Compare {% else %} - +  Compare {% endif %}
  • diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz new file mode 100644 index 0000000000000000000000000000000000000000..168c1261e098b1ce5496a56c4a9dbd82b815bdde GIT binary patch literal 4001 zcmV;S4_@#eiwFor+R9-9|8!+@bYx+4VJ>uIcmVC4TW=dT7J%RLD-1uh4~tUg!o!Q} zx@eOwHbBxX+MwIF#ne_E?b@;-O)mZSOG>HZBp$TK-XS;x<{_{~bJKit$aClM*KaQ` z4qh)e+tt{c`i9>$_jO?eZY)yxx9w__FV>j~0tJ zZ{C>mZgaU>o71byMf!4k`f_>MZ5MYRzIaWC`%@fsZ~wwszB%nzuUGx=-@WaZ>wJT^ zPVjcS`rr(2*j#PS7X*NdU!FhvX?Kb*R_krwtxuQfsO{=#f8J+Tr(M7MwfDM#1N~92 z$-Ld3{rQ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hA?dg+XU-evSrW!HP;qBVEWjJr|LN8?eMhwrIu2?n&F?HK5hazhoR)N|Pq3}`{y zQP4|ns6slaw^B562Tjcz1${6q7<5uEu4t-8Q}aeaPsz9=WorfRTyx}3-K7(A%S6zw zY3se8%v?_`Xgi2L7g;l?!Z$wnX4lUEeKeA+JDt==KN-88nwmF+p2>){y6{ba(Cqpd zpqE^D1v>Ot6n$PQs15idpbrKZb^Y)|PTrpgdTQRhA@q4AYrvpG&v7#7+xqpx=-C7z zUF0skC?z%g+=-&09|65Ho^4dQbb`Z@E}dDSmx|EGyrwPaq~2rE0pGV0j4{v)8D}x5 zvUEZyT50LPa$iY|6GD-FMvEFFQ} zO4fj0<;aaFlX2-l>zg--ez%gfZk@YGWrMcR=K4|4`&@maM9+RQt6R3Yeh__L$(oT= z-n?ji(drv&ee*^^&$~s;RmNSE*jBfkxHm7Oce(INiQdJcQr{Y-j)Okt!YiF!9|N@J zX%qM6CG@+Mtd)_w7_oK6o&kDm(oC;f0EGZrkKFsB_hX@dxAl(=$BSp(_05OxulnWo zKAV&8OA= z`{T!(#PMqLZr|^_^!9A7-fX+|S$A=84M9TwW}@?J{x5pWZ#XTlaPRtXrQyeRA^M_nFP^&;9lv z(p&uftIJ=P>COPY0NDS3ytwtn{>kqi)5)V9>eV_uhsO!!a`PlTjbGEHPagdbzIRor H#DD<+Fv>s- literal 0 HcmV?d00001 From 045e04e0c09ff7c203fc1895cc20d4db272d51b5 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 28 Dec 2021 12:55:01 +0100 Subject: [PATCH 14/20] more refs to old page removed --- rowers/templates/menu_other.html | 6 +- rowers/templates/menu_workouts.html | 4 +- rowers/templates/team_compare_select.html | 144 ---------------------- rowers/templates/teambuttons.html | 2 +- rowers/tests/test_plans.py | 11 +- rowers/tests/testdata/testdata.tcx.gz | Bin 4001 -> 4000 bytes rowers/urls.py | 3 + rowers/views/analysisviews.py | 12 +- rowers/views/workoutviews.py | 9 +- 9 files changed, 36 insertions(+), 155 deletions(-) delete mode 100644 rowers/templates/team_compare_select.html diff --git a/rowers/templates/menu_other.html b/rowers/templates/menu_other.html index 71789d84..f56facfa 100644 --- a/rowers/templates/menu_other.html +++ b/rowers/templates/menu_other.html @@ -10,9 +10,11 @@
  • {% if team %} -  Compare + +  Compare {% else %} -  Compare + +  Compare {% endif %}
  • diff --git a/rowers/templates/menu_workouts.html b/rowers/templates/menu_workouts.html index 93b4d31a..24c0bc8f 100644 --- a/rowers/templates/menu_workouts.html +++ b/rowers/templates/menu_workouts.html @@ -10,10 +10,10 @@
  • {% if team %} - +  Compare {% else %} - +  Compare {% endif %}
  • diff --git a/rowers/templates/team_compare_select.html b/rowers/templates/team_compare_select.html deleted file mode 100644 index 19140d18..00000000 --- a/rowers/templates/team_compare_select.html +++ /dev/null @@ -1,144 +0,0 @@ -{% extends "newbase.html" %} -{% load static %} -{% load rowerfilters %} - -{% block title %}Workouts{% endblock %} - -{% block main %} - - - - - -

    {{ team.name }} Compare Workouts

    - - -
      -
    • -

      Select two or more workouts on the left, set your plot settings, - and press submit

      -

      - You can use the date and search forms to search through all - workouts from this team. -

      -

      - 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. -

      -
    • -
    • -
      - - {{ dateform.as_table }} -
      - - {{ modalityform.as_table }} -
      - {% csrf_token %} -

      - -

      -
      -
    • -
    • -
      - {{ searchform }} - -
      -
    • -
    • - {% if workouts %} -
      - - Toggle All
      - - - {{ form.as_table }} -
      - - {% else %} -

      No workouts found

      - {% endif %} -
    • -
    • -

      - {% csrf_token %} - - {{ chartform.as_table }} -
      -

      -

      - -

      - -
    • -
    - -{% endblock %} - -{% block sidebar %} -{% include 'menu_workouts.html' %} -{% endblock %} diff --git a/rowers/templates/teambuttons.html b/rowers/templates/teambuttons.html index e45b807e..828d1769 100644 --- a/rowers/templates/teambuttons.html +++ b/rowers/templates/teambuttons.html @@ -6,7 +6,7 @@
    diff --git a/rowers/tests/test_plans.py b/rowers/tests/test_plans.py index f6f5b73f..cc5de299 100644 --- a/rowers/tests/test_plans.py +++ b/rowers/tests/test_plans.py @@ -16,6 +16,7 @@ from django.db import transaction import json from rowers.views.workoutviews import plannedsession_compare_view +from rowers.views.analysisviews import analysis_new from rowers.views.otherviews import download_fit from rowers.opaque import encoder from django.utils.crypto import get_random_string @@ -443,7 +444,11 @@ class SessionLinkTest(TestCase): url = reverse(plannedsession_compare_view,kwargs={'id':ps.id,'userid':self.u.id}) response = self.c.get(url,follow=True) - expected_url = reverse('multi_compare_view',kwargs={'userid':self.u.id,'id':encoder.encode_hex(w.id)}) + expected_url = reverse('analysis_new', + kwargs={'function':'compare', + 'id':encoder.encode_hex(w.id), + 'session':ps.id, + }) self.assertRedirects(response,expected_url=expected_url, status_code=302,target_status_code=200) @@ -473,7 +478,7 @@ class SessionLinkTest(TestCase): session.save() request.user = self.u - response = multi_compare_view(request,id=str(w.id)) + response = analysis_new(request,id=encoder.encode_hex(w.id)) self.assertEqual(response.status_code,200) # and adding a get @@ -491,7 +496,7 @@ class SessionLinkTest(TestCase): session.save() request.user = self.u - response = multi_compare_view(request,id=str(w.id)) + response = analysis_new(request,id=encoder.encode_hex(w.id)) self.assertEqual(response.status_code,200) diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz index 168c1261e098b1ce5496a56c4a9dbd82b815bdde..d0b9235f8e8ec37e6ad81ee04f4a3522d3e02985 100644 GIT binary patch literal 4000 zcmV;R4`1*fiwFqD_sU@c|8!+@bYx+4VJ>uIcmVC4TW=Ic7J%RR6&4T4!-|@7sZ$rn zI3keMA^{r(l+D|!ViX@kz0nQq>5qCt z=H2GyUmy7Qu7B8_oL#Jzo5dUa>;3=i`lH?c%gamQw_R!w&`l5B{l>e8clP!UK0JW* zGxEnz8{Y3dKR>(Z@8A7r|7v-0clTxb`ti#{0(AF4?h(8|-nY0<&O}EX;co!@00)b- z)5ravbmx1|`|hHDu{vGezx!9mUS232`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Ror H#DD<+Fv>s- diff --git a/rowers/urls.py b/rowers/urls.py index 6f55af06..cffc7775 100644 --- a/rowers/urls.py +++ b/rowers/urls.py @@ -316,9 +316,12 @@ urlpatterns = [ re_path(r'^workouts-join/user/(?P\d+)$',views.workouts_join_view,name='workouts_join_view'), re_path(r'^workouts-join-select/$',views.workouts_join_select,name='workouts_join_select'), re_path(r'^workouts-join-select/user/(?P\d+)/$',views.workouts_join_select,name='workouts_join_select'), + re_path(r'^user-analysis-select/(?P\w.*)/team/(?P\d+)/workout/(?P\b[0-9A-Fa-f]+\b)/$',views.analysis_new,name='analysis_new'), + re_path(r'^user-analysis-select/(?P\w.*)/session/(?P\d+)/workout/(?P\b[0-9A-Fa-f]+\b)/$',views.analysis_new,name='analysis_new'), re_path(r'^user-analysis-select/(?P\w.*)/workout/(?P\b[0-9A-Fa-f]+\b)/$',views.analysis_new,name='analysis_new'), re_path(r'^user-analysis-select/(?P\w.*)/user/(?P\d+)/$',views.analysis_new,name='analysis_new'), re_path(r'^user-analysis-select/(?P\w.*)/team/(?P\d+)/$',views.analysis_new,name='analysis_new'), + re_path(r'^user-analysis-select/team/(?P\d+)/workout/(?P\b[0-9A-Fa-f]+\b)/$',views.analysis_new,name='analysis_new'), re_path(r'^user-analysis-select/user/(?P\d+)/$',views.analysis_new,name='analysis_new'), re_path(r'^user-analysis-select/team/(?P\d+)/$',views.analysis_new,name='analysis_new'), re_path(r'^user-analysis-select/(?P\w.*)/$',views.analysis_new,name='analysis_new'), diff --git a/rowers/views/analysisviews.py b/rowers/views/analysisviews.py index 9f62d9bf..03af6174 100644 --- a/rowers/views/analysisviews.py +++ b/rowers/views/analysisviews.py @@ -8,6 +8,7 @@ from rowers.views.statements import * import collections import simplejson from jinja2 import Template,Environment,FileSystemLoader +from rowers.rower_rules import can_view_session def floatformat(x,prec=2): # pragma: no cover return '{x}'.format(x=round(x,prec)) @@ -35,7 +36,7 @@ defaultoptions = { message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) @permission_required('rower.is_coach',fn=get_user_by_userid,raise_exception=True) -def analysis_new(request,userid=0,function='boxplot',teamid=0,id=''): +def analysis_new(request,userid=0,function='boxplot',teamid=0,id='',session=0): r = getrequestrower(request, userid=userid) user = r.user userid = user.id @@ -53,6 +54,13 @@ def analysis_new(request,userid=0,function='boxplot',teamid=0,id=''): except Team.DoesNotExist: theteam = None + try: + thesession = PlannedSession.objects.get(id=session) + if not can_view_session(user,thesession): + raise PermissionDenied("you cannot view this session") + except PlannedSession.DoesNotExist: + thesession = None + if 'options' in request.session: options = request.session['options'] @@ -211,6 +219,8 @@ def analysis_new(request,userid=0,function='boxplot',teamid=0,id=''): startdatetime__lte=enddate, workouttype__in=modalities, ) + elif thesession is not None: + workouts = get_workouts_session(r,thesession) else: workouts = Workout.objects.filter(user=r, startdatetime__gte=startdate, diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index 2a8b783d..5bdc17ef 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -2047,9 +2047,14 @@ def plannedsession_compare_view(request,id=0,userid=0): request.session['plottype'] = plottype request.session['ps'] = ps.id + teams = ps.team.all() + if ids: - url = reverse('multi_compare_view', - kwargs={'userid':userid,'id':encoder.encode_hex(ids[0])}) + url = reverse('analysis_new', + kwargs={ + 'session':ps.id, + 'id':encoder.encode_hex(ids[0]), + 'function':'compare'}) else: url = reverse('plannedsession_view',kwargs={'id':ps.id}) From 47a56b0cc4e426bc53d0573f4dd56d661c7d5aed Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 28 Dec 2021 13:06:37 +0100 Subject: [PATCH 15/20] solves #465 --- rowers/templates/coachrequestemail.html | 5 ++- rowers/templates/teams.html | 50 ++++++++++++------------ rowers/tests/testdata/testdata.tcx.gz | Bin 4000 -> 0 bytes 3 files changed, 29 insertions(+), 26 deletions(-) delete mode 100644 rowers/tests/testdata/testdata.tcx.gz diff --git a/rowers/templates/coachrequestemail.html b/rowers/templates/coachrequestemail.html index 19965e7a..58e641b6 100644 --- a/rowers/templates/coachrequestemail.html +++ b/rowers/templates/coachrequestemail.html @@ -13,13 +13,14 @@ on behalf of {{ name }}.

    - By accepting the invite, you are agreeing with the sharing + By accepting the invite, you are agreeing with the sharing of personal data according to our privacy policy.

    To accept the login to the site and you will find the invitation here on the Teams page: - {{ siteurl }}/rowers/me/teams + {{ siteurl }}/rowers/me/teams, + including the email address of {{ name }}, if you need a contact.

    You can also click the direct link: diff --git a/rowers/templates/teams.html b/rowers/templates/teams.html index 22e6ef47..be96301f 100644 --- a/rowers/templates/teams.html +++ b/rowers/templates/teams.html @@ -21,7 +21,7 @@ {{ team.name }} - Leave + Leave {% endfor %} @@ -29,7 +29,7 @@ {% endif %} - + {% if otherteams %}

  • Open Groups

    @@ -73,7 +73,7 @@ {{ team.name }} - Delete + Delete {% endfor %} @@ -98,7 +98,7 @@ {{ coach.user.first_name }} {{ coach.user.last_name }} - Remove @@ -124,7 +124,7 @@ {{ coachee.user.first_name }} {{ coachee.user.last_name }} - Remove @@ -138,11 +138,11 @@
  • Group Invitations and Requests

    This section lists open invites to join a group. By accepting - a group invite, you are agreeing with the sharing + a group invite, you are agreeing with the sharing of personal data between group members and coaches according to our privacy policy.

    - +

    As a group manager, by accepting a group invite, you are agreeing with our privacy policy regarding groups and personal data owned by group members.

    @@ -163,10 +163,10 @@ {{ i.team.name }} {{ i.team.manager.first_name }} {{ i.team.manager.last_name }} {{ user.first_name }} {{ user.last_name }} - Accept + Accept - Reject + Reject {% endfor %} @@ -184,9 +184,9 @@ {{ i.team.name }} {{ i.team.manager.first_name }} {{ i.team.manager.last_name }} {{ i.user.first_name }} {{ i.user.last_name }} - Accept + Accept - Reject + Reject {% endfor %} @@ -201,7 +201,7 @@ {% endif %}   - Revoke + Revoke {% endfor %} @@ -218,7 +218,7 @@ {{ form.as_table }}
    - + {% endif %} {% if mycoachrequests or mycoachoffers or coachoffers or coachrequests %} @@ -226,16 +226,17 @@

    Coaching Offers and Requests

    This section lists open offers and requests related to coaching. By accepting a coaching offer, the coach can run - analysis, add workouts and edit settings on behalf of the athlete. + analysis, add workouts and edit settings on behalf of the athlete. You agree to the sharing of personal data between athletes and coaches according to our privacy policy. -

    +

    + @@ -245,12 +246,13 @@ + {% endfor %} @@ -261,7 +263,7 @@ {% endfor %} @@ -272,7 +274,7 @@ @@ -282,12 +284,12 @@ @@ -312,14 +314,14 @@ {% endfor %}
    Coach UserE-mail Action  
    {{ i.coach.user.first_name }} {{ i.coach.user.last_name }} {{ i.user.first_name }} {{ i.user.last_name }}{{ i.user.email }} Accept - Reject + Reject
      - Revoke + Revoke
      Revoke
    {{ i.coach.user.first_name }} {{ i.coach.user.last_name }} {{ i.user.first_name }} {{ i.user.last_name }} Accept Reject
    {{ a.user.first_name }} {{ a.user.last_name }} Offer Coaching
    -
  • + {% endif %} {% if potentialcoaches %}
  • @@ -337,7 +339,7 @@ {{ c.first_name }} {{ c.last_name }} Request Coaching diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz deleted file mode 100644 index d0b9235f8e8ec37e6ad81ee04f4a3522d3e02985..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4000 zcmV;R4`1*fiwFqD_sU@c|8!+@bYx+4VJ>uIcmVC4TW=Ic7J%RR6&4T4!-|@7sZ$rn zI3keMA^{r(l+D|!ViX@kz0nQq>5qCt z=H2GyUmy7Qu7B8_oL#Jzo5dUa>;3=i`lH?c%gamQw_R!w&`l5B{l>e8clP!UK0JW* zGxEnz8{Y3dKR>(Z@8A7r|7v-0clTxb`ti#{0(AF4?h(8|-nY0<&O}EX;co!@00)b- z)5ravbmx1|`|hHDu{vGezx!9mUS232`r@qbPV!;Tmq%yomzzUjf3Wy!>!$-At#)tF z(`EXxn{=P~UcT7)Y44Bt4iUq_;_}m{9Udf6>yDTISf;!Gwdds{rTw%i)$`%A zh`Z(nuDQgOuOF|suWJAPaQjv)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in.html | 25 ++++++++++++++++--------- rowers/tests/testdata/testdata.tcx.gz | Bin 0 -> 4001 bytes rowers/views/paymentviews.py | 9 +++++---- 3 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 rowers/tests/testdata/testdata.tcx.gz diff --git a/rowers/templates/gdpr_optin.html b/rowers/templates/gdpr_optin.html index 9e084f75..ae3d1a24 100644 --- a/rowers/templates/gdpr_optin.html +++ b/rowers/templates/gdpr_optin.html @@ -11,18 +11,24 @@ you can opt in or delete this user account.

    -

    GDPR Opt-In

    +

    Data Consent

    To comply with the European Union General Data Protection Regulation, 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 opt in, click the "opt in" 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 button at the end fo the page to delete your account. This will irreversibly delete all your data on rowsandall.com and remove your account.

    + +

    + OPT IN AND CONTINUE +

    + +
    {% include "privacypolicy.html" %} @@ -33,26 +39,27 @@ To start or continue using the site, please give your consent by clicking on the green Opt In button below.

    -

    - Download your data -

    +

    - Opt in and continue + OPT IN AND CONTINUE

    {% csrf_token %} - - + +

    +

    + Download your data +

    + {% endblock %} {% block sidebar %} {% include 'menu_profile.html' %} {% endblock %} - diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz new file mode 100644 index 0000000000000000000000000000000000000000..a0e60e637b99a1106e13dcb740331ac2936dae26 GIT binary patch literal 4001 zcmV;S4_@#eiwFog2+Lst|8!+@bYx+4VJ>uIcmVC4TW=dT7J%RLD-1uh4~tUg!o!Q} zx@eOwHbBxX+MwIF#ne_E?b@;-O)mZSOG>HZBp$TK-XS;x<{_{~bJKit$aClM*KaQ` z4qh)e+tt{c`i9>$_jO?eZY)yxx9w__FV>j~0tJ zZ{C>mZgaU>o71byMf!4k`f_>MZ5MYRzIaWC`%@fsZ~wwszB%nzuUGx=-@WaZ>wJT^ zPVjcS`rr(2*j#PS7X*NdU!FhvX?Kb*R_krwtxuQfsO{=#f8J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UZkY&(QD@gjYH67>K+h(C(wpa@ z>~hA?dg+XU-evSrW!HP;qBVEWjJr|LN8?eMhwrIu2?n&F?HK5hazhoR)N|Pq3}`{y zQP4|ns6slaw^B562Tjcz1${6q7<5uEu4t-8Q}aeaPsz9=WorfRTyx}3-K7(A%S6zw zY3se8%v?_`Xgi2L7g;l?!Z$wnX4lUEeKeA+JDt==KN-88nwmF+p2>){y6{ba(Cqpd zpqE^D1v>Ot6n$PQs15idpbrKZb^Y)|PTrpgdTQRhA@q4AYrvpG&v7#7+xqpx=-C7z zUF0skC?z%g+=-&09|65Ho^4dQbb`Z@E}dDSmx|EGyrwPaq~2rE0pGV0j4{v)8D}x5 zvUEZyT50LPa$iY|6GD-FMvEFFQ} zO4fj0<;aaFlX2-l>zg--ez%gfZk@YGWrMcR=K4|4`&@maM9+RQt6R3Yeh__L$(oT= z-n?ji(drv&ee*^^&$~s;RmNSE*jBfkxHm7Oce(INiQdJcQr{Y-j)Okt!YiF!9|N@J zX%qM6CG@+Mtd)_w7_oK6o&kDm(oC;f0EGZrkKFsB_hX@dxAl(=$BSp(_05OxulnWo zx64T1zRzrSf9|*c zkly0&UtRvXOm_zG1;GCQ Date: Thu, 30 Dec 2021 12:20:13 +0100 Subject: [PATCH 17/20] new icons working --- rowers/mytypes.py | 56 +++++++++--------- rowers/templates/__MACOSX/svg/._bike.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._bike_erg.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._canoeing.svg | Bin 0 -> 220 bytes .../__MACOSX/svg/._cross_country_ski.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._crossfit.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._hike.svg | Bin 0 -> 220 bytes .../templates/__MACOSX/svg/._ice_skating.svg | Bin 0 -> 220 bytes .../templates/__MACOSX/svg/._indoor_rower.svg | Bin 0 -> 220 bytes .../__MACOSX/svg/._inline_skating.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._kayaking.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._other.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._paddle.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._rowing.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._run.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._ski_erg.svg | Bin 0 -> 220 bytes .../__MACOSX/svg/._standup_paddling.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._swim.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._walk.svg | Bin 0 -> 220 bytes .../__MACOSX/svg/._weight_training.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._workout.svg | Bin 0 -> 220 bytes rowers/templates/__MACOSX/svg/._yoga.svg | Bin 0 -> 220 bytes rowers/templates/bike.svg | 25 ++++++++ rowers/templates/bike_erg.svg | 32 ++++++++++ rowers/templates/canoeing.svg | 26 ++++++++ rowers/templates/cross_country_ski.svg | 25 ++++++++ rowers/templates/crossfit.svg | 27 +++++++++ rowers/templates/hike.svg | 21 +++++++ rowers/templates/ice_skating.svg | 23 +++++++ rowers/templates/icons/bike.svg | 27 +++++++++ rowers/templates/icons/bike_erg.svg | 32 ++++++++++ rowers/templates/icons/canoeing.svg | 26 ++++++++ rowers/templates/icons/cross_country_ski.svg | 25 ++++++++ rowers/templates/icons/crossfit.svg | 29 +++++++++ rowers/templates/icons/hike.svg | 21 +++++++ rowers/templates/icons/ice_skating.svg | 23 +++++++ rowers/templates/icons/indoor_rower.svg | 24 ++++++++ rowers/templates/icons/inline_skating.svg | 44 ++++++++++++++ rowers/templates/icons/kayaking.svg | 26 ++++++++ rowers/templates/icons/other.svg | 22 +++++++ rowers/templates/icons/paddle.svg | 25 ++++++++ rowers/templates/icons/rowing.svg | 23 +++++++ rowers/templates/icons/run.svg | 20 +++++++ rowers/templates/icons/ski_erg.svg | 29 +++++++++ rowers/templates/icons/standup_paddling.svg | 27 +++++++++ rowers/templates/icons/swim.svg | 20 +++++++ rowers/templates/icons/walk.svg | 18 ++++++ rowers/templates/icons/weight_training.svg | 28 +++++++++ rowers/templates/icons/workout.svg | 17 ++++++ rowers/templates/icons/yoga.svg | 19 ++++++ rowers/templates/indoor_rower.svg | 24 ++++++++ rowers/templates/inline_skating.svg | 44 ++++++++++++++ rowers/templates/kayaking.svg | 26 ++++++++ rowers/templates/list_workouts.html | 12 ++-- rowers/templates/other.svg | 20 +++++++ rowers/templates/paddle.svg | 25 ++++++++ rowers/templates/rowing.svg | 23 +++++++ rowers/templates/run.svg | 18 ++++++ rowers/templates/ski_erg.svg | 29 +++++++++ rowers/templates/standup_paddling.svg | 27 +++++++++ rowers/templates/svg/bike.svg | 25 ++++++++ rowers/templates/svg/bike_erg.svg | 32 ++++++++++ rowers/templates/svg/canoeing.svg | 26 ++++++++ rowers/templates/svg/cross_country_ski.svg | 25 ++++++++ rowers/templates/svg/crossfit.svg | 27 +++++++++ rowers/templates/svg/hike.svg | 21 +++++++ rowers/templates/svg/ice_skating.svg | 23 +++++++ rowers/templates/svg/indoor_rower.svg | 24 ++++++++ rowers/templates/svg/inline_skating.svg | 44 ++++++++++++++ rowers/templates/svg/kayaking.svg | 26 ++++++++ rowers/templates/svg/other.svg | 20 +++++++ rowers/templates/svg/paddle.svg | 25 ++++++++ rowers/templates/svg/rowing.svg | 23 +++++++ rowers/templates/svg/run.svg | 18 ++++++ rowers/templates/svg/ski_erg.svg | 29 +++++++++ rowers/templates/svg/standup_paddling.svg | 27 +++++++++ rowers/templates/svg/swim.svg | 22 +++++++ rowers/templates/svg/walk.svg | 16 +++++ rowers/templates/svg/weight_training.svg | 28 +++++++++ rowers/templates/svg/workout.svg | 15 +++++ rowers/templates/svg/yoga.svg | 19 ++++++ rowers/templates/swim.svg | 22 +++++++ rowers/templates/walk.svg | 16 +++++ rowers/templates/weight_training.svg | 28 +++++++++ rowers/templates/workout.svg | 15 +++++ rowers/templates/yoga.svg | 19 ++++++ rowers/templatetags/rowerfilters.py | 8 +-- static/css/rowsandall2.css | 11 ++++ static/img/bike.svg | 27 +++++++++ static/img/bike_erg.svg | 32 ++++++++++ static/img/canoeing.svg | 26 ++++++++ static/img/cross_country_ski.svg | 25 ++++++++ static/img/crossfit.svg | 27 +++++++++ static/img/hike.svg | 21 +++++++ static/img/ice_skating.svg | 23 +++++++ static/img/indoor_rower.svg | 24 ++++++++ static/img/inline_skating.svg | 44 ++++++++++++++ static/img/kayaking.svg | 26 ++++++++ static/img/other.svg | 20 +++++++ static/img/paddle.svg | 25 ++++++++ static/img/rowing.svg | 23 +++++++ static/img/run.svg | 18 ++++++ static/img/ski_erg.svg | 29 +++++++++ static/img/standup_paddling.svg | 27 +++++++++ static/img/swim.svg | 22 +++++++ static/img/walk.svg | 16 +++++ static/img/weight_training.svg | 28 +++++++++ static/img/workout.svg | 15 +++++ static/img/yoga.svg | 19 ++++++ 109 files changed, 2120 insertions(+), 39 deletions(-) create mode 100644 rowers/templates/__MACOSX/svg/._bike.svg create mode 100644 rowers/templates/__MACOSX/svg/._bike_erg.svg create mode 100644 rowers/templates/__MACOSX/svg/._canoeing.svg create mode 100644 rowers/templates/__MACOSX/svg/._cross_country_ski.svg create mode 100644 rowers/templates/__MACOSX/svg/._crossfit.svg create mode 100644 rowers/templates/__MACOSX/svg/._hike.svg create mode 100644 rowers/templates/__MACOSX/svg/._ice_skating.svg create mode 100644 rowers/templates/__MACOSX/svg/._indoor_rower.svg create mode 100644 rowers/templates/__MACOSX/svg/._inline_skating.svg create mode 100644 rowers/templates/__MACOSX/svg/._kayaking.svg create mode 100644 rowers/templates/__MACOSX/svg/._other.svg create mode 100644 rowers/templates/__MACOSX/svg/._paddle.svg create mode 100644 rowers/templates/__MACOSX/svg/._rowing.svg create mode 100644 rowers/templates/__MACOSX/svg/._run.svg create mode 100644 rowers/templates/__MACOSX/svg/._ski_erg.svg create mode 100644 rowers/templates/__MACOSX/svg/._standup_paddling.svg create mode 100644 rowers/templates/__MACOSX/svg/._swim.svg create mode 100644 rowers/templates/__MACOSX/svg/._walk.svg create mode 100644 rowers/templates/__MACOSX/svg/._weight_training.svg create mode 100644 rowers/templates/__MACOSX/svg/._workout.svg create mode 100644 rowers/templates/__MACOSX/svg/._yoga.svg create mode 100644 rowers/templates/bike.svg create mode 100644 rowers/templates/bike_erg.svg create mode 100644 rowers/templates/canoeing.svg create mode 100644 rowers/templates/cross_country_ski.svg create mode 100644 rowers/templates/crossfit.svg create mode 100644 rowers/templates/hike.svg create mode 100644 rowers/templates/ice_skating.svg create mode 100644 rowers/templates/icons/bike.svg create mode 100644 rowers/templates/icons/bike_erg.svg create mode 100644 rowers/templates/icons/canoeing.svg create mode 100644 rowers/templates/icons/cross_country_ski.svg create mode 100644 rowers/templates/icons/crossfit.svg create mode 100644 rowers/templates/icons/hike.svg create mode 100644 rowers/templates/icons/ice_skating.svg create mode 100644 rowers/templates/icons/indoor_rower.svg create mode 100644 rowers/templates/icons/inline_skating.svg create mode 100644 rowers/templates/icons/kayaking.svg create mode 100644 rowers/templates/icons/other.svg create mode 100644 rowers/templates/icons/paddle.svg create mode 100644 rowers/templates/icons/rowing.svg create mode 100644 rowers/templates/icons/run.svg create mode 100644 rowers/templates/icons/ski_erg.svg create mode 100644 rowers/templates/icons/standup_paddling.svg create mode 100644 rowers/templates/icons/swim.svg create mode 100644 rowers/templates/icons/walk.svg create mode 100644 rowers/templates/icons/weight_training.svg create mode 100644 rowers/templates/icons/workout.svg create mode 100644 rowers/templates/icons/yoga.svg create mode 100644 rowers/templates/indoor_rower.svg create mode 100644 rowers/templates/inline_skating.svg create mode 100644 rowers/templates/kayaking.svg create mode 100644 rowers/templates/other.svg create mode 100644 rowers/templates/paddle.svg create mode 100644 rowers/templates/rowing.svg create mode 100644 rowers/templates/run.svg create mode 100644 rowers/templates/ski_erg.svg create mode 100644 rowers/templates/standup_paddling.svg create mode 100644 rowers/templates/svg/bike.svg create mode 100644 rowers/templates/svg/bike_erg.svg create mode 100644 rowers/templates/svg/canoeing.svg create mode 100644 rowers/templates/svg/cross_country_ski.svg create mode 100644 rowers/templates/svg/crossfit.svg create mode 100644 rowers/templates/svg/hike.svg create mode 100644 rowers/templates/svg/ice_skating.svg create mode 100644 rowers/templates/svg/indoor_rower.svg create mode 100644 rowers/templates/svg/inline_skating.svg create mode 100644 rowers/templates/svg/kayaking.svg create mode 100644 rowers/templates/svg/other.svg create mode 100644 rowers/templates/svg/paddle.svg create mode 100644 rowers/templates/svg/rowing.svg create mode 100644 rowers/templates/svg/run.svg create mode 100644 rowers/templates/svg/ski_erg.svg create mode 100644 rowers/templates/svg/standup_paddling.svg create mode 100644 rowers/templates/svg/swim.svg create mode 100644 rowers/templates/svg/walk.svg create mode 100644 rowers/templates/svg/weight_training.svg create mode 100644 rowers/templates/svg/workout.svg create mode 100644 rowers/templates/svg/yoga.svg create mode 100644 rowers/templates/swim.svg create mode 100644 rowers/templates/walk.svg create mode 100644 rowers/templates/weight_training.svg create mode 100644 rowers/templates/workout.svg create mode 100644 rowers/templates/yoga.svg create mode 100644 static/img/bike.svg create mode 100644 static/img/bike_erg.svg create mode 100644 static/img/canoeing.svg create mode 100644 static/img/cross_country_ski.svg create mode 100644 static/img/crossfit.svg create mode 100644 static/img/hike.svg create mode 100644 static/img/ice_skating.svg create mode 100644 static/img/indoor_rower.svg create mode 100644 static/img/inline_skating.svg create mode 100644 static/img/kayaking.svg create mode 100644 static/img/other.svg create mode 100644 static/img/paddle.svg create mode 100644 static/img/rowing.svg create mode 100644 static/img/run.svg create mode 100644 static/img/ski_erg.svg create mode 100644 static/img/standup_paddling.svg create mode 100644 static/img/swim.svg create mode 100644 static/img/walk.svg create mode 100644 static/img/weight_training.svg create mode 100644 static/img/workout.svg create mode 100644 static/img/yoga.svg diff --git a/rowers/mytypes.py b/rowers/mytypes.py index 9249b0a6..e264fa8c 100644 --- a/rowers/mytypes.py +++ b/rowers/mytypes.py @@ -42,35 +42,35 @@ workouttypes_ordered = collections.OrderedDict({ ) workouttypes_icons = collections.OrderedDict({ - 'water':'far fa-water', - 'rower':'far fa-tire', - 'skierg':'far fa-tire', - 'bikeerg':'far fa-biking', - 'dynamic':'far fa-tire', - 'slides':'far fa-tire', - 'paddle':'far fa-utensil-spoon', - 'snow':'far fa-snowflakes', - 'coastal':'far fa-water', - 'c-boat':'far fa-water', - 'churchboat':'far fa-water', - 'Ride':'far fa-biking', - 'bike':'far fa-biking', - 'Run':'far fa-running', - 'NordicSki':'far fa-skiing-nordic', - 'Swim':'far fa-swimmer', - 'Hike':'far fa-hiking', - 'Walk':'far fa-walking', - 'Canoeing':'far fa-blind', - 'Crossfit':'far fa-dumbbell', - 'StandUpPaddling':'far fa-blind', - 'IceSkate':'far fa-skating', - 'WeightTraining':'far fa-dumbbell', - 'InlineSkate':'far fa-skating', - 'Kayaking':'far fa-water', - 'Workout':'far fa-dumbbell', - 'Yoga':'far fa-pray', + 'water':'rowing.svg', # g + 'rower':'indoor_rower.svg', # g + 'skierg':'ski_erg.svg', #g + 'bikeerg':'bike_erg.svg', #g + 'dynamic':'indoor_rower.svg', + 'slides':'indoor_rower.svg', + 'paddle':'paddle.svg', # could be better + 'snow':'cross_country_ski.svg', # ok + 'coastal':'rowing.svg', # ok + 'c-boat':'rowing.svg', # ok + 'churchboat':'rowing.svg', # ok + 'Ride':'bike.svg', # ok + 'bike':'bike.svg', # ok + 'Run':'run.svg', # ok + 'NordicSki':'cross_country_ski.svg', # ok + 'Swim':'swim.svg', # ok + 'Hike':'hike.svg', # ok + 'Walk':'walk.svg', # o k + 'Canoeing':'canoeing.svg', # ok + 'Crossfit':'crossfit.svg', + 'StandUpPaddling':'standup_paddling.svg', + 'IceSkate':'ice_skating.svg', + 'WeightTraining':'weight_training.svg', + 'InlineSkate':'inline_skating.svg', + 'Kayaking':'kayaking.svg', + 'Workout':'workout.svg', + 'Yoga':'yoga.svg', # 'bike':'Bike', - 'other':'far fa-biking', + 'other':'other.svg', } ) diff --git a/rowers/templates/__MACOSX/svg/._bike.svg b/rowers/templates/__MACOSX/svg/._bike.svg new file mode 100644 index 0000000000000000000000000000000000000000..61066ba6c67286aa267d20546caf465cde2cc616 GIT binary patch literal 220 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1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|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij + + + + + diff --git a/rowers/templates/bike_erg.svg b/rowers/templates/bike_erg.svg new file mode 100644 index 00000000..05fd9ddd --- /dev/null +++ b/rowers/templates/bike_erg.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/rowers/templates/canoeing.svg b/rowers/templates/canoeing.svg new file mode 100644 index 00000000..6fd77453 --- /dev/null +++ b/rowers/templates/canoeing.svg @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/rowers/templates/cross_country_ski.svg b/rowers/templates/cross_country_ski.svg new file mode 100644 index 00000000..053971dc --- /dev/null +++ b/rowers/templates/cross_country_ski.svg @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/rowers/templates/crossfit.svg b/rowers/templates/crossfit.svg new file mode 100644 index 00000000..94424445 --- /dev/null +++ b/rowers/templates/crossfit.svg @@ -0,0 +1,27 @@ + + + + + + diff --git a/rowers/templates/hike.svg b/rowers/templates/hike.svg new file mode 100644 index 00000000..23d9c5b5 --- /dev/null +++ b/rowers/templates/hike.svg @@ -0,0 +1,21 @@ + + + + + + + + + + diff --git a/rowers/templates/ice_skating.svg b/rowers/templates/ice_skating.svg new file mode 100644 index 00000000..d6381b02 --- /dev/null +++ b/rowers/templates/ice_skating.svg @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/rowers/templates/icons/bike.svg b/rowers/templates/icons/bike.svg new file mode 100644 index 00000000..53783f7f --- /dev/null +++ b/rowers/templates/icons/bike.svg @@ -0,0 +1,27 @@ + + + + + + + + diff --git a/rowers/templates/icons/bike_erg.svg b/rowers/templates/icons/bike_erg.svg new file mode 100644 index 00000000..b53b0f1f --- /dev/null +++ b/rowers/templates/icons/bike_erg.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/rowers/templates/icons/canoeing.svg b/rowers/templates/icons/canoeing.svg new file mode 100644 index 00000000..b749ff73 --- /dev/null +++ b/rowers/templates/icons/canoeing.svg @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/rowers/templates/icons/cross_country_ski.svg b/rowers/templates/icons/cross_country_ski.svg new file mode 100644 index 00000000..cf2207b7 --- /dev/null +++ b/rowers/templates/icons/cross_country_ski.svg @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/rowers/templates/icons/crossfit.svg b/rowers/templates/icons/crossfit.svg new file mode 100644 index 00000000..6f13a7b6 --- /dev/null +++ b/rowers/templates/icons/crossfit.svg @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/rowers/templates/icons/hike.svg b/rowers/templates/icons/hike.svg new file mode 100644 index 00000000..89fa0a01 --- /dev/null +++ b/rowers/templates/icons/hike.svg @@ -0,0 +1,21 @@ + + + + + + + + + + diff --git a/rowers/templates/icons/ice_skating.svg b/rowers/templates/icons/ice_skating.svg new file mode 100644 index 00000000..50fa4775 --- /dev/null +++ b/rowers/templates/icons/ice_skating.svg @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/rowers/templates/icons/indoor_rower.svg b/rowers/templates/icons/indoor_rower.svg new file mode 100644 index 00000000..4eba251e --- /dev/null +++ b/rowers/templates/icons/indoor_rower.svg @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/rowers/templates/icons/inline_skating.svg b/rowers/templates/icons/inline_skating.svg new file mode 100644 index 00000000..1945100e --- /dev/null +++ b/rowers/templates/icons/inline_skating.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + diff --git a/rowers/templates/icons/kayaking.svg b/rowers/templates/icons/kayaking.svg new file mode 100644 index 00000000..b4bad483 --- /dev/null +++ b/rowers/templates/icons/kayaking.svg @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/rowers/templates/icons/other.svg b/rowers/templates/icons/other.svg new file mode 100644 index 00000000..b3be09c4 --- /dev/null +++ b/rowers/templates/icons/other.svg @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/rowers/templates/icons/paddle.svg b/rowers/templates/icons/paddle.svg new file mode 100644 index 00000000..2bba600a --- /dev/null +++ b/rowers/templates/icons/paddle.svg @@ -0,0 +1,25 @@ + + + + + + + + + + diff --git a/rowers/templates/icons/rowing.svg b/rowers/templates/icons/rowing.svg new file mode 100644 index 00000000..0644953d --- /dev/null +++ b/rowers/templates/icons/rowing.svg @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/rowers/templates/icons/run.svg b/rowers/templates/icons/run.svg new file mode 100644 index 00000000..3445f4fb --- /dev/null +++ b/rowers/templates/icons/run.svg @@ -0,0 +1,20 @@ + + + + + + + + diff --git a/rowers/templates/icons/ski_erg.svg b/rowers/templates/icons/ski_erg.svg new file mode 100644 index 00000000..2041a06b --- /dev/null +++ b/rowers/templates/icons/ski_erg.svg @@ -0,0 +1,29 @@ + + + + + + + + + + diff --git a/rowers/templates/icons/standup_paddling.svg b/rowers/templates/icons/standup_paddling.svg new file mode 100644 index 00000000..e60e9ace --- /dev/null +++ b/rowers/templates/icons/standup_paddling.svg @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/rowers/templates/icons/swim.svg b/rowers/templates/icons/swim.svg new file mode 100644 index 00000000..08633397 --- /dev/null +++ b/rowers/templates/icons/swim.svg @@ -0,0 +1,20 @@ + + + + + + + + + + diff --git a/rowers/templates/icons/walk.svg b/rowers/templates/icons/walk.svg new file mode 100644 index 00000000..5f91dc00 --- /dev/null +++ b/rowers/templates/icons/walk.svg @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/rowers/templates/icons/weight_training.svg b/rowers/templates/icons/weight_training.svg new file mode 100644 index 00000000..b3510111 --- /dev/null +++ b/rowers/templates/icons/weight_training.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/rowers/templates/icons/workout.svg b/rowers/templates/icons/workout.svg new file mode 100644 index 00000000..f30fe27d --- /dev/null +++ b/rowers/templates/icons/workout.svg @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/rowers/templates/icons/yoga.svg b/rowers/templates/icons/yoga.svg new file mode 100644 index 00000000..4a207e32 --- /dev/null +++ b/rowers/templates/icons/yoga.svg @@ -0,0 +1,19 @@ + + + + + + + + + diff --git a/rowers/templates/indoor_rower.svg b/rowers/templates/indoor_rower.svg new file mode 100644 index 00000000..998e3e05 --- /dev/null +++ b/rowers/templates/indoor_rower.svg @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/rowers/templates/inline_skating.svg b/rowers/templates/inline_skating.svg new file mode 100644 index 00000000..06fd9308 --- /dev/null +++ b/rowers/templates/inline_skating.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + diff --git a/rowers/templates/kayaking.svg b/rowers/templates/kayaking.svg new file mode 100644 index 00000000..3027e2d7 --- /dev/null +++ b/rowers/templates/kayaking.svg @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index 64aa921e..bb67af4b 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -136,19 +136,21 @@ {% endif %}
  • -
    +
    - {{ workout.workouttype|icon|safe }} + {% with workout.workouttype|icon|safe as templateName %} + {% include templateName %} + {% endwith %}
    -
    +
    Distance
    {{ workout.distance|distanceprint }}
    -
    +
    Time
    {{ workout.duration |durationprint:"%H:%M:%S.%f" }}
    -
    +
    {% if workout|may_edit:request %} + + + + + diff --git a/rowers/templates/paddle.svg b/rowers/templates/paddle.svg new file mode 100644 index 00000000..2ce5dc3a --- /dev/null +++ b/rowers/templates/paddle.svg @@ -0,0 +1,25 @@ + + + + + + + + + + diff --git a/rowers/templates/rowing.svg b/rowers/templates/rowing.svg new file mode 100644 index 00000000..478fbd8b --- /dev/null +++ b/rowers/templates/rowing.svg @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/rowers/templates/run.svg b/rowers/templates/run.svg new file mode 100644 index 00000000..7fa18a46 --- /dev/null +++ b/rowers/templates/run.svg @@ -0,0 +1,18 @@ + + + + + + diff --git a/rowers/templates/ski_erg.svg b/rowers/templates/ski_erg.svg new file mode 100644 index 00000000..e788f26b --- /dev/null +++ b/rowers/templates/ski_erg.svg @@ -0,0 +1,29 @@ + + + + + + + + + + diff --git a/rowers/templates/standup_paddling.svg b/rowers/templates/standup_paddling.svg new file mode 100644 index 00000000..b5d64b11 --- /dev/null +++ b/rowers/templates/standup_paddling.svg @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/rowers/templates/svg/bike.svg b/rowers/templates/svg/bike.svg new file mode 100644 index 00000000..50a78948 --- /dev/null +++ b/rowers/templates/svg/bike.svg @@ -0,0 +1,25 @@ + + + + + + diff --git a/rowers/templates/svg/bike_erg.svg b/rowers/templates/svg/bike_erg.svg new file mode 100644 index 00000000..05fd9ddd --- /dev/null +++ b/rowers/templates/svg/bike_erg.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/rowers/templates/svg/canoeing.svg b/rowers/templates/svg/canoeing.svg new file mode 100644 index 00000000..6fd77453 --- /dev/null +++ b/rowers/templates/svg/canoeing.svg @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/rowers/templates/svg/cross_country_ski.svg b/rowers/templates/svg/cross_country_ski.svg new file mode 100644 index 00000000..053971dc --- /dev/null +++ b/rowers/templates/svg/cross_country_ski.svg @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/rowers/templates/svg/crossfit.svg b/rowers/templates/svg/crossfit.svg new file mode 100644 index 00000000..94424445 --- /dev/null +++ b/rowers/templates/svg/crossfit.svg @@ -0,0 +1,27 @@ + + + + + + diff --git a/rowers/templates/svg/hike.svg b/rowers/templates/svg/hike.svg new file mode 100644 index 00000000..23d9c5b5 --- /dev/null +++ b/rowers/templates/svg/hike.svg @@ -0,0 +1,21 @@ + + + + + + + + + + diff --git a/rowers/templates/svg/ice_skating.svg b/rowers/templates/svg/ice_skating.svg new file mode 100644 index 00000000..d6381b02 --- /dev/null +++ b/rowers/templates/svg/ice_skating.svg @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/rowers/templates/svg/indoor_rower.svg b/rowers/templates/svg/indoor_rower.svg new file mode 100644 index 00000000..998e3e05 --- /dev/null +++ b/rowers/templates/svg/indoor_rower.svg @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/rowers/templates/svg/inline_skating.svg b/rowers/templates/svg/inline_skating.svg new file mode 100644 index 00000000..06fd9308 --- /dev/null +++ b/rowers/templates/svg/inline_skating.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + diff --git a/rowers/templates/svg/kayaking.svg b/rowers/templates/svg/kayaking.svg new file mode 100644 index 00000000..3027e2d7 --- /dev/null +++ b/rowers/templates/svg/kayaking.svg @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/rowers/templates/svg/other.svg b/rowers/templates/svg/other.svg new file mode 100644 index 00000000..184ebc08 --- /dev/null +++ b/rowers/templates/svg/other.svg @@ -0,0 +1,20 @@ + + + + + + diff --git a/rowers/templates/svg/paddle.svg b/rowers/templates/svg/paddle.svg new file mode 100644 index 00000000..2ce5dc3a --- /dev/null +++ b/rowers/templates/svg/paddle.svg @@ -0,0 +1,25 @@ + + + + + + + + + + diff --git a/rowers/templates/svg/rowing.svg b/rowers/templates/svg/rowing.svg new file mode 100644 index 00000000..478fbd8b --- /dev/null +++ b/rowers/templates/svg/rowing.svg @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/rowers/templates/svg/run.svg b/rowers/templates/svg/run.svg new file mode 100644 index 00000000..7fa18a46 --- /dev/null +++ b/rowers/templates/svg/run.svg @@ -0,0 +1,18 @@ + + + + + + diff --git a/rowers/templates/svg/ski_erg.svg b/rowers/templates/svg/ski_erg.svg new file mode 100644 index 00000000..e788f26b --- /dev/null +++ b/rowers/templates/svg/ski_erg.svg @@ -0,0 +1,29 @@ + + + + + + + + + + diff --git a/rowers/templates/svg/standup_paddling.svg b/rowers/templates/svg/standup_paddling.svg new file mode 100644 index 00000000..b5d64b11 --- /dev/null +++ b/rowers/templates/svg/standup_paddling.svg @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/rowers/templates/svg/swim.svg b/rowers/templates/svg/swim.svg new file mode 100644 index 00000000..13b52084 --- /dev/null +++ b/rowers/templates/svg/swim.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + diff --git a/rowers/templates/svg/walk.svg b/rowers/templates/svg/walk.svg new file mode 100644 index 00000000..d51d7f33 --- /dev/null +++ b/rowers/templates/svg/walk.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/rowers/templates/svg/weight_training.svg b/rowers/templates/svg/weight_training.svg new file mode 100644 index 00000000..37ae236e --- /dev/null +++ b/rowers/templates/svg/weight_training.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/rowers/templates/svg/workout.svg b/rowers/templates/svg/workout.svg new file mode 100644 index 00000000..427f2612 --- /dev/null +++ b/rowers/templates/svg/workout.svg @@ -0,0 +1,15 @@ + + + + + + diff --git a/rowers/templates/svg/yoga.svg b/rowers/templates/svg/yoga.svg new file mode 100644 index 00000000..11ba38da --- /dev/null +++ b/rowers/templates/svg/yoga.svg @@ -0,0 +1,19 @@ + + + + + + + + + diff --git a/rowers/templates/swim.svg b/rowers/templates/swim.svg new file mode 100644 index 00000000..13b52084 --- /dev/null +++ b/rowers/templates/swim.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + diff --git a/rowers/templates/walk.svg b/rowers/templates/walk.svg new file mode 100644 index 00000000..d51d7f33 --- /dev/null +++ b/rowers/templates/walk.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/rowers/templates/weight_training.svg b/rowers/templates/weight_training.svg new file mode 100644 index 00000000..37ae236e --- /dev/null +++ b/rowers/templates/weight_training.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/rowers/templates/workout.svg b/rowers/templates/workout.svg new file mode 100644 index 00000000..427f2612 --- /dev/null +++ b/rowers/templates/workout.svg @@ -0,0 +1,15 @@ + + + + + + diff --git a/rowers/templates/yoga.svg b/rowers/templates/yoga.svg new file mode 100644 index 00000000..11ba38da --- /dev/null +++ b/rowers/templates/yoga.svg @@ -0,0 +1,19 @@ + + + + + + + + + diff --git a/rowers/templatetags/rowerfilters.py b/rowers/templatetags/rowerfilters.py index 18c2b1d4..57db8e3b 100644 --- a/rowers/templatetags/rowerfilters.py +++ b/rowers/templatetags/rowerfilters.py @@ -494,13 +494,9 @@ def icon(workouttype): try: s = workouttypes_icons.get(workouttype) except KeyError: - s = "far fa-biking" + s = "bike.svg" - iconstring = """ - - - - """.format(s=s) + iconstring = "{s}".format(s=s) return iconstring diff --git a/static/css/rowsandall2.css b/static/css/rowsandall2.css index 1aba5066..62e92d7d 100644 --- a/static/css/rowsandall2.css +++ b/static/css/rowsandall2.css @@ -332,6 +332,17 @@ th.rotate > div > span { margin: 0px; } +.workoutcontainer { + display: grid; + grid-template-columns: 50px repeat(auto-fit, minmax(calc((100% - 100px)/4), 1fr)); + /* grid-template-columns: 50px repeat(auto-fit, minmax(100px, 1fr)) 50px; ????*/ + padding: 5px; +} + +.workoutelement { + margin-left: auto; + margin-right: auto; +} .divlines h3 { font-size: 1.2em; diff --git a/static/img/bike.svg b/static/img/bike.svg new file mode 100644 index 00000000..1cf2f65a --- /dev/null +++ b/static/img/bike.svg @@ -0,0 +1,27 @@ + + + + + + + + diff --git a/static/img/bike_erg.svg b/static/img/bike_erg.svg new file mode 100644 index 00000000..5e441fb2 --- /dev/null +++ b/static/img/bike_erg.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/static/img/canoeing.svg b/static/img/canoeing.svg new file mode 100644 index 00000000..09406837 --- /dev/null +++ b/static/img/canoeing.svg @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/static/img/cross_country_ski.svg b/static/img/cross_country_ski.svg new file mode 100644 index 00000000..51260a59 --- /dev/null +++ b/static/img/cross_country_ski.svg @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/static/img/crossfit.svg b/static/img/crossfit.svg new file mode 100644 index 00000000..4865cde7 --- /dev/null +++ b/static/img/crossfit.svg @@ -0,0 +1,27 @@ + + + + + + diff --git a/static/img/hike.svg b/static/img/hike.svg new file mode 100644 index 00000000..9b857bc2 --- /dev/null +++ b/static/img/hike.svg @@ -0,0 +1,21 @@ + + + + + + + + + + diff --git a/static/img/ice_skating.svg b/static/img/ice_skating.svg new file mode 100644 index 00000000..112dd33b --- /dev/null +++ b/static/img/ice_skating.svg @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/static/img/indoor_rower.svg b/static/img/indoor_rower.svg new file mode 100644 index 00000000..eab7ba0c --- /dev/null +++ b/static/img/indoor_rower.svg @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/static/img/inline_skating.svg b/static/img/inline_skating.svg new file mode 100644 index 00000000..f0aae778 --- /dev/null +++ b/static/img/inline_skating.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + diff --git a/static/img/kayaking.svg b/static/img/kayaking.svg new file mode 100644 index 00000000..90dbb0c0 --- /dev/null +++ b/static/img/kayaking.svg @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/static/img/other.svg b/static/img/other.svg new file mode 100644 index 00000000..4c95ea08 --- /dev/null +++ b/static/img/other.svg @@ -0,0 +1,20 @@ + + + + + + diff --git a/static/img/paddle.svg b/static/img/paddle.svg new file mode 100644 index 00000000..0056f1ba --- /dev/null +++ b/static/img/paddle.svg @@ -0,0 +1,25 @@ + + + + + + + + + + diff --git a/static/img/rowing.svg b/static/img/rowing.svg new file mode 100644 index 00000000..aee6bb68 --- /dev/null +++ b/static/img/rowing.svg @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/static/img/run.svg b/static/img/run.svg new file mode 100644 index 00000000..999d7964 --- /dev/null +++ b/static/img/run.svg @@ -0,0 +1,18 @@ + + + + + + diff --git a/static/img/ski_erg.svg b/static/img/ski_erg.svg new file mode 100644 index 00000000..7f4eb2be --- /dev/null +++ b/static/img/ski_erg.svg @@ -0,0 +1,29 @@ + + + + + + + + + + diff --git a/static/img/standup_paddling.svg b/static/img/standup_paddling.svg new file mode 100644 index 00000000..d79f487a --- /dev/null +++ b/static/img/standup_paddling.svg @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/static/img/swim.svg b/static/img/swim.svg new file mode 100644 index 00000000..7d159811 --- /dev/null +++ b/static/img/swim.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + diff --git a/static/img/walk.svg b/static/img/walk.svg new file mode 100644 index 00000000..0b8f7c06 --- /dev/null +++ b/static/img/walk.svg @@ -0,0 +1,16 @@ + + + + + + diff --git a/static/img/weight_training.svg b/static/img/weight_training.svg new file mode 100644 index 00000000..eed70eb5 --- /dev/null +++ b/static/img/weight_training.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/static/img/workout.svg b/static/img/workout.svg new file mode 100644 index 00000000..439aeb40 --- /dev/null +++ b/static/img/workout.svg @@ -0,0 +1,15 @@ + + + + + + diff --git a/static/img/yoga.svg b/static/img/yoga.svg new file mode 100644 index 00000000..748b75a5 --- /dev/null +++ b/static/img/yoga.svg @@ -0,0 +1,19 @@ + + + + + + + + + From d77a67ac398c80c8f240be7fb3507b616b0d5f70 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 31 Dec 2021 09:09:43 +0100 Subject: [PATCH 18/20] expanding landing pages and adding a test for different workout types in listview --- rowers/mytypes.py | 10 ++--- rowers/tests/test_aworkouts.py | 59 +++++++++++++++++++++++++- rowers/tests/testdata/testdata.tcx.gz | Bin 4001 -> 0 bytes rowers/utils.py | 2 + 4 files changed, 65 insertions(+), 6 deletions(-) delete mode 100644 rowers/tests/testdata/testdata.tcx.gz diff --git a/rowers/mytypes.py b/rowers/mytypes.py index e264fa8c..fc249da2 100644 --- a/rowers/mytypes.py +++ b/rowers/mytypes.py @@ -61,12 +61,12 @@ workouttypes_icons = collections.OrderedDict({ 'Hike':'hike.svg', # ok 'Walk':'walk.svg', # o k 'Canoeing':'canoeing.svg', # ok - 'Crossfit':'crossfit.svg', - 'StandUpPaddling':'standup_paddling.svg', - 'IceSkate':'ice_skating.svg', - 'WeightTraining':'weight_training.svg', + 'Crossfit':'crossfit.svg', # ok + 'StandUpPaddling':'standup_paddling.svg', # ok + 'IceSkate':'ice_skating.svg', # ok + 'WeightTraining':'weight_training.svg', # ok 'InlineSkate':'inline_skating.svg', - 'Kayaking':'kayaking.svg', + 'Kayaking':'kayaking.svg', # ok 'Workout':'workout.svg', 'Yoga':'yoga.svg', # 'bike':'Bike', diff --git a/rowers/tests/test_aworkouts.py b/rowers/tests/test_aworkouts.py index b9f6f85f..db8c24f1 100644 --- a/rowers/tests/test_aworkouts.py +++ b/rowers/tests/test_aworkouts.py @@ -14,7 +14,7 @@ from io import BytesIO from PIL import Image from io import StringIO - +from rowers.mytypes import workouttypes def create_image(storage, filename, size=(100, 100), image_mode='RGB', image_format='PNG'): """ @@ -31,6 +31,63 @@ def create_image(storage, filename, size=(100, 100), image_mode='RGB', image_for image_file = ContentFile(data.read()) return storage.save(filename, image_file) +class ListWorkoutTest(TestCase): + def setUp(self): + self.u = UserFactory() + + self.r = Rower.objects.create(user=self.u, + birthdate=faker.profile()['birthdate'], + gdproptin=True,surveydone=True, + gdproptindate=timezone.now(), + rowerplan='coach') + + self.c = Client() + self.user_workouts = WorkoutFactory.create_batch(len(workouttypes), user=self.r) + i = 0 + for workouttype in workouttypes: + self.user_workouts[i].workouttype = workouttype[0] + self.user_workouts[i].save() + i = i+1 + + self.factory = RequestFactory() + self.password = faker.word() + self.u.set_password(self.password) + self.u.save() + + def tearDown(self): + for workout in self.user_workouts: + try: + os.remove(workout.csvfilename) + except (IOError, FileNotFoundError,OSError): + pass + + @patch('rowers.dataprep.create_engine') + @patch('rowers.dataprep.getsmallrowdata_db') + @patch('rowers.dataprep.myqueue') + def test_list_workouts(self, mocked_sqlalchemy, + mocked_getsmallrowdata_db, + mocked_myqueue): + + login = self.c.login(username=self.u.username, password=self.password) + self.assertTrue(login) + + + + url = reverse('workouts_view') + + response = self.c.get(url) + self.assertEqual(response.status_code,200) + + url2 = url+'?page=2' + + response = self.c.get(url2) + self.assertEqual(response.status_code,200) + + url3 = url+'?page=3' + + response = self.c.get(url3) + self.assertEqual(response.status_code,200) + @override_settings(TESTING=True) class WorkoutViewTest(TestCase): def setUp(self): diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz deleted file mode 100644 index a0e60e637b99a1106e13dcb740331ac2936dae26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4001 zcmV;S4_@#eiwFog2+Lst|8!+@bYx+4VJ>uIcmVC4TW=dT7J%RLD-1uh4~tUg!o!Q} zx@eOwHbBxX+MwIF#ne_E?b@;-O)mZ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 znE@YLg4Q5{M z@U0jSW#N@Ym`uFBwq)#zg0?nkY)CPx&=a+}e){MIOjIshjFzcr z%ad8&tT}Rr(eGL&dX<`I#Wt7D^c}gomWk+fbG?(vBxtp?%mMUa*D?`wOWvUM(u}*Q z+w~#0Otd1Xa^%|3s&DR#K2(H0~Xc@UvFT4u5Wg@0+I`jc2(@>?Uc?0NUZkY&(QD@gjYH67>K+h(C(wpa@ z>~hA?dg+XU-evSrW!HP;qBVEWjJr|LN8?eMhwrIu2?n&F?HK5hazhoR)N|Pq3}`{y zQP4|ns6slaw^B562Tjcz1${6q7<5uEu4t-8Q}aeaPsz9=WorfRTyx}3-K7(A%S6zw zY3se8%v?_`Xgi2L7g;l?!Z$wnX4lUEeKeA+JDt==KN-88nwmF+p2>){y6{ba(Cqpd zpqE^D1v>Ot6n$PQs15idpbrKZb^Y)|PTrpgdTQRhA@q4AYrvpG&v7#7+xqpx=-C7z zUF0skC?z%g+=-&09|65Ho^4dQbb`Z@E}dDSmx|EGyrwPaq~2rE0pGV0j4{v)8D}x5 zvUEZyT50LPa$iY|6GD-FMvEFFQ} zO4fj0<;aaFlX2-l>zg--ez%gfZk@YGWrMcR=K4|4`&@maM9+RQt6R3Yeh__L$(oT= z-n?ji(drv&ee*^^&$~s;RmNSE*jBfkxHm7Oce(INiQdJcQr{Y-j)Okt!YiF!9|N@J zX%qM6CG@+Mtd)_w7_oK6o&kDm(oC;f0EGZrkKFsB_hX@dxAl(=$BSp(_05OxulnWo zx64T1zRzrSf9|*c zkly0&UtRvXOm_zG1;GCQ Date: Fri, 31 Dec 2021 09:33:01 +0100 Subject: [PATCH 19/20] removing duplicate files --- rowers/templates/__MACOSX/svg/._bike.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._bike_erg.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._canoeing.svg | Bin 220 -> 0 bytes .../__MACOSX/svg/._cross_country_ski.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._crossfit.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._hike.svg | Bin 220 -> 0 bytes .../templates/__MACOSX/svg/._ice_skating.svg | Bin 220 -> 0 bytes .../templates/__MACOSX/svg/._indoor_rower.svg | Bin 220 -> 0 bytes .../__MACOSX/svg/._inline_skating.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._kayaking.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._other.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._paddle.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._rowing.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._run.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._ski_erg.svg | Bin 220 -> 0 bytes .../__MACOSX/svg/._standup_paddling.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._swim.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._walk.svg | Bin 220 -> 0 bytes .../__MACOSX/svg/._weight_training.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._workout.svg | Bin 220 -> 0 bytes rowers/templates/__MACOSX/svg/._yoga.svg | Bin 220 -> 0 bytes static/img/bike.svg | 27 - static/img/bike_erg.svg | 32 - static/img/canoeing.svg | 26 - static/img/cd-icons.svg | 846 ------------------ static/img/cross_country_ski.svg | 25 - static/img/crossfit.svg | 27 - static/img/hike.svg | 21 - static/img/ice_skating.svg | 23 - static/img/indoor_rower.svg | 24 - static/img/inline_skating.svg | 44 - static/img/kayaking.svg | 26 - static/img/other.svg | 20 - static/img/paddle.svg | 25 - static/img/rowing.svg | 23 - static/img/run.svg | 18 - static/img/ski_erg.svg | 29 - static/img/standup_paddling.svg | 27 - static/img/swim.svg | 22 - static/img/walk.svg | 16 - static/img/weight_training.svg | 28 - static/img/workout.svg | 15 - static/img/yoga.svg | 19 - 43 files changed, 1363 deletions(-) delete mode 100644 rowers/templates/__MACOSX/svg/._bike.svg delete mode 100644 rowers/templates/__MACOSX/svg/._bike_erg.svg delete mode 100644 rowers/templates/__MACOSX/svg/._canoeing.svg delete mode 100644 rowers/templates/__MACOSX/svg/._cross_country_ski.svg delete mode 100644 rowers/templates/__MACOSX/svg/._crossfit.svg delete mode 100644 rowers/templates/__MACOSX/svg/._hike.svg delete mode 100644 rowers/templates/__MACOSX/svg/._ice_skating.svg delete mode 100644 rowers/templates/__MACOSX/svg/._indoor_rower.svg delete mode 100644 rowers/templates/__MACOSX/svg/._inline_skating.svg delete mode 100644 rowers/templates/__MACOSX/svg/._kayaking.svg delete mode 100644 rowers/templates/__MACOSX/svg/._other.svg delete mode 100644 rowers/templates/__MACOSX/svg/._paddle.svg delete mode 100644 rowers/templates/__MACOSX/svg/._rowing.svg delete mode 100644 rowers/templates/__MACOSX/svg/._run.svg delete mode 100644 rowers/templates/__MACOSX/svg/._ski_erg.svg delete mode 100644 rowers/templates/__MACOSX/svg/._standup_paddling.svg delete mode 100644 rowers/templates/__MACOSX/svg/._swim.svg delete mode 100644 rowers/templates/__MACOSX/svg/._walk.svg delete mode 100644 rowers/templates/__MACOSX/svg/._weight_training.svg delete mode 100644 rowers/templates/__MACOSX/svg/._workout.svg delete mode 100644 rowers/templates/__MACOSX/svg/._yoga.svg delete mode 100644 static/img/bike.svg delete mode 100644 static/img/bike_erg.svg delete mode 100644 static/img/canoeing.svg delete mode 100644 static/img/cd-icons.svg delete mode 100644 static/img/cross_country_ski.svg delete mode 100644 static/img/crossfit.svg delete mode 100644 static/img/hike.svg delete mode 100644 static/img/ice_skating.svg delete mode 100644 static/img/indoor_rower.svg delete mode 100644 static/img/inline_skating.svg delete mode 100644 static/img/kayaking.svg delete mode 100644 static/img/other.svg delete mode 100644 static/img/paddle.svg delete mode 100644 static/img/rowing.svg delete mode 100644 static/img/run.svg delete mode 100644 static/img/ski_erg.svg delete mode 100644 static/img/standup_paddling.svg delete mode 100644 static/img/swim.svg delete mode 100644 static/img/walk.svg delete mode 100644 static/img/weight_training.svg delete mode 100644 static/img/workout.svg delete mode 100644 static/img/yoga.svg diff --git a/rowers/templates/__MACOSX/svg/._bike.svg b/rowers/templates/__MACOSX/svg/._bike.svg deleted file mode 100644 index 61066ba6c67286aa267d20546caf465cde2cc616..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 220 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc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~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij$Vqox1Ojhs@R)|o50+1L3ClDI}@hTt&@$UdJLvdNUf@4sKDTs|7IEI7- zL1jQXrU0=Ano355IDc|}u3ln6K~Ab(Zenr{P=cAEte0b_O^B!VwtutcNX_EmLeoto F7XZsf7ij - - - - - - - diff --git a/static/img/bike_erg.svg b/static/img/bike_erg.svg deleted file mode 100644 index 5e441fb2..00000000 --- a/static/img/bike_erg.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - diff --git a/static/img/canoeing.svg b/static/img/canoeing.svg deleted file mode 100644 index 09406837..00000000 --- a/static/img/canoeing.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - diff --git a/static/img/cd-icons.svg b/static/img/cd-icons.svg deleted file mode 100644 index a6e5b2a4..00000000 --- a/static/img/cd-icons.svg +++ /dev/null @@ -1,846 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - multi-level-accordion-menu/cd-icons.svg at master · CodyHouse/multi-level-accordion-menu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Skip to content -
    - - - - - - - - - - - - -
    - -
    - -
    - - -
    - - - -
    -
    -
    - - - - - - - - - - -
    -
    - -
      -
    • -
      - -
      - - - -
      -
      -
      - - Notifications -
      - - - -
      -
      -
      -
      -
    • - -
    • - -
      -
      - - - -
      -
      - - - -
      - -
    • - -
    • -
      - - - Fork - - -
      - -

      Where should we fork this repository?

      -
      -
      - -
      -

      If this dialog fails to load, you can visit the fork page directly.

      -
      -
      -
      -
      - - -
    • -
    - -

    - - /multi-level-accordion-menu - -

    - -
    - - - - -
    - -
    -
    - - - Permalink - - - - - -
    - -
    - - -
    - -
    -
    - - Switch branches/tags -
    - -
    -
    - -
    -
    - -
    -
    - - - -
    -
    - - -
    - -
    Nothing to show
    -
    - -
    -
    -
    - -
    - - Find file - - - Copy path - -
    - -
    - - - -
    - Fetching contributors… -
    - -
    - - Cannot retrieve contributors at this time -
    -
    - - -
    -
    -
    - - -
    - Raw - Blame - History -
    - - - - - -
    - -
    -
    - -
    - -
    - 27 lines (26 sloc) - - 1.68 KB -
    -
    - - - -
    - -
    -
    - -
    Sorry, something went wrong. Reload?
    -
    Sorry, we cannot display this file.
    -
    Sorry, this file is invalid so it cannot be displayed.
    - -
    -
    - -
    - -
    - -
    - - -
    - - -
    -
    - - -
    - -
    - -
    -
    - -
    - - - - - - -
    - - - You can’t perform that action at this time. -
    - - - - - - - - - -
    - - You signed in with another tab or window. Reload to refresh your session. - You signed out in another tab or window. Reload to refresh your session. -
    - - - - - - -
    - Press h to open a hovercard with more details. -
    - - - - - diff --git a/static/img/cross_country_ski.svg b/static/img/cross_country_ski.svg deleted file mode 100644 index 51260a59..00000000 --- a/static/img/cross_country_ski.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - diff --git a/static/img/crossfit.svg b/static/img/crossfit.svg deleted file mode 100644 index 4865cde7..00000000 --- a/static/img/crossfit.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - diff --git a/static/img/hike.svg b/static/img/hike.svg deleted file mode 100644 index 9b857bc2..00000000 --- a/static/img/hike.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - diff --git a/static/img/ice_skating.svg b/static/img/ice_skating.svg deleted file mode 100644 index 112dd33b..00000000 --- a/static/img/ice_skating.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/static/img/indoor_rower.svg b/static/img/indoor_rower.svg deleted file mode 100644 index eab7ba0c..00000000 --- a/static/img/indoor_rower.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - diff --git a/static/img/inline_skating.svg b/static/img/inline_skating.svg deleted file mode 100644 index f0aae778..00000000 --- a/static/img/inline_skating.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - diff --git a/static/img/kayaking.svg b/static/img/kayaking.svg deleted file mode 100644 index 90dbb0c0..00000000 --- a/static/img/kayaking.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - diff --git a/static/img/other.svg b/static/img/other.svg deleted file mode 100644 index 4c95ea08..00000000 --- a/static/img/other.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/static/img/paddle.svg b/static/img/paddle.svg deleted file mode 100644 index 0056f1ba..00000000 --- a/static/img/paddle.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - diff --git a/static/img/rowing.svg b/static/img/rowing.svg deleted file mode 100644 index aee6bb68..00000000 --- a/static/img/rowing.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/static/img/run.svg b/static/img/run.svg deleted file mode 100644 index 999d7964..00000000 --- a/static/img/run.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - diff --git a/static/img/ski_erg.svg b/static/img/ski_erg.svg deleted file mode 100644 index 7f4eb2be..00000000 --- a/static/img/ski_erg.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - diff --git a/static/img/standup_paddling.svg b/static/img/standup_paddling.svg deleted file mode 100644 index d79f487a..00000000 --- a/static/img/standup_paddling.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - diff --git a/static/img/swim.svg b/static/img/swim.svg deleted file mode 100644 index 7d159811..00000000 --- a/static/img/swim.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - diff --git a/static/img/walk.svg b/static/img/walk.svg deleted file mode 100644 index 0b8f7c06..00000000 --- a/static/img/walk.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - diff --git a/static/img/weight_training.svg b/static/img/weight_training.svg deleted file mode 100644 index eed70eb5..00000000 --- a/static/img/weight_training.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - diff --git a/static/img/workout.svg b/static/img/workout.svg deleted file mode 100644 index 439aeb40..00000000 --- a/static/img/workout.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - diff --git a/static/img/yoga.svg b/static/img/yoga.svg deleted file mode 100644 index 748b75a5..00000000 --- a/static/img/yoga.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - From 29a3481f85d93d9d08a20c0154bbf9add71567e7 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 31 Dec 2021 10:35:21 +0100 Subject: [PATCH 20/20] removed obsolete code --- rowers/views/workoutviews.py | 211 +---------------------------------- 1 file changed, 2 insertions(+), 209 deletions(-) diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index faab6ed7..95a477e9 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -1244,214 +1244,7 @@ def remove_power_view(request,id=0): @user_passes_test(ispromember,login_url='/rowers/paidplans/', message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) -def team_comparison_select(request, - startdatestring="", - enddatestring="", - message='', - successmessage='', - userid=0, - startdate=timezone.now()-datetime.timedelta(days=30), - enddate=timezone.now(), - id=0, - teamid=0): - r = getrequestrower(request,userid=userid) - requestrower = getrower(request.user) - - - request.session.pop('ps',None) - - if 'waterboattype' in request.session: - waterboattype = request.session['waterboattype'] - else: - waterboattype = mytypes.waterboattype - - if 'modalities' in request.session: - modalities = request.session['modalities'] - if len(modalities) > 1: # pragma: no cover - modality = 'all' - else: - modality = modalities[0] - else: - modalities = [m[0] for m in mytypes.workouttypes] - modality = 'all' - - if request.method == 'POST': - dateform = DateRangeForm(request.POST) - if dateform.is_valid(): - startdate = dateform.cleaned_data['startdate'] - enddate = dateform.cleaned_data['enddate'] - startdatestring = startdate.strftime('%Y-%m-%d') - enddatestring = enddate.strftime('%Y-%m-%d') - request.session['startdate'] = startdatestring - request.session['enddate'] = enddatestring - - modalityform = TrendFlexModalForm(request.POST) - if modalityform.is_valid(): - modality = modalityform.cleaned_data['modality'] - waterboattype = modalityform.cleaned_data['waterboattype'] - if modality == 'all': # pragma: no cover - modalities = [m[0] for m in mytypes.workouttypes] - else: - modalities = [modality] - - if modality != 'water': # pragma: no cover - waterboattype = [b[0] for b in mytypes.boattypes] - - - request.session['modalities'] = modalities - request.session['waterboattype'] = waterboattype - else: - dateform = DateRangeForm(initial={ - 'startdate':startdate, - 'enddate':enddate, - }) - modalityform = TrendFlexModalForm(initial={ - 'modality':modality, - 'waterboattype':waterboattype, - }) - - - - - negtypes = [] - for b in mytypes.boattypes: - if b[0] not in waterboattype: - negtypes.append(b[0]) - - startdate = datetime.datetime.combine(startdate,datetime.time()) - enddate = datetime.datetime.combine(enddate,datetime.time(23,59,59)) - #enddate = enddate+datetime.timedelta(days=1) - - if startdatestring: - startdate = iso8601.parse_date(startdatestring) - if enddatestring: - enddate = iso8601.parse_date(enddatestring) - - if enddate < startdate: # pragma: no cover - s = enddate - enddate = startdate - startdate = s - - try: - theteam = Team.objects.get(id=teamid) - except Team.DoesNotExist: - theteam = 0 - - # make sure the dates are not naive - try: - startdate = pytz.utc.localize(startdate) - except ValueError: - pass - try: - enddate = pytz.utc.localize(enddate) - except ValueError: - pass - - if theteam and (theteam.viewing == 'allmembers' or theteam.manager == request.user): - workouts = Workout.objects.filter(team=theteam, - startdatetime__gte=startdate, - startdatetime__lte=enddate, - workouttype__in=modalities).order_by("-date", "-starttime").exclude(boattype__in=negtypes) - elif theteam and theteam.viewing == 'coachonly': # pragma: no cover - workouts = Workout.objects.filter(team=theteam,user=r, - startdatetime__gte=startdate, - startdatetime__lte=enddate, - workouttype__in=modalities).order_by("-date","-starttime").exclude(boattype__in=negtypes) - - - else: - theteam = None - workouts = Workout.objects.filter(user=r, - startdatetime__gte=startdate, - startdatetime__lte=enddate, - workouttype__in=modalities).order_by("-date", "-starttime").exclude(boattype__in=negtypes) - - - query = request.GET.get('q') - if query: # pragma: no cover - 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)) - ) - searchform = SearchForm(initial={'q':query}) - else: - searchform = SearchForm() - - if id: - firstworkout = get_workout(id) - if not is_workout_team(request.user,firstworkout): # pragma: no cover - raise PermissionDenied("You are not allowed to use this workout") - - firstworkoutquery = Workout.objects.filter(id=encoder.decode_hex(id)) - workouts = firstworkoutquery | workouts - else: - firstworkout = None - - form = WorkoutMultipleCompareForm() - form.fields["workouts"].queryset = workouts - if id: - form.fields["workouts"].initial = [firstworkout] - - - - if theteam: - theid = theteam.id - else: - theid = 0 - - chartform = ChartParamChoiceForm(initial={'teamid':0}) - - messages.info(request,successmessage) - messages.error(request,message) - - if id: - breadcrumbs = [ - { - 'url':'/rowers/list-workouts/', - 'name':'Workouts' - }, - { - 'url':get_workout_default_page(request,id), - 'name': firstworkout.name - }, - { - 'url':reverse('team_comparison_select',kwargs={'id':id,'teamid':teamid}), - 'name':'Compare Select' - }, - ] - else: - breadcrumbs = [ - { - 'url':'/rowers/list-workouts/', - 'name':'Workouts' - }, - { - 'url':reverse('team_comparison_select',kwargs={'teamid':teamid}), - 'name': 'Compare Select' - }, - - ] - - return render(request, 'team_compare_select.html', - {'workouts': workouts, - 'workout':firstworkout, - 'dateform':dateform, - 'startdate':startdate, - 'enddate':enddate, - 'team':theteam, - 'searchform':searchform, - 'form':form, - 'rower':r, - 'breadcrumbs':breadcrumbs, - 'active':'nav-workouts', - 'chartform':chartform, - 'modalityform':modalityform, - 'teams':get_my_teams(request.user), - }) def course_mapcompare_view(request,id=0): results = [] @@ -6190,7 +5983,7 @@ def workout_course_view(request, id): ) if records: record = records[0] - else: + else: # pragma: no cover # create record record = VirtualRaceResult( userid = r.id, @@ -6222,7 +6015,7 @@ def workout_course_view(request, id): try: request.session['async_tasks'] += [(job.id,'check_race_course')] - except KeyError: + except KeyError: # pragma: no cover request.session['async_tasks'] = [(job.id,'check_race_course')] messages.info(request,'We are checking your time on the course in the background. You will receive an email when the check is complete. You can check the status here')