diff --git a/demo/demo.sql b/demo/demo.sql index 6964f7f..2cc51bf 100644 --- a/demo/demo.sql +++ b/demo/demo.sql @@ -114,23 +114,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.

', '

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); +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, 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.

') +insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info) +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_type_feature alter column campsite_type_feature_id restart with 82; diff --git a/deploy/add_campsite_type.sql b/deploy/add_campsite_type.sql index 5f4081d..2304815 100644 --- a/deploy/add_campsite_type.sql +++ b/deploy/add_campsite_type.sql @@ -8,16 +8,18 @@ begin; set search_path to camper, public; -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 +drop function if exists add_campsite_type(integer, integer, text, text, text, text, text, integer, boolean); + +create or replace function add_campsite_type(company integer, media_id integer, name text, spiel text, info text, facilities text, description text, additional_info text, max_campers integer, dogs_allowed boolean) returns uuid as $$ - 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) + insert into campsite_type (company_id, media_id, name, spiel, info, facilities, description, additional_info, max_campers, dogs_allowed) + values (company, media_id, name, xmlparse(content spiel), xmlparse(content info), xmlparse(content facilities), xmlparse(content description), xmlparse(content additional_info), max_campers, dogs_allowed) returning slug; $$ language sql ; -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; +revoke execute on function add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean) from public; +grant execute on function add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean) to admin; commit; diff --git a/deploy/add_campsite_type@v0.sql b/deploy/add_campsite_type@v0.sql new file mode 100644 index 0000000..5f4081d --- /dev/null +++ b/deploy/add_campsite_type@v0.sql @@ -0,0 +1,23 @@ +-- Deploy camper:add_campsite_type to pg +-- requires: roles +-- requires: schema_camper +-- requires: campsite_type +-- requires: company + +begin; + +set search_path to camper, public; + +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, 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, 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__additional_info.sql b/deploy/campsite_type__additional_info.sql new file mode 100644 index 0000000..f773189 --- /dev/null +++ b/deploy/campsite_type__additional_info.sql @@ -0,0 +1,10 @@ +-- Deploy camper:campsite_type__additional_info to pg +-- requires: campsite_type + +begin; + +alter table camper.campsite_type +add column additional_info xml not null default '' +; + +commit; diff --git a/deploy/campsite_type_i18n__additional_info.sql b/deploy/campsite_type_i18n__additional_info.sql new file mode 100644 index 0000000..2db00e4 --- /dev/null +++ b/deploy/campsite_type_i18n__additional_info.sql @@ -0,0 +1,14 @@ +-- Deploy camper:campsite_type_i18n__additional_info to pg +-- requires: campsite_type_i18n + +begin; + +alter table camper.campsite_type_i18n +add column additional_info xml not null default '' +; + +alter table camper.campsite_type_i18n +alter column additional_info drop default +; + +commit; diff --git a/deploy/edit_campsite_type.sql b/deploy/edit_campsite_type.sql index ba605ff..b248a61 100644 --- a/deploy/edit_campsite_type.sql +++ b/deploy/edit_campsite_type.sql @@ -8,13 +8,16 @@ begin; set search_path to camper, public; -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 +drop function if exists edit_campsite_type(uuid, integer, text, text, text, text, text, integer, boolean, boolean); + +create or replace function edit_campsite_type(slug uuid, media_id integer, name text, spiel text, info text, facilities text, description text, additional_info 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) + , additional_info = xmlparse(content edit_campsite_type.additional_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 @@ -26,7 +29,7 @@ $$ language sql ; -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; +revoke execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean) from public; +grant execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean) to admin; commit; diff --git a/deploy/edit_campsite_type@v0.sql b/deploy/edit_campsite_type@v0.sql new file mode 100644 index 0000000..ba605ff --- /dev/null +++ b/deploy/edit_campsite_type@v0.sql @@ -0,0 +1,32 @@ +-- Deploy camper:edit_campsite_type to pg +-- requires: roles +-- requires: schema_camper +-- requires: campsite_type +-- requires: company + +begin; + +set search_path to camper, public; + +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 + , active = edit_campsite_type.active + where slug = edit_campsite_type.slug + returning slug; +$$ +language sql +; + +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 6bdbf85..e4d6883 100644 --- a/deploy/translate_campsite_type.sql +++ b/deploy/translate_campsite_type.sql @@ -7,10 +7,12 @@ begin; set search_path to camper, public; -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 +drop function if exists translate_campsite_type (uuid, text, text, text, text, text, text); + +create or replace function translate_campsite_type (slug uuid, lang_tag text, name text, spiel text, info text, facilities text, description text, additional_info text) returns void as $$ - 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, '')) + insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info) + 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, '')), xmlparse(content coalesce(translate_campsite_type.additional_info, '')) from campsite_type where slug = translate_campsite_type.slug on conflict (campsite_type_id, lang_tag) do update @@ -19,11 +21,12 @@ $$ , info = excluded.info , facilities = excluded.facilities , description = excluded.description + , additional_info = excluded.additional_info $$ language sql ; -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; +revoke execute on function translate_campsite_type (uuid, text, text, text, text, text, text, text) from public; +grant execute on function translate_campsite_type(uuid, text, text, text, text, text, text, text) to admin; commit; diff --git a/deploy/translate_campsite_type@v0.sql b/deploy/translate_campsite_type@v0.sql new file mode 100644 index 0000000..6bdbf85 --- /dev/null +++ b/deploy/translate_campsite_type@v0.sql @@ -0,0 +1,29 @@ +-- Deploy camper:translate_campsite_type to pg +-- requires: roles +-- requires: schema_camper +-- requires: campsite_type_i18n + +begin; + +set search_path to camper, public; + +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, 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, 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 3b30ad7..75c8c08 100644 --- a/pkg/campsite/types/admin.go +++ b/pkg/campsite/types/admin.go @@ -167,14 +167,15 @@ 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[f.DefaultLang].Val, f.Spiel[f.DefaultLang].Val, f.Info[f.DefaultLang].Val, f.Facilities[f.DefaultLang].Val, f.Description[f.DefaultLang].Val, f.MaxCampers.Int(), f.DogsAllowed.Checked) + var err error + f.Slug, err = tx.AddCampsiteType(ctx, company.ID, f.Media.Int(), f.Name[f.DefaultLang].Val, f.Spiel[f.DefaultLang].Val, f.Info[f.DefaultLang].Val, f.Facilities[f.DefaultLang].Val, f.Description[f.DefaultLang].Val, f.AdditionalInfo[f.DefaultLang].Val, f.MaxCampers.Int(), f.DogsAllowed.Checked) if err != nil { return err } if err := translateTypes(ctx, tx, company, f); err != nil { return err } - return setTypePrices(ctx, tx, slug, f.Prices) + return setTypePrices(ctx, tx, f.Slug, f.Prices) }) } @@ -184,7 +185,7 @@ func translateTypes(ctx context.Context, tx *database.Tx, company *auth.Company, if l == f.DefaultLang { continue } - if err := tx.TranslateCampsiteType(ctx, f.Slug, lang, f.Name[l].Val, f.Spiel[l].Val, f.Info[l].Val, f.Facilities[l].Val, f.Description[l].Val); err != nil { + if err := tx.TranslateCampsiteType(ctx, f.Slug, lang, f.Name[l].Val, f.Spiel[l].Val, f.Info[l].Val, f.Facilities[l].Val, f.Description[l].Val, f.AdditionalInfo[l].Val); err != nil { return err } } @@ -202,7 +203,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[f.DefaultLang].Val, f.Spiel[f.DefaultLang].Val, f.Info[f.DefaultLang].Val, f.Facilities[f.DefaultLang].Val, f.Description[f.DefaultLang].Val, f.MaxCampers.Int(), f.DogsAllowed.Checked, f.Active.Checked); err != nil { + if _, err := tx.EditCampsiteType(ctx, f.Slug, f.Media.Int(), f.Name[f.DefaultLang].Val, f.Spiel[f.DefaultLang].Val, f.Info[f.DefaultLang].Val, f.Facilities[f.DefaultLang].Val, f.Description[f.DefaultLang].Val, f.AdditionalInfo[f.DefaultLang].Val, f.MaxCampers.Int(), f.DogsAllowed.Checked, f.Active.Checked); err != nil { return err } if err := translateTypes(ctx, tx, company, f); err != nil { @@ -270,18 +271,19 @@ func processTypeForm(w http.ResponseWriter, r *http.Request, user *auth.User, co } type typeForm struct { - DefaultLang string - Slug string - Active *form.Checkbox - Media *form.Media - Name form.I18nInput - MaxCampers *form.Input - DogsAllowed *form.Checkbox - Spiel form.I18nInput - Info form.I18nInput - Facilities form.I18nInput - Description form.I18nInput - Prices map[int]*typePriceForm + DefaultLang string + Slug string + Active *form.Checkbox + Media *form.Media + Name form.I18nInput + MaxCampers *form.Input + DogsAllowed *form.Checkbox + Spiel form.I18nInput + Info form.I18nInput + Facilities form.I18nInput + Description form.I18nInput + AdditionalInfo form.I18nInput + Prices map[int]*typePriceForm } type typePriceForm struct { @@ -311,10 +313,11 @@ func newTypeForm(ctx context.Context, company *auth.Company, conn *database.Conn DogsAllowed: &form.Checkbox{ Name: "dogs_allowed", }, - Spiel: form.NewI18nInput(company.Locales, "spiel"), - Info: form.NewI18nInput(company.Locales, "info"), - Facilities: form.NewI18nInput(company.Locales, "facilities"), - Description: form.NewI18nInput(company.Locales, "description"), + Spiel: form.NewI18nInput(company.Locales, "spiel"), + Info: form.NewI18nInput(company.Locales, "info"), + Facilities: form.NewI18nInput(company.Locales, "facilities"), + Description: form.NewI18nInput(company.Locales, "description"), + AdditionalInfo: form.NewI18nInput(company.Locales, "additional_info"), } rows, err := conn.Query(ctx, "select season_id, name from season where active and company_id = $1", company.ID) @@ -353,12 +356,14 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl var info database.RecordArray var facilities database.RecordArray var description database.RecordArray + var additionalInfo database.RecordArray row := conn.QueryRow(ctx, ` select campsite_type.name , campsite_type.spiel::text , campsite_type.info::text , campsite_type.facilities::text , campsite_type.description::text + , campsite_type.additional_info::text , media_id::text , max_campers::text , dogs_allowed @@ -368,6 +373,7 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl , array_agg((lang_tag, i18n.info::text)) , array_agg((lang_tag, i18n.facilities::text)) , array_agg((lang_tag, i18n.description::text)) + , array_agg((lang_tag, i18n.additional_info::text)) from campsite_type left join campsite_type_i18n as i18n using (campsite_type_id) where slug = $1 @@ -376,12 +382,13 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl , campsite_type.info::text , campsite_type.facilities::text , campsite_type.description::text + , campsite_type.additional_info::text , media_id::text , max_campers::text , dogs_allowed , active `, pgx.QueryResultFormats{pgx.BinaryFormatCode}, slug) - if err := row.Scan(&f.Name[f.DefaultLang].Val, &f.Spiel[f.DefaultLang].Val, &f.Info[f.DefaultLang].Val, &f.Facilities[f.DefaultLang].Val, &f.Description[f.DefaultLang].Val, &f.Media.Val, &f.MaxCampers.Val, &f.DogsAllowed.Checked, &f.Active.Checked, &name, &spiel, &info, &facilities, &description); err != nil { + if err := row.Scan(&f.Name[f.DefaultLang].Val, &f.Spiel[f.DefaultLang].Val, &f.Info[f.DefaultLang].Val, &f.Facilities[f.DefaultLang].Val, &f.Description[f.DefaultLang].Val, &f.AdditionalInfo[f.DefaultLang].Val, &f.Media.Val, &f.MaxCampers.Val, &f.DogsAllowed.Checked, &f.Active.Checked, &name, &spiel, &info, &facilities, &description, &additionalInfo); err != nil { return err } if err := f.Name.FillArray(name); err != nil { @@ -399,6 +406,9 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl if err := f.Description.FillArray(description); err != nil { return err } + if err := f.AdditionalInfo.FillArray(additionalInfo); err != nil { + return err + } rows, err := conn.Query(ctx, ` select season_id @@ -440,6 +450,7 @@ func (f *typeForm) Parse(r *http.Request) error { f.Info.FillValue(r) f.Facilities.FillValue(r) f.Description.FillValue(r) + f.AdditionalInfo.FillValue(r) f.Media.FillValue(r) for _, p := range f.Prices { p.PricePerNight.FillValue(r) diff --git a/pkg/campsite/types/public.go b/pkg/campsite/types/public.go index bd64633..352c764 100644 --- a/pkg/campsite/types/public.go +++ b/pkg/campsite/types/public.go @@ -62,16 +62,17 @@ func (h *PublicHandler) Handler(user *auth.User, company *auth.Company, conn *da type publicPage struct { *template.PublicPage - Slug string - Name string - Carousel []*carousel.Slide - Prices []*typePrice - Features []*typeFeature - Calendar *season.Calendar - Spiel gotemplate.HTML - Info gotemplate.HTML - Facilities gotemplate.HTML - Description gotemplate.HTML + Slug string + Name string + Carousel []*carousel.Slide + Prices []*typePrice + Features []*typeFeature + Calendar *season.Calendar + Spiel gotemplate.HTML + Info gotemplate.HTML + Facilities gotemplate.HTML + Description gotemplate.HTML + AdditionalInfo gotemplate.HTML } type typePrice struct { @@ -120,12 +121,13 @@ func newPublicPage(ctx context.Context, company *auth.Company, conn *database.Co , 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 + , coalesce(i18n.additional_info, campsite_type.additional_info)::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.Info, &page.Facilities, &page.Description); err != nil { + if err := row.Scan(&page.Name, &page.Spiel, &page.Info, &page.Facilities, &page.Description, &page.AdditionalInfo); err != nil { return nil, err } diff --git a/pkg/database/funcs.go b/pkg/database/funcs.go index ecc155c..3616342 100644 --- a/pkg/database/funcs.go +++ b/pkg/database/funcs.go @@ -11,12 +11,12 @@ import ( "golang.org/x/text/language" ) -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) AddCampsiteType(ctx context.Context, companyID int, mediaID int, name string, spiel string, info string, facilities string, description string, additionalInfo string, maxCampers int, dogsAllowed bool) (string, error) { + return tx.GetText(ctx, "select add_campsite_type($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)", companyID, mediaID, name, spiel, info, facilities, description, additionalInfo, maxCampers, dogsAllowed) } -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 (tx *Tx) EditCampsiteType(ctx context.Context, slug string, mediaID int, name string, spiel string, info string, facilities string, description string, additionalInfo 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, $11)", slug, mediaID, name, spiel, info, facilities, description, additionalInfo, maxCampers, dogsAllowed, active) } func (c *Conn) OrderCampsiteTypes(ctx context.Context, slugs []string) error { @@ -24,8 +24,8 @@ func (c *Conn) OrderCampsiteTypes(ctx context.Context, slugs []string) error { return err } -func (tx *Tx) TranslateCampsiteType(ctx context.Context, slug string, langTag language.Tag, name string, spiel string, info string, facilities string, description string) error { - _, err := tx.Exec(ctx, "select translate_campsite_type($1, $2, $3, $4, $5, $6, $7)", slug, langTag, name, spiel, info, facilities, description) +func (tx *Tx) TranslateCampsiteType(ctx context.Context, slug string, langTag language.Tag, name string, spiel string, info string, facilities string, description string, additionalInfo string) error { + _, err := tx.Exec(ctx, "select translate_campsite_type($1, $2, $3, $4, $5, $6, $7, $8)", slug, langTag, name, spiel, info, facilities, description, additionalInfo) 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 cca291a..eb9a5ce 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-01-14 02:01+0100\n" +"POT-Creation-Date: 2024-01-15 00:21+0100\n" "PO-Revision-Date: 2023-07-22 23:45+0200\n" "Last-Translator: jordi fita mas \n" "Language-Team: Catalan \n" @@ -170,6 +170,11 @@ msgctxt "title" msgid "Description" msgstr "Descripció" +#: web/templates/public/campsite/type.gohtml:128 +msgctxt "title" +msgid "Additional Information" +msgstr "Informació addicional" + #: web/templates/public/campsite/calendar.gohtml:18 #: web/templates/admin/season/calendar.gohtml:16 msgctxt "day" @@ -271,7 +276,7 @@ msgid "There are several points where you can go by kayak, from sections of the msgstr "Hi ha diversos punts on poder anar amb caiac, des de trams del riu Ter com també a la costa…." #: web/templates/public/campground.gohtml:6 -#: web/templates/public/campground.gohtml:11 +#: web/templates/public/campground.gohtml:15 #: web/templates/public/layout.gohtml:53 web/templates/public/layout.gohtml:93 msgctxt "title" msgid "Campground" @@ -440,7 +445,7 @@ msgstr "Contingut" #: web/templates/admin/campsite/carousel/form.gohtml:52 #: web/templates/admin/campsite/form.gohtml:70 #: web/templates/admin/campsite/option/form.gohtml:83 -#: web/templates/admin/campsite/type/form.gohtml:158 +#: web/templates/admin/campsite/type/form.gohtml:171 #: web/templates/admin/season/form.gohtml:69 #: web/templates/admin/services/form.gohtml:80 #: web/templates/admin/media/form.gohtml:35 @@ -454,7 +459,7 @@ msgstr "Actualitza" #: web/templates/admin/campsite/carousel/form.gohtml:54 #: web/templates/admin/campsite/form.gohtml:72 #: web/templates/admin/campsite/option/form.gohtml:85 -#: web/templates/admin/campsite/type/form.gohtml:160 +#: web/templates/admin/campsite/type/form.gohtml:173 #: web/templates/admin/season/form.gohtml:71 #: web/templates/admin/services/form.gohtml:82 msgctxt "action" @@ -791,6 +796,11 @@ msgctxt "input" msgid "Description" msgstr "Descripció" +#: web/templates/admin/campsite/type/form.gohtml:156 +msgctxt "input" +msgid "Additional Information" +msgstr "Informació addicional" + #: web/templates/admin/campsite/type/index.gohtml:6 #: web/templates/admin/campsite/type/index.gohtml:12 #: web/templates/admin/layout.gohtml:42 @@ -1192,13 +1202,13 @@ msgid "Upload Media" msgstr "Pujada de mèdia" #: pkg/legal/admin.go:258 pkg/app/user.go:249 pkg/campsite/types/option.go:344 -#: pkg/campsite/types/feature.go:259 pkg/campsite/types/admin.go:453 +#: pkg/campsite/types/feature.go:259 pkg/campsite/types/admin.go:463 #: pkg/season/admin.go:415 pkg/services/admin.go:319 msgid "Name can not be empty." msgstr "No podeu deixar el nom en blanc." #: pkg/legal/admin.go:259 pkg/campsite/types/option.go:345 -#: pkg/campsite/types/feature.go:260 pkg/campsite/types/admin.go:454 +#: pkg/campsite/types/feature.go:260 pkg/campsite/types/admin.go:464 msgid "Name must have at least one letter." msgstr "El nom ha de tenir com a mínim una lletra." @@ -1283,15 +1293,15 @@ 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:361 pkg/campsite/types/admin.go:467 +#: pkg/campsite/types/option.go:361 pkg/campsite/types/admin.go:477 msgid "Price per night can not be empty." msgstr "No podeu deixar el preu per nit en blanc." -#: pkg/campsite/types/option.go:362 pkg/campsite/types/admin.go:468 +#: pkg/campsite/types/option.go:362 pkg/campsite/types/admin.go:478 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:363 pkg/campsite/types/admin.go:469 +#: pkg/campsite/types/option.go:363 pkg/campsite/types/admin.go:479 msgid "Price per night must be zero or greater." msgstr "El preu per nit ha de ser com a mínim zero." @@ -1299,45 +1309,45 @@ msgstr "El preu per nit ha de ser com a mínim zero." msgid "Selected icon is not valid." msgstr "La icona escollida no és vàlida." -#: pkg/campsite/types/admin.go:304 +#: pkg/campsite/types/admin.go:305 msgctxt "input" msgid "Cover image" msgstr "Imatge de portada" -#: pkg/campsite/types/admin.go:305 +#: pkg/campsite/types/admin.go:306 msgctxt "action" msgid "Set campsite type cover" msgstr "Estableix la portada del tipus d’allotjament" -#: pkg/campsite/types/admin.go:456 +#: pkg/campsite/types/admin.go:466 msgid "Cover image can not be empty." msgstr "No podeu deixar la imatge de portada en blanc." -#: pkg/campsite/types/admin.go:457 +#: pkg/campsite/types/admin.go:467 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:461 +#: pkg/campsite/types/admin.go:471 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:462 +#: pkg/campsite/types/admin.go:472 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:463 +#: pkg/campsite/types/admin.go:473 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:472 +#: pkg/campsite/types/admin.go:482 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:473 +#: pkg/campsite/types/admin.go:483 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:474 +#: pkg/campsite/types/admin.go:484 msgid "Minimum number of nights must be one or greater." msgstr "El número mínim de nits no pot ser zero." diff --git a/po/es.po b/po/es.po index 6d2f848..d0d941b 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: 2024-01-14 02:01+0100\n" +"POT-Creation-Date: 2024-01-15 00:21+0100\n" "PO-Revision-Date: 2023-07-22 23:46+0200\n" "Last-Translator: jordi fita mas \n" "Language-Team: Spanish \n" @@ -163,13 +163,18 @@ msgstr "Información" #: web/templates/public/campsite/type.gohtml:120 msgctxt "title" msgid "Facilities" -msgstr "Equipamento" +msgstr "Equipamiento" #: web/templates/public/campsite/type.gohtml:124 msgctxt "title" msgid "Description" msgstr "Descripción" +#: web/templates/public/campsite/type.gohtml:128 +msgctxt "title" +msgid "Additional Information" +msgstr "Información adicional" + #: web/templates/public/campsite/calendar.gohtml:18 #: web/templates/admin/season/calendar.gohtml:16 msgctxt "day" @@ -271,7 +276,7 @@ msgid "There are several points where you can go by kayak, from sections of the msgstr "Hay diversos puntos dónde podéis ir en kayak, desde tramos del río Ter como también en la costa…." #: web/templates/public/campground.gohtml:6 -#: web/templates/public/campground.gohtml:11 +#: web/templates/public/campground.gohtml:15 #: web/templates/public/layout.gohtml:53 web/templates/public/layout.gohtml:93 msgctxt "title" msgid "Campground" @@ -440,7 +445,7 @@ msgstr "Contenido" #: web/templates/admin/campsite/carousel/form.gohtml:52 #: web/templates/admin/campsite/form.gohtml:70 #: web/templates/admin/campsite/option/form.gohtml:83 -#: web/templates/admin/campsite/type/form.gohtml:158 +#: web/templates/admin/campsite/type/form.gohtml:171 #: web/templates/admin/season/form.gohtml:69 #: web/templates/admin/services/form.gohtml:80 #: web/templates/admin/media/form.gohtml:35 @@ -454,7 +459,7 @@ msgstr "Actualizar" #: web/templates/admin/campsite/carousel/form.gohtml:54 #: web/templates/admin/campsite/form.gohtml:72 #: web/templates/admin/campsite/option/form.gohtml:85 -#: web/templates/admin/campsite/type/form.gohtml:160 +#: web/templates/admin/campsite/type/form.gohtml:173 #: web/templates/admin/season/form.gohtml:71 #: web/templates/admin/services/form.gohtml:82 msgctxt "action" @@ -791,6 +796,11 @@ msgctxt "input" msgid "Description" msgstr "Descripción" +#: web/templates/admin/campsite/type/form.gohtml:156 +msgctxt "input" +msgid "Additional Information" +msgstr "Información adicional" + #: web/templates/admin/campsite/type/index.gohtml:6 #: web/templates/admin/campsite/type/index.gohtml:12 #: web/templates/admin/layout.gohtml:42 @@ -1192,13 +1202,13 @@ msgid "Upload Media" msgstr "Subida de medio" #: pkg/legal/admin.go:258 pkg/app/user.go:249 pkg/campsite/types/option.go:344 -#: pkg/campsite/types/feature.go:259 pkg/campsite/types/admin.go:453 +#: pkg/campsite/types/feature.go:259 pkg/campsite/types/admin.go:463 #: pkg/season/admin.go:415 pkg/services/admin.go:319 msgid "Name can not be empty." msgstr "No podéis dejar el nombre en blanco." #: pkg/legal/admin.go:259 pkg/campsite/types/option.go:345 -#: pkg/campsite/types/feature.go:260 pkg/campsite/types/admin.go:454 +#: pkg/campsite/types/feature.go:260 pkg/campsite/types/admin.go:464 msgid "Name must have at least one letter." msgstr "El nombre tiene que tener como mínimo una letra." @@ -1283,15 +1293,15 @@ 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:361 pkg/campsite/types/admin.go:467 +#: pkg/campsite/types/option.go:361 pkg/campsite/types/admin.go:477 msgid "Price per night can not be empty." msgstr "No podéis dejar el precio por noche en blanco." -#: pkg/campsite/types/option.go:362 pkg/campsite/types/admin.go:468 +#: pkg/campsite/types/option.go:362 pkg/campsite/types/admin.go:478 msgid "Price per night must be a decimal number." msgstr "El precio por noche tiene que ser un número decimal." -#: pkg/campsite/types/option.go:363 pkg/campsite/types/admin.go:469 +#: pkg/campsite/types/option.go:363 pkg/campsite/types/admin.go:479 msgid "Price per night must be zero or greater." msgstr "El precio por noche tiene que ser como mínimo cero." @@ -1299,45 +1309,45 @@ msgstr "El precio por noche tiene que ser como mínimo cero." msgid "Selected icon is not valid." msgstr "El icono escogido no es válido." -#: pkg/campsite/types/admin.go:304 +#: pkg/campsite/types/admin.go:305 msgctxt "input" msgid "Cover image" msgstr "Imagen de portada" -#: pkg/campsite/types/admin.go:305 +#: pkg/campsite/types/admin.go:306 msgctxt "action" msgid "Set campsite type cover" msgstr "Establecer la portada del tipo de alojamiento" -#: pkg/campsite/types/admin.go:456 +#: pkg/campsite/types/admin.go:466 msgid "Cover image can not be empty." msgstr "No podéis dejar la imagen de portada en blanco." -#: pkg/campsite/types/admin.go:457 +#: pkg/campsite/types/admin.go:467 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:461 +#: pkg/campsite/types/admin.go:471 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:462 +#: pkg/campsite/types/admin.go:472 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:463 +#: pkg/campsite/types/admin.go:473 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:472 +#: pkg/campsite/types/admin.go:482 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:473 +#: pkg/campsite/types/admin.go:483 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:474 +#: pkg/campsite/types/admin.go:484 msgid "Minimum number of nights must be one or greater." msgstr "El número mínimo de noches no puede ser cero." diff --git a/po/fr.po b/po/fr.po index 08275e9..178bf03 100644 --- a/po/fr.po +++ b/po/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: camper\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n" -"POT-Creation-Date: 2024-01-14 02:01+0100\n" +"POT-Creation-Date: 2024-01-15 00:21+0100\n" "PO-Revision-Date: 2023-12-20 10:13+0100\n" "Last-Translator: Oriol Carbonell \n" "Language-Team: French \n" @@ -171,6 +171,11 @@ msgctxt "title" msgid "Description" msgstr "Description" +#: web/templates/public/campsite/type.gohtml:128 +msgctxt "title" +msgid "Additional Information" +msgstr "Informations Complémentaires" + #: web/templates/public/campsite/calendar.gohtml:18 #: web/templates/admin/season/calendar.gohtml:16 msgctxt "day" @@ -272,7 +277,7 @@ msgid "There are several points where you can go by kayak, from sections of the msgstr "Il y a plusieurs points où vous pouvez aller en kayak, à partir de sections de la rivière Ter ainsi que sur la côte…." #: web/templates/public/campground.gohtml:6 -#: web/templates/public/campground.gohtml:11 +#: web/templates/public/campground.gohtml:15 #: web/templates/public/layout.gohtml:53 web/templates/public/layout.gohtml:93 msgctxt "title" msgid "Campground" @@ -441,7 +446,7 @@ msgstr "Contenu" #: web/templates/admin/campsite/carousel/form.gohtml:52 #: web/templates/admin/campsite/form.gohtml:70 #: web/templates/admin/campsite/option/form.gohtml:83 -#: web/templates/admin/campsite/type/form.gohtml:158 +#: web/templates/admin/campsite/type/form.gohtml:171 #: web/templates/admin/season/form.gohtml:69 #: web/templates/admin/services/form.gohtml:80 #: web/templates/admin/media/form.gohtml:35 @@ -455,7 +460,7 @@ msgstr "Mettre à jour" #: web/templates/admin/campsite/carousel/form.gohtml:54 #: web/templates/admin/campsite/form.gohtml:72 #: web/templates/admin/campsite/option/form.gohtml:85 -#: web/templates/admin/campsite/type/form.gohtml:160 +#: web/templates/admin/campsite/type/form.gohtml:173 #: web/templates/admin/season/form.gohtml:71 #: web/templates/admin/services/form.gohtml:82 msgctxt "action" @@ -792,6 +797,11 @@ msgctxt "input" msgid "Description" msgstr "Description" +#: web/templates/admin/campsite/type/form.gohtml:156 +msgctxt "input" +msgid "Additional Information" +msgstr "Informations Complémentaires" + #: web/templates/admin/campsite/type/index.gohtml:6 #: web/templates/admin/campsite/type/index.gohtml:12 #: web/templates/admin/layout.gohtml:42 @@ -1193,13 +1203,13 @@ msgid "Upload Media" msgstr "Envoyer un fichier" #: pkg/legal/admin.go:258 pkg/app/user.go:249 pkg/campsite/types/option.go:344 -#: pkg/campsite/types/feature.go:259 pkg/campsite/types/admin.go:453 +#: pkg/campsite/types/feature.go:259 pkg/campsite/types/admin.go:463 #: pkg/season/admin.go:415 pkg/services/admin.go:319 msgid "Name can not be empty." msgstr "Le nom ne peut pas être laissé vide." #: pkg/legal/admin.go:259 pkg/campsite/types/option.go:345 -#: pkg/campsite/types/feature.go:260 pkg/campsite/types/admin.go:454 +#: pkg/campsite/types/feature.go:260 pkg/campsite/types/admin.go:464 msgid "Name must have at least one letter." msgstr "Le nom doit comporter au moins une lettre." @@ -1284,15 +1294,15 @@ msgstr "Le maximum doit être un nombre entier." msgid "Maximum must be equal or greater than minimum." msgstr "Le maximum doit être égal ou supérieur au minimum." -#: pkg/campsite/types/option.go:361 pkg/campsite/types/admin.go:467 +#: pkg/campsite/types/option.go:361 pkg/campsite/types/admin.go:477 msgid "Price per night can not be empty." msgstr "Le prix par nuit ne peut pas être vide." -#: pkg/campsite/types/option.go:362 pkg/campsite/types/admin.go:468 +#: pkg/campsite/types/option.go:362 pkg/campsite/types/admin.go:478 msgid "Price per night must be a decimal number." msgstr "Le prix par nuit doit être un nombre décimal." -#: pkg/campsite/types/option.go:363 pkg/campsite/types/admin.go:469 +#: pkg/campsite/types/option.go:363 pkg/campsite/types/admin.go:479 msgid "Price per night must be zero or greater." msgstr "Le prix par nuit doit être égal ou supérieur." @@ -1300,45 +1310,45 @@ msgstr "Le prix par nuit doit être égal ou supérieur." msgid "Selected icon is not valid." msgstr "L’icône sélectionnée n’est pas valide." -#: pkg/campsite/types/admin.go:304 +#: pkg/campsite/types/admin.go:305 msgctxt "input" msgid "Cover image" msgstr "Image de couverture" -#: pkg/campsite/types/admin.go:305 +#: pkg/campsite/types/admin.go:306 msgctxt "action" msgid "Set campsite type cover" msgstr "Définir une couverture type camping" -#: pkg/campsite/types/admin.go:456 +#: pkg/campsite/types/admin.go:466 msgid "Cover image can not be empty." msgstr "L’image de couverture ne peut pas être vide." -#: pkg/campsite/types/admin.go:457 +#: pkg/campsite/types/admin.go:467 msgid "Cover image must be an image media type." msgstr "L’image de couverture doit être de type média d’image." -#: pkg/campsite/types/admin.go:461 +#: pkg/campsite/types/admin.go:471 msgid "Maximum number of campers can not be empty." msgstr "Le nombre maximum de campeurs ne peut pas être vide." -#: pkg/campsite/types/admin.go:462 +#: pkg/campsite/types/admin.go:472 msgid "Maximum number of campers must be an integer number." msgstr "Le nombre maximum de campeurs doit être un nombre entier." -#: pkg/campsite/types/admin.go:463 +#: pkg/campsite/types/admin.go:473 msgid "Maximum number of campers must be one or greater." msgstr "Le nombre maximum de campeurs doit être égal ou supérieur à un campeur." -#: pkg/campsite/types/admin.go:472 +#: pkg/campsite/types/admin.go:482 msgid "Minimum number of nights can not be empty." msgstr "Le nombre minimum de nuits ne peut pas être vide." -#: pkg/campsite/types/admin.go:473 +#: pkg/campsite/types/admin.go:483 msgid "Minimum number of nights must be an integer." msgstr "Le nombre minimum de nuits doit être un entier." -#: pkg/campsite/types/admin.go:474 +#: pkg/campsite/types/admin.go:484 msgid "Minimum number of nights must be one or greater." msgstr "Le nombre minimum de nuits doit être supérieur ou égal à une nuit." diff --git a/revert/add_campsite_type.sql b/revert/add_campsite_type.sql index c0eb263..3e5ee87 100644 --- a/revert/add_campsite_type.sql +++ b/revert/add_campsite_type.sql @@ -1,7 +1,25 @@ --- Revert camper:add_campsite_type from pg +-- Deploy camper:add_campsite_type to pg +-- requires: roles +-- requires: schema_camper +-- requires: campsite_type +-- requires: company begin; -drop function if exists camper.add_campsite_type(integer, integer, text, text, text, text, text, integer, boolean); +set search_path to camper, public; + +drop function if exists add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean); + +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, 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, 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/revert/add_campsite_type@v0.sql b/revert/add_campsite_type@v0.sql new file mode 100644 index 0000000..c0eb263 --- /dev/null +++ b/revert/add_campsite_type@v0.sql @@ -0,0 +1,7 @@ +-- Revert camper:add_campsite_type from pg + +begin; + +drop function if exists camper.add_campsite_type(integer, integer, text, text, text, text, text, integer, boolean); + +commit; diff --git a/revert/campsite_type__additional_info.sql b/revert/campsite_type__additional_info.sql new file mode 100644 index 0000000..6576b5b --- /dev/null +++ b/revert/campsite_type__additional_info.sql @@ -0,0 +1,9 @@ +-- Revert camper:campsite_type__additional_info from pg + +begin; + +alter table camper.campsite_type +drop column if exists additional_info +; + +commit; diff --git a/revert/campsite_type_i18n__additional_info.sql b/revert/campsite_type_i18n__additional_info.sql new file mode 100644 index 0000000..14183d1 --- /dev/null +++ b/revert/campsite_type_i18n__additional_info.sql @@ -0,0 +1,9 @@ +-- Revert camper:campsite_type_i18n__additional_info from pg + +begin; + +alter table camper.campsite_type_i18n +drop column if exists additional_info +; + +commit; diff --git a/revert/edit_campsite_type.sql b/revert/edit_campsite_type.sql index a410dd1..8aedea5 100644 --- a/revert/edit_campsite_type.sql +++ b/revert/edit_campsite_type.sql @@ -1,7 +1,34 @@ --- Revert camper:edit_campsite_type from pg +-- Deploy camper:edit_campsite_type to pg +-- requires: roles +-- requires: schema_camper +-- requires: campsite_type +-- requires: company begin; -drop function if exists camper.edit_campsite_type(uuid, integer, text, text, text, text, text, integer, boolean, boolean); +set search_path to camper, public; + +drop function if exists edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean); + +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 + , active = edit_campsite_type.active + where slug = edit_campsite_type.slug + returning slug; +$$ +language sql +; + +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/revert/edit_campsite_type@v0.sql b/revert/edit_campsite_type@v0.sql new file mode 100644 index 0000000..a410dd1 --- /dev/null +++ b/revert/edit_campsite_type@v0.sql @@ -0,0 +1,7 @@ +-- Revert camper:edit_campsite_type from pg + +begin; + +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 95a883d..680ed04 100644 --- a/revert/translate_campsite_type.sql +++ b/revert/translate_campsite_type.sql @@ -1,7 +1,31 @@ --- Revert camper:translate_campsite_type from pg +-- Deploy camper:translate_campsite_type to pg +-- requires: roles +-- requires: schema_camper +-- requires: campsite_type_i18n begin; -drop function if exists camper.translate_campsite_type(uuid, text, text, text, text, text, text); +set search_path to camper, public; + +drop function if exists translate_campsite_type (uuid, text, text, text, text, text, text, text); + +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, 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, text, text) from public; +grant execute on function translate_campsite_type(uuid, text, text, text, text, text, text) to admin; commit; diff --git a/revert/translate_campsite_type@v0.sql b/revert/translate_campsite_type@v0.sql new file mode 100644 index 0000000..95a883d --- /dev/null +++ b/revert/translate_campsite_type@v0.sql @@ -0,0 +1,7 @@ +-- Revert camper:translate_campsite_type from pg + +begin; + +drop function if exists camper.translate_campsite_type(uuid, text, text, text, text, text, text); + +commit; diff --git a/sqitch.plan b/sqitch.plan index 7f9127b..177adee 100644 --- a/sqitch.plan +++ b/sqitch.plan @@ -136,3 +136,8 @@ add_services_carousel_slide [add_services_carousel_slide@v0] 2024-01-12T18:17:33 service__position [service] 2024-01-12T23:47:29Z jordi fita mas # Add position column to service order_services [schema_camper roles service service__position] 2024-01-12T23:52:24Z jordi fita mas # Add function to order services company__tourist_tax [company] 2024-01-14T00:06:26Z jordi fita mas # Add tourist_tax to company +campsite_type__additional_info [campsite_type] 2024-01-14T21:59:50Z jordi fita mas # Add additional_info column to campsite_type +campsite_type_i18n__additional_info [campsite_type_i18n] 2024-01-14T22:03:03Z jordi fita mas # Add additional_info column to campsite_type_i18n +add_campsite_type [add_campsite_type@v0 campsite_type__additional_info] 2024-01-14T22:06:19Z jordi fita mas # Add additional_info parameter to add_campsite_type +edit_campsite_type [edit_campsite_type@v0 campsite_type__additional_info] 2024-01-14T22:09:40Z jordi fita mas # Add additional_info parameter to edit_campsite_type +translate_campsite_type [translate_campsite_type@v0 campsite_type_i18n__additional_info] 2024-01-14T22:12:08Z jordi fita mas # Add additional_info parameter to translate_campsite_type diff --git a/test/add_campsite_type.sql b/test/add_campsite_type.sql index 94db3a6..4898fd0 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', '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[]); +select has_function('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean']); +select function_lang_is('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean'], 'sql'); +select function_returns('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean'], 'uuid'); +select isnt_definer('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean']); +select volatility_is('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean'], 'volatile'); +select function_privs_are('camper', 'add_campsite_type', array ['integer', 'integer', 'text', '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', 'text', 'integer', 'boolean'], 'employee', array[]::text[]); +select function_privs_are('camper', 'add_campsite_type', array ['integer', 'integer', 'text', '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', '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', '', '

Features

', '', '

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

', '', '

Pricing

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

One

Two

', '', '

Pricing

', '', '

More

', 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, 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) + $$ select company_id, media_id, name, spiel::text, info::text, facilities::text, description::text, additional_info::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

', '', '

More

', true, 2, false) $$, 'Should have added all two campsite type' ); diff --git a/test/campsite_type.sql b/test/campsite_type.sql index aa48991..69bb647 100644 --- a/test/campsite_type.sql +++ b/test/campsite_type.sql @@ -5,7 +5,7 @@ reset client_min_messages; begin; -select plan(82); +select plan(86); set search_path to camper, public; @@ -72,6 +72,12 @@ select col_not_null('campsite_type', 'description'); select col_has_default('campsite_type', 'description'); --select col_default_is('campsite_type', 'description', ''); +select has_column('campsite_type', 'additional_info'); +select col_type_is('campsite_type', 'additional_info', 'xml'); +select col_not_null('campsite_type', 'additional_info'); +select col_has_default('campsite_type', 'additional_info'); +--select col_default_is('campsite_type', 'additional_info', ''); + select has_column('campsite_type', 'max_campers'); select col_type_is('campsite_type', 'max_campers', 'integer'); select col_not_null('campsite_type', 'max_campers'); diff --git a/test/campsite_type_i18n.sql b/test/campsite_type_i18n.sql index f59e2ca..ee5201f 100644 --- a/test/campsite_type_i18n.sql +++ b/test/campsite_type_i18n.sql @@ -5,7 +5,7 @@ reset client_min_messages; begin; -select plan(39); +select plan(43); set search_path to camper, public; @@ -56,6 +56,11 @@ select col_type_is('campsite_type_i18n', 'description', 'xml'); select col_not_null('campsite_type_i18n', 'description'); select col_hasnt_default('campsite_type_i18n', 'description'); +select has_column('campsite_type_i18n', 'additional_info'); +select col_type_is('campsite_type_i18n', 'additional_info', 'xml'); +select col_not_null('campsite_type_i18n', 'additional_info'); +select col_hasnt_default('campsite_type_i18n', 'additional_info'); + select * from finish(); diff --git a/test/edit_campsite_type.sql b/test/edit_campsite_type.sql index f4daac8..385f5ba 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', '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[]); +select has_function('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean']); +select function_lang_is('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'sql'); +select function_returns('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'uuid'); +select isnt_definer('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean']); +select volatility_is('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', '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', 'text', 'integer', 'boolean', 'boolean'], 'guest', array[]::text[]); +select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', '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', 'text', 'integer', 'boolean', 'boolean'], 'admin', array['EXECUTE']); +select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', '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, 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) +insert into campsite_type (company_id, slug, media_id, name, spiel, info, facilities, description, additional_info, max_campers, dogs_allowed, active) +values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', '

1

', '

info 1

', '

facilities A

', '

A

', '

Additional A

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

2

', '

info 2

', '

facilities B

', '

B

', '

Additional B

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

A

', '

Features A

', '

Pricing 1

', '

1

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

A

', '

Features A

', '

Pricing 1

', '

1

', '

Additional 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

', '

Features B

', '

Pricing 2

', '

2

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

B

', '

Features B

', '

Pricing 2

', '

2

', '

Additional 2

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

A

', '

Features A

', '

Pricing 1

', '

1

', '

Additional 1

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

B

', '

Features B

', '

Pricing 2

', '

2

', '

Additional 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 219db8f..8dce5aa 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', '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[]); +select has_function('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text']); +select function_lang_is('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'sql'); +select function_returns('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'void'); +select isnt_definer('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text']); +select volatility_is('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'volatile'); +select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', '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', 'text'], 'employee', array[]::text[]); +select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', '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', '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, 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 (company_id, slug, media_id, name, spiel, info, facilities, description, additional_info, active, dogs_allowed, max_campers) +values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', '

One

', '

Features A

', '

Pricing A

', '

A

', '

Additional A

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

Two

', '

Features B

', '

Pricing B

', '

B

', '

Additional B

', false, true, 5) ; -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 +insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info) +select campsite_type_id, 'ca', 'tipusb', '

dos

', '

característiques b

', '

preus b

', '

B

', '

B addicional

' 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', null, '

Característiques A

', null, '

a

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

Característiques A

', null, '

a

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

Dos

', null, '

Precios B

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

Dos

', null, '

Precios B

', null, '

B adicional

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

Dos

', '

Característiques B

', '

Preus B

', '

2

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

Dos

', '

Característiques B

', '

Preus B

', '

2

', '

2 addicional

') $$, '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.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

', '') + $$ select slug::text, lang_tag, i18n.name, i18n.spiel::text, i18n.info::text, i18n.facilities::text, i18n.description::text, i18n.additional_info::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

', '

2 addicional

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

Dos

', '', '

Precios B

', '', '

B adicional

') $$, 'Should have added and updated all translations.' ); diff --git a/verify/add_campsite_type.sql b/verify/add_campsite_type.sql index 40d9133..df37c7d 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, text, text, integer, boolean)', 'execute'); +select has_function_privilege('camper.add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean)', 'execute'); rollback; diff --git a/verify/add_campsite_type@v0.sql b/verify/add_campsite_type@v0.sql new file mode 100644 index 0000000..40d9133 --- /dev/null +++ b/verify/add_campsite_type@v0.sql @@ -0,0 +1,7 @@ +-- Verify camper:add_campsite_type on pg + +begin; + +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__additional_info.sql b/verify/campsite_type__additional_info.sql new file mode 100644 index 0000000..806d5eb --- /dev/null +++ b/verify/campsite_type__additional_info.sql @@ -0,0 +1,9 @@ +-- Verify camper:campsite_type__additional_info on pg + +begin; + +select additional_info +from camper.campsite_type +where false; + +rollback; diff --git a/verify/campsite_type_i18n__additional_info.sql b/verify/campsite_type_i18n__additional_info.sql new file mode 100644 index 0000000..9f63273 --- /dev/null +++ b/verify/campsite_type_i18n__additional_info.sql @@ -0,0 +1,9 @@ +-- Verify camper:campsite_type_i18n__additional_info on pg + +begin; + +select additional_info +from camper.campsite_type_i18n +where false; + +rollback; diff --git a/verify/edit_campsite_type.sql b/verify/edit_campsite_type.sql index 0c0f89d..35112d0 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, text, text, integer, boolean, boolean)', 'execute'); +select has_function_privilege('camper.edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean)', 'execute'); rollback; diff --git a/verify/edit_campsite_type@v0.sql b/verify/edit_campsite_type@v0.sql new file mode 100644 index 0000000..0c0f89d --- /dev/null +++ b/verify/edit_campsite_type@v0.sql @@ -0,0 +1,7 @@ +-- Verify camper:edit_campsite_type on pg + +begin; + +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 349da25..6c63455 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, text, text)', 'execute'); +select has_function_privilege('camper.translate_campsite_type(uuid, text, text, text, text, text, text, text)', 'execute'); rollback; diff --git a/verify/translate_campsite_type@v0.sql b/verify/translate_campsite_type@v0.sql new file mode 100644 index 0000000..349da25 --- /dev/null +++ b/verify/translate_campsite_type@v0.sql @@ -0,0 +1,7 @@ +-- Verify camper:translate_campsite_type on pg + +begin; + +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 1a43886..96dceef 100644 --- a/web/templates/admin/campsite/type/form.gohtml +++ b/web/templates/admin/campsite/type/form.gohtml @@ -151,6 +151,19 @@ {{ template "error-message" . }} {{- end }} + {{ with .AdditionalInfo -}} +
+ {{( pgettext "Additional Information" "input" )}}
+ {{ template "lang-selector" . }} + {{ range $lang, $input := . -}} + + {{- end }} + {{ template "error-message" . }} +
+ {{- end }}