diff --git a/backend/server/adventures/serializers.py b/backend/server/adventures/serializers.py index 7bf5faa..a728df0 100644 --- a/backend/server/adventures/serializers.py +++ b/backend/server/adventures/serializers.py @@ -107,7 +107,6 @@ class TrailSerializer(CustomModelSerializer): return 'External Link' class ActivitySerializer(CustomModelSerializer): - trail = TrailSerializer(read_only=True) class Meta: model = Activity diff --git a/frontend/src/lib/components/ActivityCard.svelte b/frontend/src/lib/components/ActivityCard.svelte new file mode 100644 index 0000000..70eb01e --- /dev/null +++ b/frontend/src/lib/components/ActivityCard.svelte @@ -0,0 +1,86 @@ + + +
+
+
+
+ +
{activity.name}
+ {activity.type} +
+ +
+ {#if activity.distance} +
+ Distance: {activity.distance} km + {#if activity.moving_time} + Time: {activity.moving_time} + {/if} +
+ {/if} + + {#if activity.elevation_gain || activity.elevation_loss} +
+ {#if activity.elevation_gain} + ↗ {activity.elevation_gain}m + {/if} + {#if activity.elevation_loss} + ↘ {activity.elevation_loss}m + {/if} +
+ {/if} + + {#if trail} +
+ Trail: {trail.name} +
+ {/if} + + {#if activity.start_date} +
+ Started: {formatDateInTimezone( + activity.start_date, + activity.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone + )} ({activity.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone}) +
+ {/if} + + {#if activity.gpx_file} + + {/if} +
+
+ + +
+
diff --git a/frontend/src/lib/components/StravaActivityCard.svelte b/frontend/src/lib/components/StravaActivityCard.svelte index 8bf84fd..11a70ee 100644 --- a/frontend/src/lib/components/StravaActivityCard.svelte +++ b/frontend/src/lib/components/StravaActivityCard.svelte @@ -1,4 +1,5 @@