From 27147530ee03e68a487b8c3b54b3c39a853d1d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Date: Wed, 12 Jul 2023 21:31:39 +0200 Subject: [PATCH] New sport: Paragliding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WIP. Signed-off-by: Marc Poulhiès --- .../versions/33_d22670a89a54_paragliding.py | 33 ++++++++++ .../Common/Images/SportImage/Paragliding.vue | 62 +++++++++++++++++++ .../Common/Images/SportImage/index.vue | 2 + fittrackee_client/src/locales/en/sports.json | 3 + fittrackee_client/src/locales/fr/sports.json | 3 + fittrackee_client/src/utils/sports.ts | 1 + 6 files changed, 104 insertions(+) create mode 100644 fittrackee/migrations/versions/33_d22670a89a54_paragliding.py create mode 100644 fittrackee_client/src/components/Common/Images/SportImage/Paragliding.vue diff --git a/fittrackee/migrations/versions/33_d22670a89a54_paragliding.py b/fittrackee/migrations/versions/33_d22670a89a54_paragliding.py new file mode 100644 index 00000000..a000ed06 --- /dev/null +++ b/fittrackee/migrations/versions/33_d22670a89a54_paragliding.py @@ -0,0 +1,33 @@ +"""add paragliding sport + +Revision ID: d22670a89a54 +Revises: eff1c16c43eb +Create Date: 2023-07-12 21:00:11.291517 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'd22670a89a54' +down_revision = 'eff1c16c43eb' +branch_labels = None +depends_on = None + + +def upgrade(): + op.execute( + """ + INSERT INTO sports (label, is_active, stopped_speed_threshold) + VALUES ('Paragliding', True, 0.1) + """ + ) + +def downgrade(): + op.execute( + """ + DELETE FROM sports + WHERE label = 'Paragliding'; + """ + ) diff --git a/fittrackee_client/src/components/Common/Images/SportImage/Paragliding.vue b/fittrackee_client/src/components/Common/Images/SportImage/Paragliding.vue new file mode 100644 index 00000000..048ac176 --- /dev/null +++ b/fittrackee_client/src/components/Common/Images/SportImage/Paragliding.vue @@ -0,0 +1,62 @@ + + + diff --git a/fittrackee_client/src/components/Common/Images/SportImage/index.vue b/fittrackee_client/src/components/Common/Images/SportImage/index.vue index 396df149..dc573bf8 100644 --- a/fittrackee_client/src/components/Common/Images/SportImage/index.vue +++ b/fittrackee_client/src/components/Common/Images/SportImage/index.vue @@ -13,6 +13,7 @@ v-if="sportLabel === 'Mountain Biking (Electric)'" /> + @@ -33,6 +34,7 @@ import MountainBiking from '@/components/Common/Images/SportImage/MountainBiking.vue' import MountainBikingElectric from '@/components/Common/Images/SportImage/MountainBikingElectric.vue' import Mountaineering from '@/components/Common/Images/SportImage/Mountaineering.vue' + import Paragliding from '@/components/Common/Images/SportImage/Paragliding.vue' import Rowing from '@/components/Common/Images/SportImage/Rowing.vue' import Running from '@/components/Common/Images/SportImage/Running.vue' import SkiingAlpine from '@/components/Common/Images/SportImage/SkiingAlpine.vue' diff --git a/fittrackee_client/src/locales/en/sports.json b/fittrackee_client/src/locales/en/sports.json index 5acf0c09..08a20fcc 100644 --- a/fittrackee_client/src/locales/en/sports.json +++ b/fittrackee_client/src/locales/en/sports.json @@ -20,6 +20,9 @@ "Mountaineering": { "LABEL": "Mountaineering" }, + "Paragliding": { + "LABEL": "Paragliding" + }, "Rowing": { "LABEL": "Rowing" }, diff --git a/fittrackee_client/src/locales/fr/sports.json b/fittrackee_client/src/locales/fr/sports.json index 2f9072ff..6237e0ae 100644 --- a/fittrackee_client/src/locales/fr/sports.json +++ b/fittrackee_client/src/locales/fr/sports.json @@ -20,6 +20,9 @@ "Mountaineering": { "LABEL": "Alpinisme" }, + "Paragliding": { + "LABEL": "Parapente" + }, "Rowing": { "LABEL": "Aviron" }, diff --git a/fittrackee_client/src/utils/sports.ts b/fittrackee_client/src/utils/sports.ts index 0559992a..feafe3d0 100644 --- a/fittrackee_client/src/utils/sports.ts +++ b/fittrackee_client/src/utils/sports.ts @@ -9,6 +9,7 @@ export const sportColors: Record = { 'Mountain Biking': '#d4b371', 'Mountain Biking (Electric)': '#fc9d6f', Mountaineering: '#48b3b7', + Paragliding: '#c23c50', Rowing: '#fcce72', Running: '#835b83', 'Skiing (Alpine)': '#67a4bd',