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.
This commit is contained in:
jordi fita mas 2023-10-19 21:38:44 +02:00
parent 302ce29e4a
commit 048b7cbf90
2 changed files with 3 additions and 0 deletions

View File

@ -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,

View File

@ -35,6 +35,7 @@
<div class="campsite_type_booking">
<form action="/{{ currentLocale }}/booking" method="get">
<input type="hidden" name="type" value="{{ .Slug }}">
<fieldset>
<label>
{{( pgettext "Check-in Date" "input")}}