From 0b00c293bf746b2cb94cb6653c106f936d1690fe Mon Sep 17 00:00:00 2001 From: Code by Ben Date: Tue, 15 Oct 2024 10:35:34 +1100 Subject: [PATCH] group releaser upload form autofil uses releaser index value instead of the humanized name. this is to fix mismatched values getting stored in the database. --- handler/app/context.go | 2 +- model/releaser.go | 2 +- view/app/uploader_modal.tmpl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/handler/app/context.go b/handler/app/context.go index 5f38e835..715a56ac 100644 --- a/handler/app/context.go +++ b/handler/app/context.go @@ -1272,7 +1272,7 @@ func Releasers(c echo.Context, db *sql.DB, logger *zap.SugaredLogger, uri string data["demozoo"] = strconv.Itoa(int(demozoo.Find(uri))) data["sixteen"] = sixteen.Find(uri) data["website"] = site.Find(uri) - data["uploader-releaser"] = s + data["uploader-releaser-index"] = releaser.Index(uri) data[records] = fs switch uri { case "independent": diff --git a/model/releaser.go b/model/releaser.go index ef7f4ed6..9953df1c 100644 --- a/model/releaser.go +++ b/model/releaser.go @@ -265,7 +265,7 @@ func (r *Releasers) Magazine(ctx context.Context, exec boil.ContextExecutor) err return nil } -// Slugs saves URL friendly strings to the Group names. +// Slugs sets URL friendly strings to the Group names. func (r *Releasers) Slugs() { for _, releaser := range *r { releaser.Unique.URI = helper.Slug(releaser.Unique.Name) diff --git a/view/app/uploader_modal.tmpl b/view/app/uploader_modal.tmpl index fcb63cfd..bbc0248c 100644 --- a/view/app/uploader_modal.tmpl +++ b/view/app/uploader_modal.tmpl @@ -9,7 +9,7 @@ - `layout-htmx.js`, a `afterRequest()` method must be used to handle the server response. - */}} {{- $screenshot := "A screenshot can be included in the archive."}} -{{- $releasername := index . "uploader-releaser"}} +{{- $releasername := index . "uploader-releaser-index"}} {{- $delay := "200ms" }} {{- /* check if the event is a KeyboardEvent to prevent double rendering on datalists source: https://turriate.com/articles/using-datalist-for-typeahead-htmx */ -}}