From 113c2d0f05a15df7baf339360475b97395109541 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 27 Dec 2021 10:13:24 +0100 Subject: [PATCH 01/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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 3bd9bc9a66636d23e1f65c55d36e0898fd82f0f6 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 30 Dec 2021 12:20:13 +0100 Subject: [PATCH 10/11] 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 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 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 11/11] 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 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