Added note about dogs to the campsite type page

The pets icon is just the same as the notpet but without the diagonal
bar.

The price is hardcoded in the query for now, as there is no field
in the campsite type.
This commit is contained in:
jordi fita mas 2024-01-15 02:07:32 +01:00
parent 0beb0bb315
commit 0ed6c1b121
7 changed files with 78 additions and 31 deletions

View File

@ -64,8 +64,10 @@ type publicPage struct {
*template.PublicPage
Slug string
Name string
DogsAllowed bool
Carousel []*carousel.Slide
Prices []*typePrice
DogsPrice string
TouristTax string
Features []*typeFeature
Calendar *season.Calendar
@ -123,12 +125,14 @@ func newPublicPage(ctx context.Context, company *auth.Company, conn *database.Co
, coalesce(i18n.facilities, campsite_type.facilities)::text as l10n_facilities
, coalesce(i18n.description, campsite_type.description)::text as l10n_description
, coalesce(i18n.additional_info, campsite_type.additional_info)::text as l10n_description
, dogs_allowed
, '3.50' as dogs_prices
from campsite_type
left join campsite_type_i18n as i18n on campsite_type.campsite_type_id = i18n.campsite_type_id and i18n.lang_tag = $1
where slug = $2
and active
`, loc.Language, slug)
if err := row.Scan(&page.Name, &page.Spiel, &page.Info, &page.Facilities, &page.Description, &page.AdditionalInfo); err != nil {
if err := row.Scan(&page.Name, &page.Spiel, &page.Info, &page.Facilities, &page.Description, &page.AdditionalInfo, &page.DogsAllowed, &page.DogsPrice); err != nil {
return nil, err
}
if err := conn.QueryRow(ctx, "select to_price(tourist_tax, $1) from company where company_id = $2", company.DecimalDigits, company.ID).Scan(&page.TouristTax); err != 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-01-15 01:40+0100\n"
"POT-Creation-Date: 2024-01-15 02:00+0100\n"
"PO-Revision-Date: 2023-07-22 23:45+0200\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Catalan <ca@dodds.net>\n"
@ -158,46 +158,54 @@ msgstr "IVA del 10 % inclòs."
msgid "Tourist tax: %s per person aged 16 or over."
msgstr "Impost turístic: %s per persona de 16 anys o més."
#: web/templates/public/campsite/type.gohtml:107
#: web/templates/public/campsite/type.gohtml:102
msgid "Dogs: %s/night, tied, accompanied, and minimal barking."
msgstr "Gossos: %s/night, lligats, acompanyats i el mínim de lladrucs."
#: web/templates/public/campsite/type.gohtml:104
msgid "No dogs allowed."
msgstr "No es permeten gossos."
#: web/templates/public/campsite/type.gohtml:112
msgctxt "title"
msgid "Features"
msgstr "Característiques"
#: web/templates/public/campsite/type.gohtml:118
#: web/templates/public/campsite/type.gohtml:123
msgctxt "title"
msgid "Info"
msgstr "Informació"
#: web/templates/public/campsite/type.gohtml:122
#: web/templates/public/campsite/type.gohtml:127
msgctxt "title"
msgid "Facilities"
msgstr "Equipaments"
#: web/templates/public/campsite/type.gohtml:126
#: web/templates/public/campsite/type.gohtml:131
msgctxt "title"
msgid "Description"
msgstr "Descripció"
#: web/templates/public/campsite/type.gohtml:130
#: web/templates/public/campsite/type.gohtml:135
msgctxt "title"
msgid "Additional Information"
msgstr "Informació addicional"
#: web/templates/public/campsite/type.gohtml:133
#: web/templates/public/campsite/type.gohtml:138
msgctxt "time"
msgid "Check in"
msgstr "Entrada"
#: web/templates/public/campsite/type.gohtml:134
#: web/templates/public/campsite/type.gohtml:139
msgid "4 p.m. to 9 p.m."
msgstr "16 h a 21 h"
#: web/templates/public/campsite/type.gohtml:137
#: web/templates/public/campsite/type.gohtml:142
msgctxt "time"
msgid "Check out"
msgstr "Sortida"
#: web/templates/public/campsite/type.gohtml:138
#: web/templates/public/campsite/type.gohtml:143
msgid "10 a.m."
msgstr "10 h"

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-01-15 01:40+0100\n"
"POT-Creation-Date: 2024-01-15 02:00+0100\n"
"PO-Revision-Date: 2023-07-22 23:46+0200\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Spanish <es@tp.org.es>\n"
@ -158,46 +158,54 @@ msgstr "IVA del 10 % incluido."
msgid "Tourist tax: %s per person aged 16 or over."
msgstr "Impuesto turístico: %s por persona de 16 años en adelante."
#: web/templates/public/campsite/type.gohtml:107
#: web/templates/public/campsite/type.gohtml:102
msgid "Dogs: %s/night, tied, accompanied, and minimal barking."
msgstr "Perros: %s/noche, atados, acompañados y con mínimo de ladrido."
#: web/templates/public/campsite/type.gohtml:104
msgid "No dogs allowed."
msgstr "No se permiten perros"
#: web/templates/public/campsite/type.gohtml:112
msgctxt "title"
msgid "Features"
msgstr "Características"
#: web/templates/public/campsite/type.gohtml:118
#: web/templates/public/campsite/type.gohtml:123
msgctxt "title"
msgid "Info"
msgstr "Información"
#: web/templates/public/campsite/type.gohtml:122
#: web/templates/public/campsite/type.gohtml:127
msgctxt "title"
msgid "Facilities"
msgstr "Equipamiento"
#: web/templates/public/campsite/type.gohtml:126
#: web/templates/public/campsite/type.gohtml:131
msgctxt "title"
msgid "Description"
msgstr "Descripción"
#: web/templates/public/campsite/type.gohtml:130
#: web/templates/public/campsite/type.gohtml:135
msgctxt "title"
msgid "Additional Information"
msgstr "Información adicional"
#: web/templates/public/campsite/type.gohtml:133
#: web/templates/public/campsite/type.gohtml:138
msgctxt "time"
msgid "Check in"
msgstr "Entrada"
#: web/templates/public/campsite/type.gohtml:134
#: web/templates/public/campsite/type.gohtml:139
msgid "4 p.m. to 9 p.m."
msgstr "16 h a 21 h"
#: web/templates/public/campsite/type.gohtml:137
#: web/templates/public/campsite/type.gohtml:142
msgctxt "time"
msgid "Check out"
msgstr "Salida"
#: web/templates/public/campsite/type.gohtml:138
#: web/templates/public/campsite/type.gohtml:143
msgid "10 a.m."
msgstr "10 h"

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-01-15 01:40+0100\n"
"POT-Creation-Date: 2024-01-15 02:00+0100\n"
"PO-Revision-Date: 2023-12-20 10:13+0100\n"
"Last-Translator: Oriol Carbonell <info@oriolcarbonell.cat>\n"
"Language-Team: French <traduc@traduc.org>\n"
@ -159,46 +159,54 @@ msgstr "10 % TVA incluse."
msgid "Tourist tax: %s per person aged 16 or over."
msgstr "Taxe touristique: %s par personne de 16 ans ou plus."
#: web/templates/public/campsite/type.gohtml:107
#: web/templates/public/campsite/type.gohtml:102
msgid "Dogs: %s/night, tied, accompanied, and minimal barking."
msgstr "Chiens : %s/nuit, attachés, accompagnés et aboiements minimes."
#: web/templates/public/campsite/type.gohtml:104
msgid "No dogs allowed."
msgstr "Chiens interdits."
#: web/templates/public/campsite/type.gohtml:112
msgctxt "title"
msgid "Features"
msgstr "Caractéristiques"
#: web/templates/public/campsite/type.gohtml:118
#: web/templates/public/campsite/type.gohtml:123
msgctxt "title"
msgid "Info"
msgstr "Info"
#: web/templates/public/campsite/type.gohtml:122
#: web/templates/public/campsite/type.gohtml:127
msgctxt "title"
msgid "Facilities"
msgstr "Installations"
#: web/templates/public/campsite/type.gohtml:126
#: web/templates/public/campsite/type.gohtml:131
msgctxt "title"
msgid "Description"
msgstr "Description"
#: web/templates/public/campsite/type.gohtml:130
#: web/templates/public/campsite/type.gohtml:135
msgctxt "title"
msgid "Additional Information"
msgstr "Informations Complémentaires"
#: web/templates/public/campsite/type.gohtml:133
#: web/templates/public/campsite/type.gohtml:138
msgctxt "time"
msgid "Check in"
msgstr "Arrivée"
#: web/templates/public/campsite/type.gohtml:134
#: web/templates/public/campsite/type.gohtml:139
msgid "4 p.m. to 9 p.m."
msgstr "16 h à 21 h"
#: web/templates/public/campsite/type.gohtml:137
#: web/templates/public/campsite/type.gohtml:142
msgctxt "time"
msgid "Check out"
msgstr "Départ"
#: web/templates/public/campsite/type.gohtml:138
#: web/templates/public/campsite/type.gohtml:143
msgid "10 a.m."
msgstr "10 h"

File diff suppressed because one or more lines are too long

View File

@ -916,6 +916,16 @@ dt {
padding: 0 0 0 calc(30px + 1.5rem);
}
.campsite_type_prices .pets_warning {
display: flex;
align-items: center;
min-height: 4.8rem;
padding-left: 5.8rem;
background-size: 4.8rem;
background-repeat: no-repeat;
background-position: left center;
}
.campsite_type_calendar {
padding: 2.5rem 0;
min-width: 0;

View File

@ -98,6 +98,11 @@
</dl>
<p>{{( gettext "10 % VAT included." )}}</p>
<p>{{printf (gettext "Tourist tax: %s per person aged 16 or over.") (formatPrice $.TouristTax)}}</p>
{{ if $.DogsAllowed -}}
<p class="pets_warning icon_pet">{{printf (gettext "Dogs: %s/night, tied, accompanied, and minimal barking.") (formatPrice $.DogsPrice)}}</p>
{{- else -}}
<p class="pets_warning icon_nopet">{{( gettext "No dogs allowed." )}}</p>
{{- end }}
</article>
{{- end }}
</div>