Merge pull request #471 from SamR1/add-cycling-trekking

add new sport: "Cycling (Trekking)"
This commit is contained in:
Sam 2023-12-20 15:17:56 +01:00 committed by GitHub
commit ef22e98124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 146 additions and 55 deletions

View File

@ -7,7 +7,7 @@
<link rel="stylesheet" href="/static/css/fork-awesome.min.css"/>
<link rel="stylesheet" href="/static/css/leaflet.css"/>
<title>FitTrackee</title>
<script type="module" crossorigin src="/static/index-uYw8Gs-g.js"></script>
<script type="module" crossorigin src="/static/index-9Y8IgSRf.js"></script>
<link rel="modulepreload" crossorigin href="/static/charts-_RwsDDkL.js">
<link rel="modulepreload" crossorigin href="/static/maps-ZyuCPqes.js">
<link rel="stylesheet" crossorigin href="/static/css/maps-B7qTrBCW.css">

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,34 @@
"""add cycling (trekking) sport
Revision ID: 4d51a4ca8001
Revises: 14f48e46f320
Create Date: 2023-12-20 13:45:48.654139
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4d51a4ca8001'
down_revision = '14f48e46f320'
branch_labels = None
depends_on = None
def upgrade():
op.execute(
"""
INSERT INTO sports (label, is_active, stopped_speed_threshold)
VALUES ('Cycling (Trekking)', True, 1)
"""
)
def downgrade():
op.execute(
"""
DELETE FROM sports
WHERE label = 'Cycling (Trekking)';
"""
)

View File

@ -0,0 +1,48 @@
<template>
<svg
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 491.737 491.737"
style="enable-background: new 0 0 491.737 491.737"
xml:space="preserve"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
>
<desc id="cyclingTransportDescription">
silhouette of a person riding a bicycle for touring/trekking
</desc>
<g id="g147">
<path
d="m 189.097,82.359 c 20.97701,12.331184 47.97442,5.308784 60.293,-15.652 12.32942,-20.979222 5.35418,-47.981117 -15.623,-60.304 -21.00482,-12.3391184 -47.99,-5.317 -60.314,15.65 -12.324,20.983 -5.34599,47.967183 15.644,60.306 z"
id="path143"
/>
<path
d="m 412.63084,325.54523 c 15.10712,9.70649 36.72648,11.228 50.24355,-1.74311 10.12045,-9.71168 26.98754,-58.21287 19.13047,-84.00249 -5.54912,-18.21414 -77.53771,-17.98153 -86.41316,-1.47737 -8.87545,16.51677 1.92265,77.51047 17.03914,87.22297 z"
id="path143-7"
style="stroke-width: 0.752918"
/>
<path
d="m 25.792055,330.5362 c 18.55881,12.33119 45.643209,16.23646 62.248659,-0.24212 12.432766,-12.33778 33.153656,-73.954 23.501396,-106.7173 -6.81698,-23.13936 -95.253546,-22.84386 -106.1568557,-1.87685 -10.90332,20.983 1.8364907,96.49745 20.4068007,108.83627 z"
id="path143-7-3"
style="stroke-width: 0.940597"
/>
<path
d="m 393.081,264.102 c -2.414,0 -4.8,0.194 -7.169,0.362 l -14.431,-71.605 4.702,-1.757 c 10.666,-3.987 16.093,-15.868 12.098,-26.54 -3.994,-10.681 -15.946,-16.084 -26.531,-12.09 l -63.05508,-1.53717 C 284.04753,137.09803 248.90259,106.55858 243.33317,101.62481 217.77732,75.090916 186.1698,85.012419 178.0988,91.544419 L 140.764,192.085 l 0.016,0.024 c -3.319,2.893 -6.089,6.485 -7.86,10.842 -2.191,5.396 -2.596,11.067 -1.564,16.384 -8.503,0.669 -15.255,7.571 -15.255,16.246 0,9.085 7.346,16.44 16.432,16.48 l -6.797,15.906 c -8.62,-2.465 -17.674,-3.866 -27.066,-3.866 C 44.27,264.102 0,308.354 0,362.754 c 0,54.403 44.27,98.663 98.668,98.663 54.403,0 98.652,-44.26 98.652,-98.663 0,-36.228 -19.683,-67.867 -48.858,-85.024 l 10.957,-25.652 h 17.767 l 60.281,24.462 -32.201,52.773 c -8.297,13.612 -3.994,31.382 9.615,39.685 4.691,2.86 9.878,4.229 15,4.229 9.729,0 19.234,-4.929 24.677,-13.838 l 29.339,-48.095 19.072,11.511 c -5.447,12.227 -8.54,25.726 -8.54,39.95 0,54.403 44.254,98.663 98.652,98.663 54.402,0 98.656,-44.26 98.656,-98.663 0,-54.401 -44.254,-98.653 -98.656,-98.653 z M 98.668,436.671 c -40.756,0 -73.923,-33.161 -73.923,-73.917 0,-40.756 33.167,-73.909 73.923,-73.909 5.944,0 11.649,0.896 17.188,2.224 L 95.38,338.962 c -11.758,1.619 -20.843,11.598 -20.843,23.792 0,13.323 10.808,24.132 24.13,24.132 8.767,0 16.367,-4.745 20.589,-11.76 h 52.065 c -5.926,34.862 -36.133,61.545 -72.653,61.545 z m 72.654,-86.288 h -52.065 c -0.355,-0.588 -0.708,-1.176 -1.112,-1.732 l 20.476,-47.901 c 17.058,11.026 29.172,28.845 32.701,49.633 z m 125.459,-60.208 7.666,-12.564 c 4.416,-7.233 5.431,-16.038 2.774,-24.084 -2.661,-8.046 -8.718,-14.515 -16.562,-17.704 l -73.83357,-31.7176 16.7558,-45.21274 c 10.36934,4.13303 41.82171,27.90767 45.77423,28.08592 3.271,1.981 8.57725,1.46711 12.29625,1.46711 2.435,0 18.50584,0.70472 20.84384,-0.16628 L 343.32113,188.03378 361.635,269.33 c -18.268,6.162 -34.117,17.51 -45.848,32.314 z m 78.615,47.458 -38.003,-22.94 c 7.877,-9.118 17.787,-16.319 29.205,-20.734 z m 17.685,99.038 c -40.757,0 -73.907,-33.161 -73.907,-73.917 0,-9.544 1.965,-18.597 5.268,-26.983 l 44.541,26.888 c 0,0.032 -0.016,0.064 -0.016,0.095 0,13.323 10.808,24.132 24.114,24.132 13.322,0 24.118,-10.81 24.118,-24.132 0,-10.478 -6.721,-19.307 -16.06,-22.64 l -10.277,-51.043 c 0.756,-0.024 1.463,-0.226 2.22,-0.226 40.757,0 73.911,33.153 73.911,73.909 -10e-4,40.756 -33.155,73.917 -73.912,73.917 z"
id="path145"
/>
<path
d="m 98.079227,176.49635 c 13.145933,8.97747 51.311073,23.25692 63.073363,11.26002 8.80662,-8.98227 30.04886,-56.65215 23.21179,-80.5048 -4.82873,-16.846152 -62.52445,-29.763373 -70.2477,-14.498781 -7.72324,15.276261 -29.191527,74.760531 -16.037453,83.743561 z"
id="path143-7-9"
style="stroke-width: 0.675458"
/>
</g>
</svg>
</template>
<script lang="ts">
export default {
name: 'CyclingTransport',
}
</script>

View File

@ -5,6 +5,7 @@
:title="title ? title : $t(`sports.${sportLabel}.LABEL`)"
>
<CyclingSport v-if="sportLabel === 'Cycling (Sport)'" />
<CyclingTrekking v-if="sportLabel === 'Cycling (Trekking)'" />
<CyclingTransport v-if="sportLabel === 'Cycling (Transport)'" />
<CyclingVirtual v-if="sportLabel === 'Cycling (Virtual)'" />
<Hiking v-if="sportLabel === 'Hiking'" />
@ -30,6 +31,7 @@
import CyclingSport from '@/components/Common/Images/SportImage/CyclingSport.vue'
import CyclingTransport from '@/components/Common/Images/SportImage/CyclingTransport.vue'
import CyclingTrekking from '@/components/Common/Images/SportImage/CyclingTrekking.vue'
import CyclingVirtual from '@/components/Common/Images/SportImage/CyclingVirtual.vue'
import Hiking from '@/components/Common/Images/SportImage/Hiking.vue'
import MountainBiking from '@/components/Common/Images/SportImage/MountainBiking.vue'

View File

@ -5,6 +5,9 @@
"Cycling (Transport)": {
"LABEL": "Cycling (Transport)"
},
"Cycling (Trekking)": {
"LABEL": "Cycling (Trekking)"
},
"Cycling (Virtual)": {
"LABEL": "Cycling (Virtual)"
},

View File

@ -5,6 +5,9 @@
"Cycling (Transport)": {
"LABEL": "Vélo (Transport)"
},
"Cycling (Trekking)": {
"LABEL": "Vélo (Trekking)"
},
"Cycling (Virtual)": {
"LABEL": "Vélo (Virtuel)"
},

View File

@ -3,6 +3,7 @@ import type { IWorkout } from '@/types/workouts'
export const sportColors: Record<string, string> = {
'Cycling (Sport)': '#4c9792',
'Cycling (Trekking)': '#a8af88',
'Cycling (Transport)': '#88af98',
'Cycling (Virtual)': '#64a360',
Hiking: '#bb757c',