From 7fc87b5cb5d379fefc3909b5b9b7b65a67fef9cb Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Fri, 13 Oct 2023 13:40:48 +0200 Subject: [PATCH] Add the info and facilities fields to campsite type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I wish CKEditor would have support for
, but it is unlikely that they will add any time soon[0], specially when in 2018 they already “forgotten”[1] that this was requested back in 2007[2]. Therefore, in the demo i did it more or less like in the original design, with “extra”

, although i added them under a

, to avoid “gaps” in the outline. [0]: https://github.com/ckeditor/ckeditor5/issues/775 [1]: https://github.com/ckeditor/ckeditor5/issues/775#issuecomment-358591747 [2]: https://dev.ckeditor.com/ticket/1333 --- demo/demo.sql | 32 +++--- deploy/add_campsite_type.sql | 10 +- deploy/campsite_type.sql | 2 + deploy/campsite_type_i18n.sql | 2 + deploy/edit_campsite_type.sql | 8 +- deploy/translate_campsite_type.sql | 12 ++- pkg/campsite/types/admin.go | 18 +++- pkg/campsite/types/l10n.go | 12 ++- pkg/campsite/types/public.go | 6 +- pkg/database/funcs.go | 12 +-- po/ca.po | 97 ++++++++++++++----- po/es.po | 97 ++++++++++++++----- revert/add_campsite_type.sql | 2 +- revert/edit_campsite_type.sql | 2 +- revert/translate_campsite_type.sql | 2 +- test/add_campsite_type.sql | 28 +++--- test/campsite_type.sql | 14 ++- test/campsite_type_i18n.sql | 12 ++- test/edit_campsite_type.sql | 34 +++---- test/translate_campsite_type.sql | 44 ++++----- verify/add_campsite_type.sql | 2 +- verify/campsite_type.sql | 2 + verify/campsite_type_i18n.sql | 2 + verify/edit_campsite_type.sql | 2 +- verify/translate_campsite_type.sql | 2 +- web/templates/admin/campsite/type/form.gohtml | 14 +++ web/templates/admin/campsite/type/l10n.gohtml | 26 +++++ web/templates/public/campsite/type.gohtml | 17 +++- 28 files changed, 359 insertions(+), 154 deletions(-) diff --git a/demo/demo.sql b/demo/demo.sql index 9b3cb50..a1d9ae2 100644 --- a/demo/demo.sql +++ b/demo/demo.sql @@ -111,23 +111,23 @@ values (77, 'en', 'Tent') ; alter table campsite_type alter column campsite_type_id restart with 72; -select add_campsite_type(52, 62, 'Parceŀles', '

Acampa enmig de la natura

Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.

Parcel·les amples amb serveis a prop d’on ets per fer allò que vols.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

', 6, true); -select add_campsite_type(52, 63, 'Safari Tents', '

Glàmping a la teva disposició

Un luxe de tendes per viure aventures.

Dues tendes amb terra de fusta, llits, cuina i tot de comoditats per gaudir de les teves vacances.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

', 6, false); -select add_campsite_type(52, 64, 'Bungalous', '

Allotjaments de luxe

Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.

Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

', 5, false); -select add_campsite_type(52, 65, 'Bungalous prèmium', '

Allotjaments de luxe

Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.

Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

', 5, false); -select add_campsite_type(52, 66, 'Cabanes de fusta', '

Allotjaments de luxe

Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.

Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

', 5, false); +select add_campsite_type(52, 62, 'Parceŀles', '

Acampa enmig de la natura

Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.

Parcel·les amples amb serveis a prop d’on ets per fer allò que vols.

', '

Proxo/terrassa (13 m²)

Planta baixa (32 m²)

Planta altell (16 m²)

', '

El preu inclou

* Tovalloles: preu extra

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

', 6, true); +select add_campsite_type(52, 63, 'Safari Tents', '

Glàmping a la teva disposició

Un luxe de tendes per viure aventures.

Dues tendes amb terra de fusta, llits, cuina i tot de comoditats per gaudir de les teves vacances.

', '

Proxo/terrassa (13 m²)

Planta baixa (32 m²)

Planta altell (16 m²)

', '

El preu inclou

* Tovalloles: preu extra

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

', 6, false); +select add_campsite_type(52, 64, 'Bungalous', '

Allotjaments de luxe

Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.

Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.

', '

Proxo/terrassa (13 m²)

Planta baixa (32 m²)

Planta altell (16 m²)

', '

El preu inclou

* Tovalloles: preu extra

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

', 5, false); +select add_campsite_type(52, 65, 'Bungalous prèmium', '

Allotjaments de luxe

Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.

Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.

', '

Proxo/terrassa (13 m²)

Planta baixa (32 m²)

Planta altell (16 m²)

', '

El preu inclou

* Tovalloles: preu extra

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

', 5, false); +select add_campsite_type(52, 66, 'Cabanes de fusta', '

Allotjaments de luxe

Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.

Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.

', '

Proxo/terrassa (13 m²)

Planta baixa (32 m²)

Planta altell (16 m²)

', '

El preu inclou

* Tovalloles: preu extra

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

', 5, false); -insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, description) -values (72, 'en', 'Plots', '

Camp in the middle of nature

Located on the campground’s mountain-side and overlooking the nature that surrounds us.

Large plots with serivces close to where you are to do what you want.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') - , (72, 'es', 'Parcelas', '

Acampa enmedio de la naturaleza

Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.

Parcelas amplias con servicios cerca de donde eres para hacer aquello que quieres.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') - , (73, 'en', 'Safari Tents', '

Glamping at your disposal

A luxury of tent for unforgettable adventures.

Two tents with wooden floors, beds, kitchen, and all the amenities to enjoy your vacation.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') - , (73, 'es', 'Tiendas Safari', '

Glamping a tu disposición

Un lujo de tiendas para vivir aventuras.

Dos tiendas con suelo de madera, camas, cocina y todo de comodidades para disfrutar de tus vacanciones.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') - , (74, 'en', 'Bungalows', '

Luxury accomomdations

Located on the campground’s mountain-side and overlooking the nature that surrounds us.

Two two-story solid wood cabins with a covered porch to enjoy among the trees.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') - , (74, 'es', 'Bungalós', '

Alojamientos de lujo

Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.

Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') - , (75, 'en', 'Bungalows premium', '

Luxury accomomdations

Located on the campground’s mountain-side and overlooking the nature that surrounds us.

Two two-story solid wood cabins with a covered porch to enjoy among the trees.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') - , (75, 'es', 'Bungalós prémium', '

Alojamientos de lujo

Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.

Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') - , (76, 'en', 'Wooden Lodges', '

Luxury accomomdations

Located on the campground’s mountain-side and overlooking the nature that surrounds us.

Two two-story solid wood cabins with a covered porch to enjoy among the trees.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') - , (76, 'es', 'Cabañas de madera', '

Alojamientos de lujo

Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.

Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') +insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description) +values (72, 'en', 'Plots', '

Camp in the middle of nature

Located on the campground’s mountain-side and overlooking the nature that surrounds us.

Large plots with serivces close to where you are to do what you want.

', '

Porch/terrace (13 m²)

First floor (32 m²)

Loft floor (16 m²)

', '

Price includes

* Towels: extra cost

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') + , (72, 'es', 'Parcelas', '

Acampa enmedio de la naturaleza

Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.

Parcelas amplias con servicios cerca de donde eres para hacer aquello que quieres.

', '

Proche/terraza (13 m²)

Planta baja (32 m²)

Planta altillo (16 m²)

', '

El precio incluye

* Toallas: precio extra

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') + , (73, 'en', 'Safari Tents', '

Glamping at your disposal

A luxury of tent for unforgettable adventures.

Two tents with wooden floors, beds, kitchen, and all the amenities to enjoy your vacation.

', '

Porch/terrace (13 m²)

First floor (32 m²)

Loft floor (16 m²)

', '

Price includes

* Towels: extra cost

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') + , (73, 'es', 'Tiendas Safari', '

Glamping a tu disposición

Un lujo de tiendas para vivir aventuras.

Dos tiendas con suelo de madera, camas, cocina y todo de comodidades para disfrutar de tus vacanciones.

', '

Proche/terraza (13 m²)

Planta baja (32 m²)

Planta altillo (16 m²)

', '

El precio incluye

* Toallas: precio extra

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') + , (74, 'en', 'Bungalows', '

Luxury accomomdations

Located on the campground’s mountain-side and overlooking the nature that surrounds us.

Two two-story solid wood cabins with a covered porch to enjoy among the trees.

', '

Porch/terrace (13 m²)

First floor (32 m²)

Loft floor (16 m²)

', '

Price includes

* Towels: extra cost

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') + , (74, 'es', 'Bungalós', '

Alojamientos de lujo

Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.

Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.

', '

Proche/terraza (13 m²)

Planta baja (32 m²)

Planta altillo (16 m²)

', '

El precio incluye

* Toallas: precio extra

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') + , (75, 'en', 'Bungalows premium', '

Luxury accomomdations

Located on the campground’s mountain-side and overlooking the nature that surrounds us.

Two two-story solid wood cabins with a covered porch to enjoy among the trees.

', '

Porch/terrace (13 m²)

First floor (32 m²)

Loft floor (16 m²)

', '

Price includes

* Towels: extra cost

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') + , (75, 'es', 'Bungalós prémium', '

Alojamientos de lujo

Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.

Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.

', '

Proche/terraza (13 m²)

Planta baja (32 m²)

Planta altillo (16 m²)

', '

El precio incluye

* Toallas: precio extra

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') + , (76, 'en', 'Wooden Lodges', '

Luxury accomomdations

Located on the campground’s mountain-side and overlooking the nature that surrounds us.

Two two-story solid wood cabins with a covered porch to enjoy among the trees.

', '

Porch/terrace (13 m²)

First floor (32 m²)

Loft floor (16 m²)

', '

Price includes

* Towels: extra cost

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') + , (76, 'es', 'Cabañas de madera', '

Alojamientos de lujo

Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.

Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.

', '

Proche/terraza (13 m²)

Planta baja (32 m²)

Planta altillo (16 m²)

', '

El precio incluye

* Toallas: precio extra

', '

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

') ; alter table campsite alter column campsite_id restart with 82; diff --git a/deploy/add_campsite_type.sql b/deploy/add_campsite_type.sql index 61f8b0b..5f4081d 100644 --- a/deploy/add_campsite_type.sql +++ b/deploy/add_campsite_type.sql @@ -8,16 +8,16 @@ begin; set search_path to camper, public; -create or replace function add_campsite_type(company integer, media_id integer, name text, spiel text, description text, max_campers integer, dogs_allowed boolean) returns uuid as +create or replace function add_campsite_type(company integer, media_id integer, name text, spiel text, info text, facilities text, description text, max_campers integer, dogs_allowed boolean) returns uuid as $$ - insert into campsite_type (company_id, media_id, name, spiel, description, max_campers, dogs_allowed) - values (company, media_id, name, xmlparse(content spiel), xmlparse(content description), max_campers, dogs_allowed) + insert into campsite_type (company_id, media_id, name, spiel, info, facilities, description, max_campers, dogs_allowed) + values (company, media_id, name, xmlparse(content spiel), xmlparse(content info), xmlparse(content facilities), xmlparse(content description), max_campers, dogs_allowed) returning slug; $$ language sql ; -revoke execute on function add_campsite_type(integer, integer, text, text, text, integer, boolean) from public; -grant execute on function add_campsite_type(integer, integer, text, text, text, integer, boolean) to admin; +revoke execute on function add_campsite_type(integer, integer, text, text, text, text, text, integer, boolean) from public; +grant execute on function add_campsite_type(integer, integer, text, text, text, text, text, integer, boolean) to admin; commit; diff --git a/deploy/campsite_type.sql b/deploy/campsite_type.sql index 5339462..47073c5 100644 --- a/deploy/campsite_type.sql +++ b/deploy/campsite_type.sql @@ -16,6 +16,8 @@ create table campsite_type ( name text not null constraint name_not_empty check(length(trim(name)) > 0), media_id integer not null references media, spiel xml not null default ''::xml, + info xml not null default ''::xml, + facilities xml not null default ''::xml, description xml not null default ''::xml, max_campers integer not null constraint at_least_one_camper check(max_campers > 0), dogs_allowed boolean not null, diff --git a/deploy/campsite_type_i18n.sql b/deploy/campsite_type_i18n.sql index b61e240..2019016 100644 --- a/deploy/campsite_type_i18n.sql +++ b/deploy/campsite_type_i18n.sql @@ -13,6 +13,8 @@ create table campsite_type_i18n ( lang_tag text not null references language, name text not null, spiel xml not null, + info xml not null, + facilities xml not null, description xml not null, primary key (campsite_type_id, lang_tag) ); diff --git a/deploy/edit_campsite_type.sql b/deploy/edit_campsite_type.sql index 756e35e..ba605ff 100644 --- a/deploy/edit_campsite_type.sql +++ b/deploy/edit_campsite_type.sql @@ -8,12 +8,14 @@ begin; set search_path to camper, public; -create or replace function edit_campsite_type(slug uuid, media_id integer, name text, spiel text, description text, max_campers integer, dogs_allowed boolean, active boolean) returns uuid as +create or replace function edit_campsite_type(slug uuid, media_id integer, name text, spiel text, info text, facilities text, description text, max_campers integer, dogs_allowed boolean, active boolean) returns uuid as $$ update campsite_type set name = edit_campsite_type.name , spiel = xmlparse(content edit_campsite_type.spiel) , description = xmlparse(content edit_campsite_type.description) + , info = xmlparse(content edit_campsite_type.info) + , facilities = xmlparse(content edit_campsite_type.facilities) , media_id = coalesce(edit_campsite_type.media_id, campsite_type.media_id) , max_campers = edit_campsite_type.max_campers , dogs_allowed = edit_campsite_type.dogs_allowed @@ -24,7 +26,7 @@ $$ language sql ; -revoke execute on function edit_campsite_type(uuid, integer, text, text, text, integer, boolean, boolean) from public; -grant execute on function edit_campsite_type(uuid, integer, text, text, text, integer, boolean, boolean) to admin; +revoke execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, integer, boolean, boolean) from public; +grant execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, integer, boolean, boolean) to admin; commit; diff --git a/deploy/translate_campsite_type.sql b/deploy/translate_campsite_type.sql index 2fed97e..6bdbf85 100644 --- a/deploy/translate_campsite_type.sql +++ b/deploy/translate_campsite_type.sql @@ -7,21 +7,23 @@ begin; set search_path to camper, public; -create or replace function translate_campsite_type (slug uuid, lang_tag text, name text, spiel text, description text) returns void as +create or replace function translate_campsite_type (slug uuid, lang_tag text, name text, spiel text, info text, facilities text, description text) returns void as $$ - insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, description) - select campsite_type_id, translate_campsite_type.lang_tag, translate_campsite_type.name, xmlparse(content coalesce(translate_campsite_type.spiel, '')), xmlparse(content coalesce(translate_campsite_type.description, '')) + insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description) + select campsite_type_id, translate_campsite_type.lang_tag, translate_campsite_type.name, xmlparse(content coalesce(translate_campsite_type.spiel, '')), xmlparse(content coalesce(translate_campsite_type.info, '')), xmlparse(content coalesce(translate_campsite_type.facilities, '')), xmlparse(content coalesce(translate_campsite_type.description, '')) from campsite_type where slug = translate_campsite_type.slug on conflict (campsite_type_id, lang_tag) do update set name = excluded.name , spiel = excluded.spiel + , info = excluded.info + , facilities = excluded.facilities , description = excluded.description $$ language sql ; -revoke execute on function translate_campsite_type (uuid, text, text, text, text) from public; -grant execute on function translate_campsite_type(uuid, text, text, text, text) to admin; +revoke execute on function translate_campsite_type (uuid, text, text, text, text, text, text) from public; +grant execute on function translate_campsite_type(uuid, text, text, text, text, text, text) to admin; commit; diff --git a/pkg/campsite/types/admin.go b/pkg/campsite/types/admin.go index fbd11b3..d550e2a 100644 --- a/pkg/campsite/types/admin.go +++ b/pkg/campsite/types/admin.go @@ -197,7 +197,7 @@ func addType(w http.ResponseWriter, r *http.Request, user *auth.User, company *a panic(err) } processTypeForm(w, r, user, company, conn, f, func(ctx context.Context, tx *database.Tx) error { - slug, err := tx.AddCampsiteType(ctx, company.ID, f.Media.Int(), f.Name.Val, f.Spiel.Val, f.Description.Val, f.MaxCampers.Int(), f.DogsAllowed.Checked) + slug, err := tx.AddCampsiteType(ctx, company.ID, f.Media.Int(), f.Name.Val, f.Spiel.Val, f.Info.Val, f.Facilities.Val, f.Description.Val, f.MaxCampers.Int(), f.DogsAllowed.Checked) if err != nil { return err } @@ -216,7 +216,7 @@ func setTypePrices(ctx context.Context, tx *database.Tx, slug string, prices map func editType(w http.ResponseWriter, r *http.Request, user *auth.User, company *auth.Company, conn *database.Conn, f *typeForm) { processTypeForm(w, r, user, company, conn, f, func(ctx context.Context, tx *database.Tx) error { - if _, err := tx.EditCampsiteType(ctx, f.Slug, f.Media.Int(), f.Name.Val, f.Spiel.Val, f.Description.Val, f.MaxCampers.Int(), f.DogsAllowed.Checked, f.Active.Checked); err != nil { + if _, err := tx.EditCampsiteType(ctx, f.Slug, f.Media.Int(), f.Name.Val, f.Spiel.Val, f.Info.Val, f.Facilities.Val, f.Description.Val, f.MaxCampers.Int(), f.DogsAllowed.Checked, f.Active.Checked); err != nil { return err } return setTypePrices(ctx, tx, f.Slug, f.Prices) @@ -264,6 +264,8 @@ type typeForm struct { MaxCampers *form.Input DogsAllowed *form.Checkbox Spiel *form.Input + Info *form.Input + Facilities *form.Input Description *form.Input Prices map[int]*typePriceForm } @@ -299,6 +301,12 @@ func newTypeForm(ctx context.Context, company *auth.Company, conn *database.Conn Spiel: &form.Input{ Name: "spiel", }, + Info: &form.Input{ + Name: "info", + }, + Facilities: &form.Input{ + Name: "facilities", + }, Description: &form.Input{ Name: "description", }, @@ -338,6 +346,8 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl row := conn.QueryRow(ctx, ` select name , spiel::text + , info::text + , facilities::text , description::text , media_id::text , max_campers::text @@ -346,7 +356,7 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl from campsite_type where slug = $1 `, slug) - if err := row.Scan(&f.Name.Val, &f.Spiel.Val, &f.Description.Val, &f.Media.Val, &f.MaxCampers.Val, &f.DogsAllowed.Checked, &f.Active.Checked); err != nil { + if err := row.Scan(&f.Name.Val, &f.Spiel.Val, &f.Info.Val, &f.Facilities.Val, &f.Description.Val, &f.Media.Val, &f.MaxCampers.Val, &f.DogsAllowed.Checked, &f.Active.Checked); err != nil { return err } @@ -387,6 +397,8 @@ func (f *typeForm) Parse(r *http.Request) error { f.MaxCampers.FillValue(r) f.DogsAllowed.FillValue(r) f.Spiel.FillValue(r) + f.Info.FillValue(r) + f.Facilities.FillValue(r) f.Description.FillValue(r) f.Media.FillValue(r) for _, p := range f.Prices { diff --git a/pkg/campsite/types/l10n.go b/pkg/campsite/types/l10n.go index 49d78e5..1ad7c81 100644 --- a/pkg/campsite/types/l10n.go +++ b/pkg/campsite/types/l10n.go @@ -22,6 +22,8 @@ type typeL10nForm struct { Slug string Name *form.L10nInput Spiel *form.L10nInput + Info *form.L10nInput + Facilities *form.L10nInput Description *form.L10nInput } @@ -31,6 +33,8 @@ func newTypeL10nForm(f *typeForm, loc *locale.Locale) *typeL10nForm { Slug: f.Slug, Name: f.Name.L10nInput(), Spiel: f.Spiel.L10nInput(), + Info: f.Info.L10nInput(), + Facilities: f.Facilities.L10nInput(), Description: f.Description.L10nInput(), } } @@ -39,12 +43,14 @@ func (l10n *typeL10nForm) FillFromDatabase(ctx context.Context, conn *database.C row := conn.QueryRow(ctx, ` select coalesce(i18n.name, '') as l10n_name , coalesce(i18n.spiel, '') as l10n_spiel + , coalesce(i18n.info, '') as l10n_info + , coalesce(i18n.facilities, '') as l10n_facilities , coalesce(i18n.description, '') as l10n_description 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 `, l10n.Locale.Language, l10n.Slug) - return row.Scan(&l10n.Name.Val, &l10n.Spiel.Val, &l10n.Description.Val) + return row.Scan(&l10n.Name.Val, &l10n.Spiel.Val, &l10n.Info.Val, &l10n.Facilities.Val, &l10n.Description.Val) } func (l10n *typeL10nForm) MustRender(w http.ResponseWriter, r *http.Request, user *auth.User, company *auth.Company) { @@ -58,7 +64,7 @@ func editTypeL10n(w http.ResponseWriter, r *http.Request, user *auth.User, compa l10n.MustRender(w, r, user, company) return } - if err := conn.TranslateCampsiteType(r.Context(), l10n.Slug, l10n.Locale.Language, l10n.Name.Val, l10n.Spiel.Val, l10n.Description.Val); err != nil { + if err := conn.TranslateCampsiteType(r.Context(), l10n.Slug, l10n.Locale.Language, l10n.Name.Val, l10n.Spiel.Val, l10n.Info.Val, l10n.Facilities.Val, l10n.Description.Val); err != nil { panic(err) } httplib.Redirect(w, r, "/admin/campsites/types", http.StatusSeeOther) @@ -70,6 +76,8 @@ func (l10n *typeL10nForm) Parse(r *http.Request) error { } l10n.Name.FillValue(r) l10n.Spiel.FillValue(r) + l10n.Info.FillValue(r) + l10n.Facilities.FillValue(r) l10n.Description.FillValue(r) return nil } diff --git a/pkg/campsite/types/public.go b/pkg/campsite/types/public.go index 1d918f0..b875f99 100644 --- a/pkg/campsite/types/public.go +++ b/pkg/campsite/types/public.go @@ -55,6 +55,8 @@ type publicPage struct { Carousel []*carousel.Slide Prices []*typePrice Spiel gotemplate.HTML + Info gotemplate.HTML + Facilities gotemplate.HTML Description gotemplate.HTML } @@ -79,13 +81,15 @@ func newPublicPage(ctx context.Context, conn *database.Conn, loc *locale.Locale, row := conn.QueryRow(ctx, ` select coalesce(i18n.name, campsite_type.name) as l10n_name , coalesce(i18n.spiel, campsite_type.spiel)::text as l10n_description + , coalesce(i18n.info, campsite_type.info)::text as l10n_info + , coalesce(i18n.facilities, campsite_type.facilities)::text as l10n_facilities , coalesce(i18n.description, campsite_type.description)::text as l10n_description 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.Description); err != nil { + if err := row.Scan(&page.Name, &page.Spiel, &page.Info, &page.Facilities, &page.Description); err != nil { return nil, err } diff --git a/pkg/database/funcs.go b/pkg/database/funcs.go index aa5b3e7..cfdde75 100644 --- a/pkg/database/funcs.go +++ b/pkg/database/funcs.go @@ -11,16 +11,16 @@ import ( "golang.org/x/text/language" ) -func (tx *Tx) AddCampsiteType(ctx context.Context, companyID int, mediaID int, name string, spiel string, description string, maxCampers int, dogsAllowed bool) (string, error) { - return tx.GetText(ctx, "select add_campsite_type($1, $2, $3, $4, $5, $6, $7)", companyID, mediaID, name, spiel, description, maxCampers, dogsAllowed) +func (tx *Tx) AddCampsiteType(ctx context.Context, companyID int, mediaID int, name string, spiel string, info string, facilities string, description string, maxCampers int, dogsAllowed bool) (string, error) { + return tx.GetText(ctx, "select add_campsite_type($1, $2, $3, $4, $5, $6, $7, $8, $9)", companyID, mediaID, name, spiel, info, facilities, description, maxCampers, dogsAllowed) } -func (tx *Tx) EditCampsiteType(ctx context.Context, slug string, mediaID int, name string, spiel string, description string, maxCampers int, dogsAllowed bool, active bool) (string, error) { - return tx.GetText(ctx, "select edit_campsite_type($1, $2, $3, $4, $5, $6, $7, $8)", slug, mediaID, name, spiel, description, maxCampers, dogsAllowed, active) +func (tx *Tx) EditCampsiteType(ctx context.Context, slug string, mediaID int, name string, spiel string, info string, facilities string, description string, maxCampers int, dogsAllowed bool, active bool) (string, error) { + return tx.GetText(ctx, "select edit_campsite_type($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)", slug, mediaID, name, spiel, info, facilities, description, maxCampers, dogsAllowed, active) } -func (c *Conn) TranslateCampsiteType(ctx context.Context, slug string, langTag language.Tag, name string, spiel string, description string) error { - _, err := c.Exec(ctx, "select translate_campsite_type($1, $2, $3, $4, $5)", slug, langTag, name, spiel, description) +func (c *Conn) TranslateCampsiteType(ctx context.Context, slug string, langTag language.Tag, name string, spiel string, info string, facilities string, description string) error { + _, err := c.Exec(ctx, "select translate_campsite_type($1, $2, $3, $4, $5, $6, $7)", slug, langTag, name, spiel, info, facilities, description) return err } func (tx *Tx) SetCampsiteTypeCost(ctx context.Context, slug string, seasonID int, minNights int, costPerNight string) error { diff --git a/po/ca.po b/po/ca.po index 506f49a..04f2b00 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: 2023-10-12 18:41+0200\n" +"POT-Creation-Date: 2023-10-13 18:05+0200\n" "PO-Revision-Date: 2023-07-22 23:45+0200\n" "Last-Translator: jordi fita mas \n" "Language-Team: Catalan \n" @@ -77,25 +77,40 @@ msgstr "Descobreix l’entorn" msgid "Come and enjoy!" msgstr "Vine a gaudir!" -#: web/templates/public/campsite/type.gohtml:40 +#: web/templates/public/campsite/type.gohtml:38 #: web/templates/admin/campsite/option/form.gohtml:58 #: web/templates/admin/campsite/type/form.gohtml:73 msgctxt "title" msgid "Prices" msgstr "Preus" -#: web/templates/public/campsite/type.gohtml:50 +#: web/templates/public/campsite/type.gohtml:47 msgid "%s €/night" msgstr "%s €/nit" -#: web/templates/public/campsite/type.gohtml:52 +#: web/templates/public/campsite/type.gohtml:49 msgid "%s: %s €/night" msgstr "%s: %s €/nit" -#: web/templates/public/campsite/type.gohtml:55 +#: web/templates/public/campsite/type.gohtml:52 msgid "*Minimum %d nights per stay" msgstr "*Mínim %d nits per estada" +#: web/templates/public/campsite/type.gohtml:61 +msgctxt "title" +msgid "Info" +msgstr "Informació" + +#: web/templates/public/campsite/type.gohtml:65 +msgctxt "title" +msgid "Facilities" +msgstr "Equipaments" + +#: web/templates/public/campsite/type.gohtml:69 +msgctxt "title" +msgid "Description" +msgstr "Descripció" + #: web/templates/public/surroundings.gohtml:13 msgctxt "title" msgid "What to Do Outside the Campsite?" @@ -213,7 +228,7 @@ msgstr "Llegenda" #: web/templates/admin/campsite/carousel/form.gohtml:47 #: web/templates/admin/campsite/form.gohtml:70 #: web/templates/admin/campsite/option/form.gohtml:78 -#: web/templates/admin/campsite/type/form.gohtml:115 +#: web/templates/admin/campsite/type/form.gohtml:129 #: web/templates/admin/season/form.gohtml:64 #: web/templates/admin/services/form.gohtml:69 #: web/templates/admin/media/form.gohtml:35 @@ -225,7 +240,7 @@ msgstr "Actualitza" #: web/templates/admin/campsite/carousel/form.gohtml:49 #: web/templates/admin/campsite/form.gohtml:72 #: web/templates/admin/campsite/option/form.gohtml:80 -#: web/templates/admin/campsite/type/form.gohtml:117 +#: web/templates/admin/campsite/type/form.gohtml:131 #: web/templates/admin/season/form.gohtml:66 #: web/templates/admin/services/form.gohtml:71 msgctxt "action" @@ -244,6 +259,8 @@ msgstr "Traducció de la diapositiva del carrusel a %s" #: web/templates/admin/campsite/type/l10n.gohtml:21 #: web/templates/admin/campsite/type/l10n.gohtml:33 #: web/templates/admin/campsite/type/l10n.gohtml:46 +#: web/templates/admin/campsite/type/l10n.gohtml:59 +#: web/templates/admin/campsite/type/l10n.gohtml:72 #: web/templates/admin/season/l10n.gohtml:21 #: web/templates/admin/services/l10n.gohtml:21 #: web/templates/admin/services/l10n.gohtml:33 @@ -256,6 +273,8 @@ msgstr "Origen:" #: web/templates/admin/campsite/type/l10n.gohtml:23 #: web/templates/admin/campsite/type/l10n.gohtml:36 #: web/templates/admin/campsite/type/l10n.gohtml:49 +#: web/templates/admin/campsite/type/l10n.gohtml:62 +#: web/templates/admin/campsite/type/l10n.gohtml:75 #: web/templates/admin/season/l10n.gohtml:23 #: web/templates/admin/services/l10n.gohtml:23 #: web/templates/admin/services/l10n.gohtml:36 @@ -266,7 +285,7 @@ msgstr "Traducció:" #: web/templates/admin/carousel/l10n.gohtml:32 #: web/templates/admin/campsite/carousel/l10n.gohtml:32 #: web/templates/admin/campsite/option/l10n.gohtml:32 -#: web/templates/admin/campsite/type/l10n.gohtml:58 +#: web/templates/admin/campsite/type/l10n.gohtml:84 #: web/templates/admin/season/l10n.gohtml:32 #: web/templates/admin/services/l10n.gohtml:45 msgctxt "action" @@ -530,6 +549,18 @@ msgstr "Introducció" #: web/templates/admin/campsite/type/form.gohtml:106 #: web/templates/admin/campsite/type/l10n.gohtml:45 +msgctxt "input" +msgid "Info" +msgstr "Informació" + +#: web/templates/admin/campsite/type/form.gohtml:113 +#: web/templates/admin/campsite/type/l10n.gohtml:58 +msgctxt "input" +msgid "Facilities" +msgstr "Equipaments" + +#: web/templates/admin/campsite/type/form.gohtml:120 +#: web/templates/admin/campsite/type/l10n.gohtml:71 #: web/templates/admin/services/form.gohtml:60 #: web/templates/admin/services/l10n.gohtml:32 msgctxt "input" @@ -989,9 +1020,9 @@ msgctxt "language option" msgid "Automatic" msgstr "Automàtic" -#: pkg/app/user.go:249 pkg/campsite/types/l10n.go:77 -#: pkg/campsite/types/l10n.go:132 pkg/campsite/types/option.go:336 -#: pkg/campsite/types/admin.go:397 pkg/season/l10n.go:69 +#: pkg/app/user.go:249 pkg/campsite/types/l10n.go:87 +#: pkg/campsite/types/l10n.go:142 pkg/campsite/types/option.go:336 +#: pkg/campsite/types/admin.go:413 pkg/season/l10n.go:69 #: pkg/season/admin.go:382 pkg/services/l10n.go:73 pkg/services/admin.go:266 msgid "Name can not be empty." msgstr "No podeu deixar el nom en blanc." @@ -1012,7 +1043,7 @@ msgstr "El fitxer has de ser una imatge PNG o JPEG vàlida." msgid "Access forbidden" msgstr "Accés prohibit" -#: pkg/campsite/types/option.go:337 pkg/campsite/types/admin.go:398 +#: pkg/campsite/types/option.go:337 pkg/campsite/types/admin.go:414 msgid "Name must have at least one letter." msgstr "El nom ha de tenir com a mínim una lletra." @@ -1040,57 +1071,57 @@ msgstr "El valor del màxim ha de ser un número enter." msgid "Maximum must be equal or greater than minimum." msgstr "El valor del màxim ha de ser igual o superir al del mínim." -#: pkg/campsite/types/option.go:353 pkg/campsite/types/admin.go:411 +#: pkg/campsite/types/option.go:353 pkg/campsite/types/admin.go:427 msgid "Price per night can not be empty." msgstr "No podeu deixar el preu per nit en blanc." -#: pkg/campsite/types/option.go:354 pkg/campsite/types/admin.go:412 +#: pkg/campsite/types/option.go:354 pkg/campsite/types/admin.go:428 msgid "Price per night must be a decimal number." msgstr "El preu per nit ha de ser un número decimal." -#: pkg/campsite/types/option.go:355 pkg/campsite/types/admin.go:413 +#: pkg/campsite/types/option.go:355 pkg/campsite/types/admin.go:429 msgid "Price per night must be zero or greater." msgstr "El preu per nit ha de ser com a mínim zero." -#: pkg/campsite/types/admin.go:283 +#: pkg/campsite/types/admin.go:289 msgctxt "input" msgid "Cover image" msgstr "Imatge de portada" -#: pkg/campsite/types/admin.go:284 +#: pkg/campsite/types/admin.go:290 msgctxt "action" msgid "Set campsite type cover" msgstr "Estableix la portada del tipus d’allotjament" -#: pkg/campsite/types/admin.go:400 +#: pkg/campsite/types/admin.go:416 msgid "Cover image can not be empty." msgstr "No podeu deixar la imatge de portada en blanc." -#: pkg/campsite/types/admin.go:401 +#: pkg/campsite/types/admin.go:417 msgid "Cover image must be an image media type." msgstr "La imatge de portada ha de ser un mèdia de tipus imatge." -#: pkg/campsite/types/admin.go:405 +#: pkg/campsite/types/admin.go:421 msgid "Maximum number of campers can not be empty." msgstr "No podeu deixar el número màxim de persones en blanc." -#: pkg/campsite/types/admin.go:406 +#: pkg/campsite/types/admin.go:422 msgid "Maximum number of campers must be an integer number." msgstr "El número màxim de persones ha de ser enter." -#: pkg/campsite/types/admin.go:407 +#: pkg/campsite/types/admin.go:423 msgid "Maximum number of campers must be one or greater." msgstr "El número màxim de persones no pot ser zero." -#: pkg/campsite/types/admin.go:416 +#: pkg/campsite/types/admin.go:432 msgid "Minimum number of nights can not be empty." msgstr "No podeu deixar el número mínim de nits en blanc." -#: pkg/campsite/types/admin.go:417 +#: pkg/campsite/types/admin.go:433 msgid "Minimum number of nights must be an integer." msgstr "El número mínim de nits ha de ser enter." -#: pkg/campsite/types/admin.go:418 +#: pkg/campsite/types/admin.go:434 msgid "Minimum number of nights must be one or greater." msgstr "El número mínim de nits no pot ser zero." @@ -1267,6 +1298,22 @@ 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." +#~ msgctxt "title" +#~ msgid "Pricing" +#~ msgstr "Preus" + +#~ msgctxt "input" +#~ msgid "Pricing" +#~ msgstr "Preus" + +#~ msgctxt "title" +#~ msgid "Features" +#~ msgstr "Característiques" + +#~ msgctxt "input" +#~ msgid "Features" +#~ msgstr "Característiques" + #~ msgid "Singular Lodges" #~ msgstr "Allotjaments singulars" diff --git a/po/es.po b/po/es.po index 31fd215..46ddd37 100644 --- a/po/es.po +++ b/po/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: camper\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n" -"POT-Creation-Date: 2023-10-12 18:41+0200\n" +"POT-Creation-Date: 2023-10-13 18:05+0200\n" "PO-Revision-Date: 2023-07-22 23:46+0200\n" "Last-Translator: jordi fita mas \n" "Language-Team: Spanish \n" @@ -77,25 +77,40 @@ msgstr "Descubre el entorno" msgid "Come and enjoy!" msgstr "¡Ven a disfrutar!" -#: web/templates/public/campsite/type.gohtml:40 +#: web/templates/public/campsite/type.gohtml:38 #: web/templates/admin/campsite/option/form.gohtml:58 #: web/templates/admin/campsite/type/form.gohtml:73 msgctxt "title" msgid "Prices" msgstr "Precios" -#: web/templates/public/campsite/type.gohtml:50 +#: web/templates/public/campsite/type.gohtml:47 msgid "%s €/night" msgstr "%s €/noche" -#: web/templates/public/campsite/type.gohtml:52 +#: web/templates/public/campsite/type.gohtml:49 msgid "%s: %s €/night" msgstr ":%s: %s €/noche" -#: web/templates/public/campsite/type.gohtml:55 +#: web/templates/public/campsite/type.gohtml:52 msgid "*Minimum %d nights per stay" msgstr "*Mínimo %d noches por estancia" +#: web/templates/public/campsite/type.gohtml:61 +msgctxt "title" +msgid "Info" +msgstr "Información" + +#: web/templates/public/campsite/type.gohtml:65 +msgctxt "title" +msgid "Facilities" +msgstr "Equipamento" + +#: web/templates/public/campsite/type.gohtml:69 +msgctxt "title" +msgid "Description" +msgstr "Descripción" + #: web/templates/public/surroundings.gohtml:13 msgctxt "title" msgid "What to Do Outside the Campsite?" @@ -213,7 +228,7 @@ msgstr "Leyenda" #: web/templates/admin/campsite/carousel/form.gohtml:47 #: web/templates/admin/campsite/form.gohtml:70 #: web/templates/admin/campsite/option/form.gohtml:78 -#: web/templates/admin/campsite/type/form.gohtml:115 +#: web/templates/admin/campsite/type/form.gohtml:129 #: web/templates/admin/season/form.gohtml:64 #: web/templates/admin/services/form.gohtml:69 #: web/templates/admin/media/form.gohtml:35 @@ -225,7 +240,7 @@ msgstr "Actualizar" #: web/templates/admin/campsite/carousel/form.gohtml:49 #: web/templates/admin/campsite/form.gohtml:72 #: web/templates/admin/campsite/option/form.gohtml:80 -#: web/templates/admin/campsite/type/form.gohtml:117 +#: web/templates/admin/campsite/type/form.gohtml:131 #: web/templates/admin/season/form.gohtml:66 #: web/templates/admin/services/form.gohtml:71 msgctxt "action" @@ -244,6 +259,8 @@ msgstr "Traducción de la diapositiva de carrusel a %s" #: web/templates/admin/campsite/type/l10n.gohtml:21 #: web/templates/admin/campsite/type/l10n.gohtml:33 #: web/templates/admin/campsite/type/l10n.gohtml:46 +#: web/templates/admin/campsite/type/l10n.gohtml:59 +#: web/templates/admin/campsite/type/l10n.gohtml:72 #: web/templates/admin/season/l10n.gohtml:21 #: web/templates/admin/services/l10n.gohtml:21 #: web/templates/admin/services/l10n.gohtml:33 @@ -256,6 +273,8 @@ msgstr "Origen:" #: web/templates/admin/campsite/type/l10n.gohtml:23 #: web/templates/admin/campsite/type/l10n.gohtml:36 #: web/templates/admin/campsite/type/l10n.gohtml:49 +#: web/templates/admin/campsite/type/l10n.gohtml:62 +#: web/templates/admin/campsite/type/l10n.gohtml:75 #: web/templates/admin/season/l10n.gohtml:23 #: web/templates/admin/services/l10n.gohtml:23 #: web/templates/admin/services/l10n.gohtml:36 @@ -266,7 +285,7 @@ msgstr "Traducción" #: web/templates/admin/carousel/l10n.gohtml:32 #: web/templates/admin/campsite/carousel/l10n.gohtml:32 #: web/templates/admin/campsite/option/l10n.gohtml:32 -#: web/templates/admin/campsite/type/l10n.gohtml:58 +#: web/templates/admin/campsite/type/l10n.gohtml:84 #: web/templates/admin/season/l10n.gohtml:32 #: web/templates/admin/services/l10n.gohtml:45 msgctxt "action" @@ -530,6 +549,18 @@ msgstr "Introducción" #: web/templates/admin/campsite/type/form.gohtml:106 #: web/templates/admin/campsite/type/l10n.gohtml:45 +msgctxt "input" +msgid "Info" +msgstr "Información" + +#: web/templates/admin/campsite/type/form.gohtml:113 +#: web/templates/admin/campsite/type/l10n.gohtml:58 +msgctxt "input" +msgid "Facilities" +msgstr "Equipamento" + +#: web/templates/admin/campsite/type/form.gohtml:120 +#: web/templates/admin/campsite/type/l10n.gohtml:71 #: web/templates/admin/services/form.gohtml:60 #: web/templates/admin/services/l10n.gohtml:32 msgctxt "input" @@ -989,9 +1020,9 @@ msgctxt "language option" msgid "Automatic" msgstr "Automático" -#: pkg/app/user.go:249 pkg/campsite/types/l10n.go:77 -#: pkg/campsite/types/l10n.go:132 pkg/campsite/types/option.go:336 -#: pkg/campsite/types/admin.go:397 pkg/season/l10n.go:69 +#: pkg/app/user.go:249 pkg/campsite/types/l10n.go:87 +#: pkg/campsite/types/l10n.go:142 pkg/campsite/types/option.go:336 +#: pkg/campsite/types/admin.go:413 pkg/season/l10n.go:69 #: pkg/season/admin.go:382 pkg/services/l10n.go:73 pkg/services/admin.go:266 msgid "Name can not be empty." msgstr "No podéis dejar el nombre en blanco." @@ -1012,7 +1043,7 @@ msgstr "El archivo tiene que ser una imagen PNG o JPEG válida." msgid "Access forbidden" msgstr "Acceso prohibido" -#: pkg/campsite/types/option.go:337 pkg/campsite/types/admin.go:398 +#: pkg/campsite/types/option.go:337 pkg/campsite/types/admin.go:414 msgid "Name must have at least one letter." msgstr "El nombre tiene que tener como mínimo una letra." @@ -1040,57 +1071,57 @@ msgstr "El valor del máximo tiene que ser un número entero." msgid "Maximum must be equal or greater than minimum." msgstr "El valor del máximo tiene que ser igual o mayor al del mínimo." -#: pkg/campsite/types/option.go:353 pkg/campsite/types/admin.go:411 +#: pkg/campsite/types/option.go:353 pkg/campsite/types/admin.go:427 msgid "Price per night can not be empty." msgstr "No podéis dejar el precio por noche en blanco." -#: pkg/campsite/types/option.go:354 pkg/campsite/types/admin.go:412 +#: pkg/campsite/types/option.go:354 pkg/campsite/types/admin.go:428 msgid "Price per night must be a decimal number." msgstr "El precio por noche tien que ser un número decimal." -#: pkg/campsite/types/option.go:355 pkg/campsite/types/admin.go:413 +#: pkg/campsite/types/option.go:355 pkg/campsite/types/admin.go:429 msgid "Price per night must be zero or greater." msgstr "El precio por noche tiene que ser como mínimo cero." -#: pkg/campsite/types/admin.go:283 +#: pkg/campsite/types/admin.go:289 msgctxt "input" msgid "Cover image" msgstr "Imagen de portada" -#: pkg/campsite/types/admin.go:284 +#: pkg/campsite/types/admin.go:290 msgctxt "action" msgid "Set campsite type cover" msgstr "Establecer la portada del tipo de alojamiento" -#: pkg/campsite/types/admin.go:400 +#: pkg/campsite/types/admin.go:416 msgid "Cover image can not be empty." msgstr "No podéis dejar la imagen de portada en blanco." -#: pkg/campsite/types/admin.go:401 +#: pkg/campsite/types/admin.go:417 msgid "Cover image must be an image media type." msgstr "La imagen de portada tiene que ser un medio de tipo imagen." -#: pkg/campsite/types/admin.go:405 +#: pkg/campsite/types/admin.go:421 msgid "Maximum number of campers can not be empty." msgstr "No podéis dejar el número máximo de personas en blanco." -#: pkg/campsite/types/admin.go:406 +#: pkg/campsite/types/admin.go:422 msgid "Maximum number of campers must be an integer number." msgstr "El número máximo de personas tiene que ser entero." -#: pkg/campsite/types/admin.go:407 +#: pkg/campsite/types/admin.go:423 msgid "Maximum number of campers must be one or greater." msgstr "El número máximo de personas no puede ser cero." -#: pkg/campsite/types/admin.go:416 +#: pkg/campsite/types/admin.go:432 msgid "Minimum number of nights can not be empty." msgstr "No podéis dejar el número mínimo de noches en blanco." -#: pkg/campsite/types/admin.go:417 +#: pkg/campsite/types/admin.go:433 msgid "Minimum number of nights must be an integer." msgstr "El número mínimo de noches tiene que ser entero." -#: pkg/campsite/types/admin.go:418 +#: pkg/campsite/types/admin.go:434 msgid "Minimum number of nights must be one or greater." msgstr "El número mínimo de noches no puede ser cero." @@ -1267,6 +1298,22 @@ 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." +#~ msgctxt "title" +#~ msgid "Pricing" +#~ msgstr "Precios" + +#~ msgctxt "input" +#~ msgid "Pricing" +#~ msgstr "Precios" + +#~ msgctxt "title" +#~ msgid "Features" +#~ msgstr "Características" + +#~ msgctxt "input" +#~ msgid "Features" +#~ msgstr "Características" + #~ msgid "Singular Lodges" #~ msgstr "Alojamientos singulares" diff --git a/revert/add_campsite_type.sql b/revert/add_campsite_type.sql index 98814de..c0eb263 100644 --- a/revert/add_campsite_type.sql +++ b/revert/add_campsite_type.sql @@ -2,6 +2,6 @@ begin; -drop function if exists camper.add_campsite_type(integer, integer, text, text, text, integer, boolean); +drop function if exists camper.add_campsite_type(integer, integer, text, text, text, text, text, integer, boolean); commit; diff --git a/revert/edit_campsite_type.sql b/revert/edit_campsite_type.sql index 3cbb906..a410dd1 100644 --- a/revert/edit_campsite_type.sql +++ b/revert/edit_campsite_type.sql @@ -2,6 +2,6 @@ begin; -drop function if exists camper.edit_campsite_type(uuid, integer, text, text, text, integer, boolean, boolean); +drop function if exists camper.edit_campsite_type(uuid, integer, text, text, text, text, text, integer, boolean, boolean); commit; diff --git a/revert/translate_campsite_type.sql b/revert/translate_campsite_type.sql index a92580f..95a883d 100644 --- a/revert/translate_campsite_type.sql +++ b/revert/translate_campsite_type.sql @@ -2,6 +2,6 @@ begin; -drop function if exists camper.translate_campsite_type(uuid, text, text, text, text); +drop function if exists camper.translate_campsite_type(uuid, text, text, text, text, text, text); commit; diff --git a/test/add_campsite_type.sql b/test/add_campsite_type.sql index 208a493..ceff737 100644 --- a/test/add_campsite_type.sql +++ b/test/add_campsite_type.sql @@ -9,15 +9,15 @@ set search_path to camper, public; select plan(13); -select has_function('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'integer', 'boolean']); -select function_lang_is('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'integer', 'boolean'], 'sql'); -select function_returns('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'integer', 'boolean'], 'uuid'); -select isnt_definer('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'integer', 'boolean']); -select volatility_is('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'integer', 'boolean'], 'volatile'); -select function_privs_are('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'integer', 'boolean'], 'guest', array[]::text[]); -select function_privs_are('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'integer', 'boolean'], 'employee', array[]::text[]); -select function_privs_are('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'integer', 'boolean'], 'admin', array['EXECUTE']); -select function_privs_are('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'integer', 'boolean'], 'authenticator', array[]::text[]); +select has_function('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean']); +select function_lang_is('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean'], 'sql'); +select function_returns('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean'], 'uuid'); +select isnt_definer('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean']); +select volatility_is('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean'], 'volatile'); +select function_privs_are('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean'], 'guest', array[]::text[]); +select function_privs_are('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean'], 'employee', array[]::text[]); +select function_privs_are('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean'], 'admin', array['EXECUTE']); +select function_privs_are('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean'], 'authenticator', array[]::text[]); set client_min_messages to warning; @@ -44,19 +44,19 @@ values (3, 1, 'cover2.xpm', sha256('static char *s[]={"1 1 1 1","a c #ffffff","a ; select lives_ok( - $$ select add_campsite_type(1, 3, 'Type A', '', '

This is what, exactly?

Dunno

', 5, true) $$, + $$ select add_campsite_type(1, 3, 'Type A', '', '

Features

', '', '

This is what, exactly?

Dunno

', 5, true) $$, 'Should be able to add a campsite type to the first company' ); select lives_ok( - $$ select add_campsite_type(2, 4, 'Type B', '

One

Two

', '', 2, false) $$, + $$ select add_campsite_type(2, 4, 'Type B', '

One

Two

', '', '

Pricing

', '', 2, false) $$, 'Should be able to add a campsite type to the second company' ); select bag_eq( - $$ select company_id, media_id, name, spiel::text, description::text, active, max_campers, dogs_allowed from campsite_type $$, - $$ values (1, 3, 'Type A', '', '

This is what, exactly?

Dunno

', true, 5, true) - , (2, 4, 'Type B', '

One

Two

', '', true, 2, false) + $$ select company_id, media_id, name, spiel::text, info::text, facilities::text, description::text, active, max_campers, dogs_allowed from campsite_type $$, + $$ values (1, 3, 'Type A', '', '

Features

', '', '

This is what, exactly?

Dunno

', true, 5, true) + , (2, 4, 'Type B', '

One

Two

', '', '

Pricing

', '', true, 2, false) $$, 'Should have added all two campsite type' ); diff --git a/test/campsite_type.sql b/test/campsite_type.sql index 02fb927..74a02f8 100644 --- a/test/campsite_type.sql +++ b/test/campsite_type.sql @@ -5,7 +5,7 @@ reset client_min_messages; begin; -select plan(69); +select plan(77); set search_path to camper, public; @@ -54,6 +54,18 @@ select col_not_null('campsite_type', 'spiel'); select col_has_default('campsite_type', 'spiel'); --select col_default_is('campsite_type', 'spiel', ''); +select has_column('campsite_type', 'info'); +select col_type_is('campsite_type', 'info', 'xml'); +select col_not_null('campsite_type', 'info'); +select col_has_default('campsite_type', 'info'); +--select col_default_is('campsite_type', 'info', ''); + +select has_column('campsite_type', 'facilities'); +select col_type_is('campsite_type', 'facilities', 'xml'); +select col_not_null('campsite_type', 'facilities'); +select col_has_default('campsite_type', 'facilities'); +--select col_default_is('campsite_type', 'facilities', ''); + select has_column('campsite_type', 'description'); select col_type_is('campsite_type', 'description', 'xml'); select col_not_null('campsite_type', 'description'); diff --git a/test/campsite_type_i18n.sql b/test/campsite_type_i18n.sql index cc83c22..f59e2ca 100644 --- a/test/campsite_type_i18n.sql +++ b/test/campsite_type_i18n.sql @@ -5,7 +5,7 @@ reset client_min_messages; begin; -select plan(31); +select plan(39); set search_path to camper, public; @@ -41,6 +41,16 @@ select col_type_is('campsite_type_i18n', 'spiel', 'xml'); select col_not_null('campsite_type_i18n', 'spiel'); select col_hasnt_default('campsite_type_i18n', 'spiel'); +select has_column('campsite_type_i18n', 'info'); +select col_type_is('campsite_type_i18n', 'info', 'xml'); +select col_not_null('campsite_type_i18n', 'info'); +select col_hasnt_default('campsite_type_i18n', 'info'); + +select has_column('campsite_type_i18n', 'facilities'); +select col_type_is('campsite_type_i18n', 'facilities', 'xml'); +select col_not_null('campsite_type_i18n', 'facilities'); +select col_hasnt_default('campsite_type_i18n', 'facilities'); + select has_column('campsite_type_i18n', 'description'); select col_type_is('campsite_type_i18n', 'description', 'xml'); select col_not_null('campsite_type_i18n', 'description'); diff --git a/test/edit_campsite_type.sql b/test/edit_campsite_type.sql index 5291733..6802bcd 100644 --- a/test/edit_campsite_type.sql +++ b/test/edit_campsite_type.sql @@ -9,15 +9,15 @@ set search_path to camper, public; select plan(12); -select has_function('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'integer', 'boolean', 'boolean']); -select function_lang_is('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'sql'); -select function_returns('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'uuid'); -select isnt_definer('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'integer', 'boolean', 'boolean']); -select volatility_is('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'volatile'); -select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'guest', array[]::text[]); -select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'employee', array[]::text[]); -select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'admin', array['EXECUTE']); -select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'authenticator', array[]::text[]); +select has_function('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean']); +select function_lang_is('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'sql'); +select function_returns('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'uuid'); +select isnt_definer('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean']); +select volatility_is('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'volatile'); +select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'guest', array[]::text[]); +select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'employee', array[]::text[]); +select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'admin', array['EXECUTE']); +select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'authenticator', array[]::text[]); set client_min_messages to warning; truncate campsite_type cascade; @@ -43,25 +43,25 @@ values (2, 1, 'cover2.xpm', sha256('static char *s[]={"1 1 1 1","a c #ffffff","a , (4, 1, 'cover4.xpm', sha256('static char *s[]={"1 1 1 1","a c #ffff00","a"};')) ; -insert into campsite_type (company_id, slug, media_id, name, spiel, description, max_campers, dogs_allowed, active) -values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', '

1

', '

A

', 5, false, true) - , (1, '9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type B', '

2

', '

B

', 4, true, false) +insert into campsite_type (company_id, slug, media_id, name, spiel, info, facilities, description, max_campers, dogs_allowed, active) +values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', '

1

', '

info 1

', '

facilities A

', '

A

', 5, false, true) + , (1, '9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type B', '

2

', '

info 2

', '

facilities B

', '

B

', 4, true, false) ; select lives_ok( - $$ select edit_campsite_type('87452b88-b48f-48d3-bb6c-0296de64164e', 4, 'Type 1', '

A

', '

1

', 2, true, false) $$, + $$ select edit_campsite_type('87452b88-b48f-48d3-bb6c-0296de64164e', 4, 'Type 1', '

A

', '

Features A

', '

Pricing 1

', '

1

', 2, true, false) $$, 'Should be able to edit the first type' ); select lives_ok( - $$ select edit_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', null, 'Type 2', '

B

', '

2

', 9, false, true) $$, + $$ select edit_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', null, 'Type 2', '

B

', '

Features B

', '

Pricing 2

', '

2

', 9, false, true) $$, 'Should be able to edit the second type' ); select bag_eq( - $$ select slug::text, media_id, name, spiel::text, description::text, max_campers, dogs_allowed, active from campsite_type $$, - $$ values ('87452b88-b48f-48d3-bb6c-0296de64164e', 4, 'Type 1', '

A

', '

1

', 2, true, false) - , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type 2', '

B

', '

2

', 9, false, true) + $$ select slug::text, media_id, name, spiel::text, info::text, facilities::text, description::text, max_campers, dogs_allowed, active from campsite_type $$, + $$ values ('87452b88-b48f-48d3-bb6c-0296de64164e', 4, 'Type 1', '

A

', '

Features A

', '

Pricing 1

', '

1

', 2, true, false) + , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type 2', '

B

', '

Features B

', '

Pricing 2

', '

2

', 9, false, true) $$, 'Should have updated all campsite types.' ); diff --git a/test/translate_campsite_type.sql b/test/translate_campsite_type.sql index acb507a..db18aef 100644 --- a/test/translate_campsite_type.sql +++ b/test/translate_campsite_type.sql @@ -9,15 +9,15 @@ select plan(13); set search_path to camper, public; -select has_function('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text']); -select function_lang_is('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text'], 'sql'); -select function_returns('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text'], 'void'); -select isnt_definer('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text']); -select volatility_is('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text'], 'volatile'); -select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text'], 'guest', array[]::text[]); -select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text'], 'employee', array[]::text[]); -select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text'], 'admin', array['EXECUTE']); -select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text'], 'authenticator', array[]::text[]); +select has_function('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text']); +select function_lang_is('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text'], 'sql'); +select function_returns('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text'], 'void'); +select isnt_definer('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text']); +select volatility_is('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text'], 'volatile'); +select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text'], 'guest', array[]::text[]); +select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text'], 'employee', array[]::text[]); +select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text'], 'admin', array['EXECUTE']); +select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text'], 'authenticator', array[]::text[]); set client_min_messages to warning; @@ -43,36 +43,36 @@ values (2, 1, 'cover2.xpm', sha256('static char *s[]={"1 1 1 1","a c #ffffff","a , (4, 1, 'cover4.xpm', sha256('static char *s[]={"1 1 1 1","a c #ffff00","a"};')) ; -insert into campsite_type (company_id, slug, media_id, name, spiel, description, active, dogs_allowed, max_campers) -values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', '

One

', '

A

', true, false, 4) - , (1, '9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type B', '

Two

', '

B

', false, true, 5) +insert into campsite_type (company_id, slug, media_id, name, spiel, info, facilities, description, active, dogs_allowed, max_campers) +values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', '

One

', '

Features A

', '

Pricing A

', '

A

', true, false, 4) + , (1, '9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type B', '

Two

', '

Features B

', '

Pricing B

', '

B

', false, true, 5) ; -insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, description) -select campsite_type_id, 'ca', 'tipusb', '

dos

', '

B

' from campsite_type +insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description) +select campsite_type_id, 'ca', 'tipusb', '

dos

', '

característiques b

', '

preus b

', '

B

' from campsite_type where slug = '9b6370f7-f941-46f2-bc6e-de455675bd0a' ; select lives_ok( - $$ select translate_campsite_type('87452b88-b48f-48d3-bb6c-0296de64164e', 'ca', 'Tipus A', '

Un

', '

a

') $$, + $$ select translate_campsite_type('87452b88-b48f-48d3-bb6c-0296de64164e', 'ca', 'Tipus A', null, '

Característiques A

', null, '

a

') $$, 'Should be able to translate the first type' ); select lives_ok( - $$ select translate_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'es', 'Tipo B', '

Dos

', '

b

') $$, + $$ select translate_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'es', 'Tipo B', '

Dos

', null, '

Precios B

', null) $$, 'Should be able to translate the second type' ); select lives_ok( - $$ select translate_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'ca', 'Tipus B', null, null) $$, - 'Should be able to overwrite the catalan translation of the second type, with no description nor spiel' + $$ select translate_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'ca', 'Tipus B', '

Dos

', '

Característiques B

', '

Preus B

', '

2

') $$, + 'Should be able to overwrite the catalan translation of the second type' ); select bag_eq( - $$ select slug::text, lang_tag, i18n.name, i18n.spiel::text, i18n.description::text from campsite_type_i18n as i18n join campsite_type using (campsite_type_id) $$, - $$ values ('87452b88-b48f-48d3-bb6c-0296de64164e', 'ca', 'Tipus A', '

Un

', '

a

') - , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'ca', 'Tipus B', '', '') - , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'es', 'Tipo B', '

Dos

', '

b

') + $$ select slug::text, lang_tag, i18n.name, i18n.spiel::text, i18n.info::text, i18n.facilities::text, i18n.description::text from campsite_type_i18n as i18n join campsite_type using (campsite_type_id) $$, + $$ values ('87452b88-b48f-48d3-bb6c-0296de64164e', 'ca', 'Tipus A', '', '

Característiques A

', '', '

a

') + , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'ca', 'Tipus B', '

Dos

', '

Característiques B

', '

Preus B

', '

2

') + , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'es', 'Tipo B', '

Dos

', '', '

Precios B

', '') $$, 'Should have added and updated all translations.' ); diff --git a/verify/add_campsite_type.sql b/verify/add_campsite_type.sql index 727d9e2..40d9133 100644 --- a/verify/add_campsite_type.sql +++ b/verify/add_campsite_type.sql @@ -2,6 +2,6 @@ begin; -select has_function_privilege('camper.add_campsite_type(integer, integer, text, text, text, integer, boolean)', 'execute'); +select has_function_privilege('camper.add_campsite_type(integer, integer, text, text, text, text, text, integer, boolean)', 'execute'); rollback; diff --git a/verify/campsite_type.sql b/verify/campsite_type.sql index cb8342d..592eec4 100644 --- a/verify/campsite_type.sql +++ b/verify/campsite_type.sql @@ -8,6 +8,8 @@ select campsite_type_id , name , media_id , spiel + , info + , facilities , description , max_campers , dogs_allowed diff --git a/verify/campsite_type_i18n.sql b/verify/campsite_type_i18n.sql index 0a77b13..32769d3 100644 --- a/verify/campsite_type_i18n.sql +++ b/verify/campsite_type_i18n.sql @@ -6,6 +6,8 @@ select campsite_type_id , lang_tag , name , spiel + , info + , facilities , description from camper.campsite_type_i18n where false; diff --git a/verify/edit_campsite_type.sql b/verify/edit_campsite_type.sql index 210a12e..0c0f89d 100644 --- a/verify/edit_campsite_type.sql +++ b/verify/edit_campsite_type.sql @@ -2,6 +2,6 @@ begin; -select has_function_privilege('camper.edit_campsite_type(uuid, integer, text, text, text, integer, boolean, boolean)', 'execute'); +select has_function_privilege('camper.edit_campsite_type(uuid, integer, text, text, text, text, text, integer, boolean, boolean)', 'execute'); rollback; diff --git a/verify/translate_campsite_type.sql b/verify/translate_campsite_type.sql index 73247ae..349da25 100644 --- a/verify/translate_campsite_type.sql +++ b/verify/translate_campsite_type.sql @@ -2,6 +2,6 @@ begin; -select has_function_privilege('camper.translate_campsite_type(uuid, text, text, text, text)', 'execute'); +select has_function_privilege('camper.translate_campsite_type(uuid, text, text, text, text, text, text)', 'execute'); rollback; diff --git a/web/templates/admin/campsite/type/form.gohtml b/web/templates/admin/campsite/type/form.gohtml index 53fca2d..5eed407 100644 --- a/web/templates/admin/campsite/type/form.gohtml +++ b/web/templates/admin/campsite/type/form.gohtml @@ -101,6 +101,20 @@ {{ template "error-message" . }} {{- end }} + {{ with .Info -}} + + {{ template "error-message" . }} + {{- end }} + {{ with .Facilities -}} + + {{ template "error-message" . }} + {{- end }} {{ with .Description -}}