From 048b7cbf90f79e74710e4aeb4572ea601fe2a77c Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Thu, 19 Oct 2023 21:38:44 +0200 Subject: [PATCH] Add the slug to the form in the campsite type public page The idea is that the booking form will be prefilled with the values passed from that other mini-form, and the campsite type is implicit due to the page where the form is located at, but i need to give it to the booking page. The booking page does not yet use that information. --- pkg/campsite/types/public.go | 2 ++ web/templates/public/campsite/type.gohtml | 1 + 2 files changed, 3 insertions(+) diff --git a/pkg/campsite/types/public.go b/pkg/campsite/types/public.go index 2dda5ad..b536769 100644 --- a/pkg/campsite/types/public.go +++ b/pkg/campsite/types/public.go @@ -61,6 +61,7 @@ func (h *PublicHandler) Handler(user *auth.User, company *auth.Company, conn *da type publicPage struct { *template.PublicPage + Slug string Name string Carousel []*carousel.Slide Prices []*typePrice @@ -101,6 +102,7 @@ func newPublicPage(ctx context.Context, company *auth.Company, conn *database.Co } page := &publicPage{ PublicPage: template.NewPublicPage(), + Slug: slug, Carousel: mustCollectSlides(ctx, conn, loc, slug), Calendar: calendar, Prices: prices, diff --git a/web/templates/public/campsite/type.gohtml b/web/templates/public/campsite/type.gohtml index d90f140..dbb2a79 100644 --- a/web/templates/public/campsite/type.gohtml +++ b/web/templates/public/campsite/type.gohtml @@ -35,6 +35,7 @@
+