diff --git a/pkg/booking/public.go b/pkg/booking/public.go index a563f12..be029fd 100644 --- a/pkg/booking/public.go +++ b/pkg/booking/public.go @@ -56,8 +56,9 @@ func (h *PublicHandler) Handler(user *auth.User, company *auth.Company, conn *da type publicPage struct { *template.PublicPage - Form *bookingForm - HasErrors bool + Form *bookingForm + HasErrors bool + Environment string } func newPublicPage(r *http.Request, company *auth.Company, conn *database.Conn, l *locale.Locale) (*publicPage, error) { @@ -77,8 +78,7 @@ func newPublicPageWithForm(form *bookingForm) *publicPage { func (p *publicPage) MustRender(w http.ResponseWriter, r *http.Request, user *auth.User, company *auth.Company, conn *database.Conn) { p.Setup(r, user, company, conn) - var err error - if err != nil { + if err := conn.QueryRow(r.Context(), "select environment from redsys where company_id = $1", company.ID).Scan(&p.Environment); err != nil && !database.ErrorIsNotFound(err) { panic(err) } if httplib.IsHTMxRequest(r) { diff --git a/po/ca.po b/po/ca.po index 58da615..9f4bf30 100644 --- a/po/ca.po +++ b/po/ca.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: camper\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n" -"POT-Creation-Date: 2024-02-24 19:56+0100\n" +"POT-Creation-Date: 2024-02-26 15:55+0100\n" "PO-Revision-Date: 2024-02-06 10:04+0100\n" "Last-Translator: jordi fita mas \n" "Language-Team: Catalan \n" @@ -649,6 +649,10 @@ msgstr "Núm. \n" "Language-Team: Spanish \n" @@ -649,6 +649,10 @@ msgstr " \n" "Language-Team: French \n" @@ -649,6 +649,10 @@ msgstr "# RTC %s" msgid "Sorry, there was a problem. You’ll find more details highlighted below." msgstr "Il y avait un problème. Vous trouverez plus de détails ci-dessous." +#: web/templates/public/booking/page.gohtml:20 +msgid "Payment is in test mode. You can make the booking regardless, but no money will be charged. We will send you an additional email with instructions on how to perform the payment." +msgstr "Le paiement est en mode test. Malgré tout, vous pouvez effectuer la réservation, mais aucun argent ne sera facturé. Nous vous enverrons un e-mail supplémentaire avec des instructions sur la manière d’effectuer le paiement." + #: web/templates/public/booking/fields.gohtml:14 #: web/templates/admin/payment/details.gohtml:44 msgctxt "title" diff --git a/web/static/public.css b/web/static/public.css index cb44be0..47b968d 100644 --- a/web/static/public.css +++ b/web/static/public.css @@ -103,7 +103,7 @@ html { --accent: #00aa7d; --accent-2: #FFE37F; --accent-3: #9adff4; - --error: #871d1f; + --error: #876e1d; --clar-rgb: 239, 237, 236; --clar: rgb(var(--clar-rgb)); } @@ -1296,16 +1296,27 @@ button[disabled] { color: var(--error); } +.warning { + color: var(--error); +} + input[aria-invalid="true"] { border-color: var(--error); } -.error[role="alert"] { - background-color: #fae0e3; +div[role="alert"] { padding: 1em; margin: 1em 0 2em; } +.error[role="alert"] { + background-color: #fae0e3; +} + +.warning[role="alert"] { + background-color: #faf4e0; +} + /* radio buttins + checkbox */ /* Context for relative positioning */ diff --git a/web/templates/public/booking/page.gohtml b/web/templates/public/booking/page.gohtml index f95526d..4577f67 100644 --- a/web/templates/public/booking/page.gohtml +++ b/web/templates/public/booking/page.gohtml @@ -15,6 +15,11 @@

{{( gettext "Sorry, there was a problem. You’ll find more details highlighted below." )}}

{{- end }} + {{ if eq .Environment "test" }} + + {{- end }}