Feature/trail table view (#138)

* add "Table"

* add trails table view

* style table header

* add author image, adjust table layout

* tooltip for author image

* i18n for author tooltip

* trail sorting by duration and author

* remove sort by elevation loss, add sort by duration instead

* improve table layout

* fix meilisearch migration

* revert removing elevation_loss from sortOptions

* add badge for public trails

* hide public badge on small screens

* adds share info button to trail_table
This commit is contained in:
tofublock
2024-12-13 20:39:42 +01:00
committed by GitHub
parent d1a416629b
commit 85729e9728
12 changed files with 299 additions and 39 deletions

View File

@@ -0,0 +1,36 @@
package migrations
import (
"os"
"github.com/meilisearch/meilisearch-go"
"github.com/pocketbase/dbx"
m "github.com/pocketbase/pocketbase/migrations"
)
func init() {
client := meilisearch.New(os.Getenv("MEILI_URL"), meilisearch.WithAPIKey(os.Getenv("MEILI_MASTER_KEY")))
m.Register(func(db dbx.Builder) error {
_, err := client.Index("trails").UpdateSortableAttributes(&[]string{
"created", "date", "difficulty", "distance", "elevation_gain", "elevation_loss", "name", "duration", "author",
})
if err != nil {
return err
}
return nil
}, func(db dbx.Builder) error {
_, err := client.Index("trails").UpdateSortableAttributes(&[]string{
"created", "date", "difficulty", "distance", "elevation_gain", "elevation_loss", "name",
})
if err != nil {
return err
}
return nil
})
}