diff --git a/db/main.go b/db/main.go index ebea0094..dead885b 100644 --- a/db/main.go +++ b/db/main.go @@ -931,7 +931,14 @@ func listFeedHandler() func(e *core.RecordsListRequestEvent) error { errs := e.App.ExpandRecord(item, []string{"author"}, nil) if len(errs) > 0 { - return fmt.Errorf("failed to expand: %v", errs) + return fmt.Errorf("failed to expand author: %v", errs) + } + + if typ == string(util.TrailFeed) { + errs := e.App.ExpandRecord(item, []string{"category"}, nil) + if len(errs) > 0 { + return fmt.Errorf("failed to expand category: %v", errs) + } } r.MergeExpand(map[string]any{"item": item}) diff --git a/web/src/lib/components/profile/feed_card.svelte b/web/src/lib/components/profile/feed_card.svelte index 87cf1dca..fa8d761e 100644 --- a/web/src/lib/components/profile/feed_card.svelte +++ b/web/src/lib/components/profile/feed_card.svelte @@ -20,10 +20,13 @@ let fullDescription = $state(false); - const timeSince = $derived(formatTimeSince(new Date(feedItem.created ?? ""))); + const timeSince = $derived( + formatTimeSince(new Date(feedItem.created ?? "")), + ); const photos = $derived((feedItem.expand.item as Trail).photos); const location = $derived((feedItem.expand.item as Trail).location); + const category = $derived((feedItem.expand.item as Trail).expand?.category?.name); const trails = $derived((feedItem.expand.item as List).trails); @@ -69,14 +72,21 @@ `@${author?.preferred_username}@${author?.domain}/${feedItem.item}`} >
+ {$_(category)} +
+ {/if} + {#if location} ++ {location} +
+ {/if} ++ {$_(trail.category)} +
{/if} -+ {trail.location} +
+ {/if} +{$_( trail.difficulty ?? "?", )} - +
+ {$_(trail.category)} +
{/if} + {#if trail.location} ++ {trail.location} +
+ {/if} ++ {$_(trail.difficulty ?? "?")} +