Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
{{ define "title" -}}
|
|
|
|
{{( pgettext "Booking" "title" )}}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "content" -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/booking.publicPage*/ -}}
|
|
|
|
<h2>{{( pgettext "Booking" "title" )}}</h2>
|
|
|
|
{{ with .Form -}}
|
2023-12-12 22:16:04 +00:00
|
|
|
<form id="booking" action="/{{ currentLocale }}/booking" method="post">
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
<fieldset>
|
|
|
|
<legend>{{( pgettext "Customer Details" "title" )}}</legend>
|
|
|
|
{{ with .FullName -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Full name" "input" )}}<br>
|
|
|
|
<input type="text" required autocomplete="name" minlength="2"
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
</label>
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" . }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|
|
|
|
{{ with .Address -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Address (optional)" "input" )}}<br>
|
|
|
|
<input type="text" autocomplete="billing street-address"
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
</label>
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" . }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|
|
|
|
{{ with .PostalCode -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Postcode (optional)" "input" )}}<br>
|
|
|
|
<input type="text" autocomplete="billing postal-code"
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
</label>
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" . }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|
|
|
|
{{ with .City -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Town or village (optional)" "input" )}}<br>
|
|
|
|
<input type="text"
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
</label>
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" . }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|
|
|
|
{{ with .Country -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Country" "input" )}}<br>
|
|
|
|
<select name="{{ .Name }}"
|
|
|
|
required autocomplete="country">
|
|
|
|
<option>{{( gettext "Choose a country" )}}</option>
|
|
|
|
{{ template "error-attrs" . }}>{{ template "list-options" . }}
|
|
|
|
</select><br>
|
|
|
|
</label>
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" . }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|
|
|
|
{{ with .Email -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Email" "input" )}}<br>
|
|
|
|
<input type="email" required autocomplete="email"
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
</label>
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" . }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|
|
|
|
{{ with .Phone -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Phone" "input" )}}<br>
|
|
|
|
<input type="tel" required autocomplete="tel"
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
</label>
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" . }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|
|
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
|
|
<legend>{{( pgettext "Accomodation" "title" )}}</legend>
|
|
|
|
{{ range .CampsiteType.Options -}}
|
|
|
|
<label><input type="radio" name="{{ $.Form.CampsiteType.Name }}" value="{{ .Value }}"
|
2023-12-12 22:16:04 +00:00
|
|
|
{{ if $.Form.CampsiteType.IsSelected .Value }}checked{{ end }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
> {{ .Label }}</label><br>
|
|
|
|
{{- end }}
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" .CampsiteType }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
</fieldset>
|
2023-12-12 22:16:04 +00:00
|
|
|
{{ range $campsiteType := .CampsiteType.Options -}}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{ $options := index $.Form.CampsiteTypeOptions .Value }}
|
|
|
|
{{ if $options -}}
|
2023-12-12 22:16:04 +00:00
|
|
|
<fieldset class="campsite-options" data-campsite="{{ $campsiteType.Value }}">
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
<legend>{{ .Label }}</legend>
|
2023-12-12 22:16:04 +00:00
|
|
|
{{ with $.Form.AreaPreferences -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Area preferences (optional)" "input" )}}<br>
|
|
|
|
<input type="text"
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
</label>
|
|
|
|
{{ template "error-message" . }}
|
|
|
|
{{- end }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{ range $options -}}
|
|
|
|
<label>
|
|
|
|
{{ .Label }}<br>
|
|
|
|
<input type="number" required
|
|
|
|
name="{{ .Input.Name }}" value="{{ .Input.Val }}"
|
|
|
|
min="{{ .Min }}" max="{{ .Max }}"
|
|
|
|
{{ template "error-attrs" .Input }}
|
|
|
|
><br>
|
|
|
|
</label>
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" .Input }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|
|
|
|
</fieldset>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
<fieldset>
|
|
|
|
<legend>{{( pgettext "Booking Period" "title" )}}</legend>
|
|
|
|
{{ with .ArrivalDate -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Arrival date" "input" )}}<br>
|
|
|
|
<input type="date" required
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
</label>
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" . }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|
|
|
|
{{ with .DepartureDate -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Departure date" "input" )}}<br>
|
|
|
|
<input type="date" required
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
</label>
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" . }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|
|
|
|
{{ with .ACSICard -}}
|
|
|
|
<label>
|
|
|
|
<input type="checkbox" name="{{ .Name }}" {{ if .Checked}}checked{{ end }}
|
|
|
|
{{ template "error-attrs" . }}
|
|
|
|
> {{( pgettext "ACSI card? (optional)" "input" )}}</label><br>
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" . }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|
|
|
|
{{ with .Agreement -}}
|
|
|
|
<label>
|
|
|
|
<input type="checkbox" required name="{{ .Name }}" {{ if .Checked}}checked{{ end }}
|
|
|
|
{{ template "error-attrs" . }}
|
|
|
|
> {{( pgettext "I have read and I accept the reservation conditions" "input" )}}</label><br>
|
2023-10-27 10:37:09 +00:00
|
|
|
{{ template "error-message" . }}
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|
|
|
|
</fieldset>
|
|
|
|
<footer>
|
|
|
|
<button type="submit">{{( pgettext "Book" "action" )}} <span>→</span></button>
|
|
|
|
</footer>
|
|
|
|
</form>
|
|
|
|
{{- end }}
|
2023-12-12 22:16:04 +00:00
|
|
|
|
|
|
|
<script>
|
|
|
|
const fieldSets = Array.from(document.querySelectorAll('fieldset[data-campsite]'));
|
|
|
|
const options = document.querySelectorAll('input[type="radio"]');
|
|
|
|
|
|
|
|
function toggleFieldSets(input) {
|
|
|
|
const campsite = input.value;
|
|
|
|
for (const fieldSet of fieldSets) {
|
|
|
|
if (fieldSet.dataset.campsite === campsite) {
|
|
|
|
fieldSet.classList.add('is-visible');
|
|
|
|
} else {
|
|
|
|
fieldSet.classList.remove('is-visible');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (const option of Array.from(options)) {
|
|
|
|
option.addEventListener('change', (e) => toggleFieldSets(e.target));
|
|
|
|
if (option.checked) {
|
|
|
|
toggleFieldSets(option);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
Add the first draft of the booking and payment forms
The form is based on the one in the current website, but in a single
page instead of split into many pages; possibly each <fieldset> should
be in a separate page/view. The idea is for Oriol to check the design
and decide how it would be presented to the user, so i needed something
to show him first.
I hardcoded the **test** data for the customer’s Redsys account. Is
this bad? I hope not, but i am not really, really sure.
The data sent to Redsys is just a placeholder because there are booking
details that i do not know, like what i have to do with the “teenagers”
field or the area preferences, thus i can not yet have a booking
relation. Nevertheless, had to generate a random order number up to
12-chars in length or Redsys would refuse the payment, claiming that
the order is duplicated.
The Redsys package is based on the PHP code provided by Redsys
themselves, plus some hints at the implementations from various Go
packages that did not know why they were so complicated.
Had to grant select on table country to guest in order to show the
select with the country options.
I have changed the “Postal code” input in taxDetails for “Postcode”
because this is the spell that it is used in the current web, i did not
see a reason to change it—it is an accepted form—, and i did not want to
have inconsistencies between forms.
2023-10-19 19:37:34 +00:00
|
|
|
{{- end }}
|