Show a disclaimer on top of book button that it is in fact a prebooking

This commit is contained in:
jordi fita mas 2024-02-15 15:54:22 +01:00
parent 3bc4175580
commit a159bc75f0
6 changed files with 81 additions and 28 deletions

View File

@ -10,10 +10,11 @@ import (
)
type bookingCart struct {
Lines []*cartLine
Total string
DownPayment string
Enabled bool
Lines []*cartLine
Total string
DownPayment string
DownPaymentPercent int
Enabled bool
}
type cartLine struct {
@ -95,6 +96,7 @@ func newBookingCart(ctx context.Context, conn *database.Conn, f *bookingForm, ca
, to_price(subtotal_tourist_tax, decimal_digits)
, to_price(total, decimal_digits)
, to_price(payment.down_payment, decimal_digits)
, (payment.down_payment_percent * 100)::int
from draft_payment($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) as payment
join currency using (currency_code)
`,
@ -131,6 +133,7 @@ func newBookingCart(ctx context.Context, conn *database.Conn, f *bookingForm, ca
&touristTax,
&total,
&downPayment,
&cart.DownPaymentPercent,
); err != nil {
if database.ErrorIsNotFound(err) {
return cart, nil

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: camper\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2024-02-14 04:43+0100\n"
"POT-Creation-Date: 2024-02-15 15:41+0100\n"
"PO-Revision-Date: 2024-02-06 10:04+0100\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Catalan <ca@dodds.net>\n"
@ -256,7 +256,7 @@ msgid "Discover"
msgstr "Descobreix"
#: web/templates/public/campsite/type.gohtml:49
#: web/templates/public/booking/fields.gohtml:256
#: web/templates/public/booking/fields.gohtml:266
msgctxt "action"
msgid "Book"
msgstr "Reserva"
@ -776,6 +776,18 @@ msgctxt "cart"
msgid "Down payment"
msgstr "A compte"
#: web/templates/public/booking/fields.gohtml:258
msgid "By down paying the %d %% of the total, you are pre-booking your preferences. We will respond within 24 hours and this percentage will be charged if accepted."
msgstr "En tramitar el %d %% del total esteu realitzant la prereserva de les vostres preferències. Us respondrem en un termini de 24 hores i us cobrarem aquest percentatge en cas que sigui acceptada."
#: web/templates/public/booking/fields.gohtml:260
msgid "By paying the total you are pre-booking your preferences. We will respond within 24 hours and this amount will be charged if accepted."
msgstr "En tramitar el pagament del total esteu realitzant la prereserva de les vostres preferències. Us respondrem en un termini de 24 hores i us cobrarem aquesta quantitat en cas que sigui acceptada."
#: web/templates/public/booking/fields.gohtml:264
msgid "See <%s>our conditions</%s> for more information."
msgstr "Consulteu <%s>les nostres condicions</%s> per a més informació."
#: web/templates/admin/payment/settings.gohtml:6
#: web/templates/admin/payment/index.gohtml:14
msgctxt "title"
@ -891,7 +903,7 @@ msgctxt "cart"
msgid "Nights"
msgstr "Nits"
#: web/templates/admin/payment/details.gohtml:80 pkg/booking/cart.go:188
#: web/templates/admin/payment/details.gohtml:80 pkg/booking/cart.go:191
msgctxt "cart"
msgid "Tourist tax"
msgstr "Impost turístic"
@ -2702,27 +2714,27 @@ msgstr "No podeu deixar el fitxer del mèdia en blanc."
msgid "Filename can not be empty."
msgstr "No podeu deixar el nom del fitxer en blanc."
#: pkg/booking/cart.go:150
#: pkg/booking/cart.go:153
msgctxt "cart"
msgid "Night"
msgstr "Nit"
#: pkg/booking/cart.go:151
#: pkg/booking/cart.go:154
msgctxt "cart"
msgid "Adult"
msgstr "Adult"
#: pkg/booking/cart.go:152
#: pkg/booking/cart.go:155
msgctxt "cart"
msgid "Teenager"
msgstr "Adolescent"
#: pkg/booking/cart.go:153
#: pkg/booking/cart.go:156
msgctxt "cart"
msgid "Child"
msgstr "Nen"
#: pkg/booking/cart.go:154
#: pkg/booking/cart.go:157
msgctxt "cart"
msgid "Dog"
msgstr "Gos"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: camper\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2024-02-14 04:47+0100\n"
"POT-Creation-Date: 2024-02-15 15:41+0100\n"
"PO-Revision-Date: 2024-02-06 10:04+0100\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Spanish <es@tp.org.es>\n"
@ -256,7 +256,7 @@ msgid "Discover"
msgstr "Descubre"
#: web/templates/public/campsite/type.gohtml:49
#: web/templates/public/booking/fields.gohtml:256
#: web/templates/public/booking/fields.gohtml:266
msgctxt "action"
msgid "Book"
msgstr "Reservar"
@ -776,6 +776,18 @@ msgctxt "cart"
msgid "Down payment"
msgstr "A cuenta"
#: web/templates/public/booking/fields.gohtml:258
msgid "By down paying the %d %% of the total, you are pre-booking your preferences. We will respond within 24 hours and this percentage will be charged if accepted."
msgstr "En tramitar el %d %% del total estáis realizando la prerreserva de vuestras preferencias. Os responderemos en un término de 24 horas y os cobraremos este porcentaje en caso que sea aceptada."
#: web/templates/public/booking/fields.gohtml:260
msgid "By paying the total you are pre-booking your preferences. We will respond within 24 hours and this amount will be charged if accepted."
msgstr "En tramitar el pago del total estáis realizando la prerreserva de vuestras preferencias. Os responderemos en un término de 24 horas y os cobraremos esta cantidad en caso que sea aceptada."
#: web/templates/public/booking/fields.gohtml:264
msgid "See <%s>our conditions</%s> for more information."
msgstr "Consultad <%s>nuestras condiciones</%s> para más información."
#: web/templates/admin/payment/settings.gohtml:6
#: web/templates/admin/payment/index.gohtml:14
msgctxt "title"
@ -893,7 +905,7 @@ msgctxt "cart"
msgid "Nights"
msgstr "Noches"
#: web/templates/admin/payment/details.gohtml:80 pkg/booking/cart.go:188
#: web/templates/admin/payment/details.gohtml:80 pkg/booking/cart.go:191
msgctxt "cart"
msgid "Tourist tax"
msgstr "Impuesto turístico"
@ -2704,27 +2716,27 @@ msgstr "No podéis dejar el archivo del medio en blanco."
msgid "Filename can not be empty."
msgstr "No podéis dejar el nombre del archivo en blanco."
#: pkg/booking/cart.go:150
#: pkg/booking/cart.go:153
msgctxt "cart"
msgid "Night"
msgstr "Noche"
#: pkg/booking/cart.go:151
#: pkg/booking/cart.go:154
msgctxt "cart"
msgid "Adult"
msgstr "Adulto"
#: pkg/booking/cart.go:152
#: pkg/booking/cart.go:155
msgctxt "cart"
msgid "Teenager"
msgstr "Adolescente"
#: pkg/booking/cart.go:153
#: pkg/booking/cart.go:156
msgctxt "cart"
msgid "Child"
msgstr "Niño"
#: pkg/booking/cart.go:154
#: pkg/booking/cart.go:157
msgctxt "cart"
msgid "Dog"
msgstr "Perro"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: camper\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2024-02-14 04:47+0100\n"
"POT-Creation-Date: 2024-02-15 15:48+0100\n"
"PO-Revision-Date: 2024-02-06 10:05+0100\n"
"Last-Translator: Oriol Carbonell <info@oriolcarbonell.cat>\n"
"Language-Team: French <traduc@traduc.org>\n"
@ -256,7 +256,7 @@ msgid "Discover"
msgstr "Découvrir"
#: web/templates/public/campsite/type.gohtml:49
#: web/templates/public/booking/fields.gohtml:256
#: web/templates/public/booking/fields.gohtml:266
msgctxt "action"
msgid "Book"
msgstr "Réserver"
@ -776,6 +776,18 @@ msgctxt "cart"
msgid "Down payment"
msgstr "Acompte"
#: web/templates/public/booking/fields.gohtml:258
msgid "By down paying the %d %% of the total, you are pre-booking your preferences. We will respond within 24 hours and this percentage will be charged if accepted."
msgstr "En En effectuant le paiement de %d %% du total vous pré-réservez vos préférences. Nous vous répondrons dans les 24 heures et ce pourcentage sera facturé en cas dacceptation."
#: web/templates/public/booking/fields.gohtml:260
msgid "By paying the total you are pre-booking your preferences. We will respond within 24 hours and this amount will be charged if accepted."
msgstr "En procédant au paiement du montant total vous pré-réservez vos préférences. Nous vous répondrons dans les 24 heures et ce montant sera facturé en cas dacceptation."
#: web/templates/public/booking/fields.gohtml:264
msgid "See <%s>our conditions</%s> for more information."
msgstr "Consultez <%s>nos conditions</%s> pour plus dinformations."
#: web/templates/admin/payment/settings.gohtml:6
#: web/templates/admin/payment/index.gohtml:14
msgctxt "title"
@ -893,7 +905,7 @@ msgctxt "cart"
msgid "Nights"
msgstr "Nuits"
#: web/templates/admin/payment/details.gohtml:80 pkg/booking/cart.go:188
#: web/templates/admin/payment/details.gohtml:80 pkg/booking/cart.go:191
msgctxt "cart"
msgid "Tourist tax"
msgstr "Taxe touristique"
@ -2704,27 +2716,27 @@ msgstr "Le fichier téléchargé ne peut pas être vide."
msgid "Filename can not be empty."
msgstr "Le nom de fichier ne peut pas être vide."
#: pkg/booking/cart.go:150
#: pkg/booking/cart.go:153
msgctxt "cart"
msgid "Night"
msgstr "Nuit"
#: pkg/booking/cart.go:151
#: pkg/booking/cart.go:154
msgctxt "cart"
msgid "Adult"
msgstr "Adulte"
#: pkg/booking/cart.go:152
#: pkg/booking/cart.go:155
msgctxt "cart"
msgid "Teenager"
msgstr "Adolescent"
#: pkg/booking/cart.go:153
#: pkg/booking/cart.go:156
msgctxt "cart"
msgid "Child"
msgstr "Enfant"
#: pkg/booking/cart.go:154
#: pkg/booking/cart.go:157
msgctxt "cart"
msgid "Dog"
msgstr "Chien"

View File

@ -1463,6 +1463,10 @@ input[type="checkbox"]:focus {
text-decoration: var(--accent) wavy underline;
}
#booking footer p + p {
margin: .75em 0;
}
/*<editor-fold desc="booking cart">*/
#booking .cart {

File diff suppressed because one or more lines are too long