Add check_in and check_out fields to campsite_type

Apparently, each campsite type could have different check-in and
check-out times, thus i need them in the database.

I thought about using an integer or a datetime field, but customer seems
to want a text field to maybe add “before” and “after” there as well.
Translatable text it is.
This commit is contained in:
jordi fita mas 2024-01-22 20:19:19 +01:00
parent 4138eda5cb
commit 1f2ab494dd
39 changed files with 620 additions and 231 deletions

View File

@ -121,23 +121,23 @@ select translate_services_carousel_slide(63, 'en', 'Safari Tents');
select translate_services_carousel_slide(63, 'es', 'Tiendas Safari'); select translate_services_carousel_slide(63, 'es', 'Tiendas Safari');
alter table campsite_type alter column campsite_type_id restart with 72; alter table campsite_type alter column campsite_type_id restart with 72;
select add_campsite_type(52, 62, 'Parceŀles', '<h3>Acampa enmig de la natura</h3><p>Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.</p><p>Parcel·les amples amb serveis a prop don ets per fer allò que vols.</p>', '<h4>Proxo/terrassa (13 m²)</h4><ul><li>Moblat</li></ul><h4>Planta baixa (32 m²)</h4><ul><li>Sala menjador</li><li>Cuina equipada</li><li>Una habitació llit doble (150×200)</li><li>Bany complet</li></ul><h4>Planta altell (16 m²)</h4><ul><li>Tres llits individuals (90×200)</li></ul>', '<h4>El preu inclou</h4><ul><li>Llençols i nòrdic</li><li>Cistella de benvinguda: oli doliva, sal, sucre, cafè i te</li><li>WiFi</li><li>Plaça daparcament per un cotxe</li><li>Kit nadó (bressol, trona i banyera) <em>sota reserva</em></li></ul><p>* Tovalloles: preu extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', 6, true); select add_campsite_type(52, 62, 'Parceŀles', '<h3>Acampa enmig de la natura</h3><p>Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.</p><p>Parcel·les amples amb serveis a prop don ets per fer allò que vols.</p>', '<h4>Proxo/terrassa (13 m²)</h4><ul><li>Moblat</li></ul><h4>Planta baixa (32 m²)</h4><ul><li>Sala menjador</li><li>Cuina equipada</li><li>Una habitació llit doble (150×200)</li><li>Bany complet</li></ul><h4>Planta altell (16 m²)</h4><ul><li>Tres llits individuals (90×200)</li></ul>', '<h4>El preu inclou</h4><ul><li>Llençols i nòrdic</li><li>Cistella de benvinguda: oli doliva, sal, sucre, cafè i te</li><li>WiFi</li><li>Plaça daparcament per un cotxe</li><li>Kit nadó (bressol, trona i banyera) <em>sota reserva</em></li></ul><p>* Tovalloles: preu extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '15 h a 21 h', '12 h', 6, true);
select add_campsite_type(52, 63, 'Safari Tents', '<h3>Glàmping a la teva disposició</h3><p>Un luxe de tendes per viure aventures.</p><p>Dues tendes amb terra de fusta, llits, cuina i tot de comoditats per gaudir de les teves vacances.</p>', '<h4>Proxo/terrassa (13 m²)</h4><ul><li>Moblat</li></ul><h4>Planta baixa (32 m²)</h4><ul><li>Sala menjador</li><li>Cuina equipada</li><li>Una habitació llit doble (150×200)</li><li>Bany complet</li></ul><h4>Planta altell (16 m²)</h4><ul><li>Tres llits individuals (90×200)</li></ul>', '<h4>El preu inclou</h4><ul><li>Llençols i nòrdic</li><li>Cistella de benvinguda: oli doliva, sal, sucre, cafè i te</li><li>WiFi</li><li>Plaça daparcament per un cotxe</li><li>Kit nadó (bressol, trona i banyera) <em>sota reserva</em></li></ul><p>* Tovalloles: preu extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', 6, false); select add_campsite_type(52, 63, 'Safari Tents', '<h3>Glàmping a la teva disposició</h3><p>Un luxe de tendes per viure aventures.</p><p>Dues tendes amb terra de fusta, llits, cuina i tot de comoditats per gaudir de les teves vacances.</p>', '<h4>Proxo/terrassa (13 m²)</h4><ul><li>Moblat</li></ul><h4>Planta baixa (32 m²)</h4><ul><li>Sala menjador</li><li>Cuina equipada</li><li>Una habitació llit doble (150×200)</li><li>Bany complet</li></ul><h4>Planta altell (16 m²)</h4><ul><li>Tres llits individuals (90×200)</li></ul>', '<h4>El preu inclou</h4><ul><li>Llençols i nòrdic</li><li>Cistella de benvinguda: oli doliva, sal, sucre, cafè i te</li><li>WiFi</li><li>Plaça daparcament per un cotxe</li><li>Kit nadó (bressol, trona i banyera) <em>sota reserva</em></li></ul><p>* Tovalloles: preu extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '16 h a 21 h', '10 h', 6, false);
select add_campsite_type(52, 64, 'Bungalous', '<h3>Allotjaments de luxe</h3><p>Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.</p><p>Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.</p>', '<h4>Proxo/terrassa (13 m²)</h4><ul><li>Moblat</li></ul><h4>Planta baixa (32 m²)</h4><ul><li>Sala menjador</li><li>Cuina equipada</li><li>Una habitació llit doble (150×200)</li><li>Bany complet</li></ul><h4>Planta altell (16 m²)</h4><ul><li>Tres llits individuals (90×200)</li></ul>', '<h4>El preu inclou</h4><ul><li>Llençols i nòrdic</li><li>Cistella de benvinguda: oli doliva, sal, sucre, cafè i te</li><li>WiFi</li><li>Plaça daparcament per un cotxe</li><li>Kit nadó (bressol, trona i banyera) <em>sota reserva</em></li></ul><p>* Tovalloles: preu extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', 5, false); select add_campsite_type(52, 64, 'Bungalous', '<h3>Allotjaments de luxe</h3><p>Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.</p><p>Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.</p>', '<h4>Proxo/terrassa (13 m²)</h4><ul><li>Moblat</li></ul><h4>Planta baixa (32 m²)</h4><ul><li>Sala menjador</li><li>Cuina equipada</li><li>Una habitació llit doble (150×200)</li><li>Bany complet</li></ul><h4>Planta altell (16 m²)</h4><ul><li>Tres llits individuals (90×200)</li></ul>', '<h4>El preu inclou</h4><ul><li>Llençols i nòrdic</li><li>Cistella de benvinguda: oli doliva, sal, sucre, cafè i te</li><li>WiFi</li><li>Plaça daparcament per un cotxe</li><li>Kit nadó (bressol, trona i banyera) <em>sota reserva</em></li></ul><p>* Tovalloles: preu extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '15 h a 21 h', '12 h', 5, false);
select add_campsite_type(52, 65, 'Bungalous prèmium', '<h3>Allotjaments de luxe</h3><p>Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.</p><p>Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.</p>', '<h4>Proxo/terrassa (13 m²)</h4><ul><li>Moblat</li></ul><h4>Planta baixa (32 m²)</h4><ul><li>Sala menjador</li><li>Cuina equipada</li><li>Una habitació llit doble (150×200)</li><li>Bany complet</li></ul><h4>Planta altell (16 m²)</h4><ul><li>Tres llits individuals (90×200)</li></ul>', '<h4>El preu inclou</h4><ul><li>Llençols i nòrdic</li><li>Cistella de benvinguda: oli doliva, sal, sucre, cafè i te</li><li>WiFi</li><li>Plaça daparcament per un cotxe</li><li>Kit nadó (bressol, trona i banyera) <em>sota reserva</em></li></ul><p>* Tovalloles: preu extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', 5, false); select add_campsite_type(52, 65, 'Bungalous prèmium', '<h3>Allotjaments de luxe</h3><p>Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.</p><p>Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.</p>', '<h4>Proxo/terrassa (13 m²)</h4><ul><li>Moblat</li></ul><h4>Planta baixa (32 m²)</h4><ul><li>Sala menjador</li><li>Cuina equipada</li><li>Una habitació llit doble (150×200)</li><li>Bany complet</li></ul><h4>Planta altell (16 m²)</h4><ul><li>Tres llits individuals (90×200)</li></ul>', '<h4>El preu inclou</h4><ul><li>Llençols i nòrdic</li><li>Cistella de benvinguda: oli doliva, sal, sucre, cafè i te</li><li>WiFi</li><li>Plaça daparcament per un cotxe</li><li>Kit nadó (bressol, trona i banyera) <em>sota reserva</em></li></ul><p>* Tovalloles: preu extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '15 h a 21 h', '12 h', 5, false);
select add_campsite_type(52, 66, 'Cabanes de fusta', '<h3>Allotjaments de luxe</h3><p>Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.</p><p>Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.</p>', '<h4>Proxo/terrassa (13 m²)</h4><ul><li>Moblat</li></ul><h4>Planta baixa (32 m²)</h4><ul><li>Sala menjador</li><li>Cuina equipada</li><li>Una habitació llit doble (150×200)</li><li>Bany complet</li></ul><h4>Planta altell (16 m²)</h4><ul><li>Tres llits individuals (90×200)</li></ul>', '<h4>El preu inclou</h4><ul><li>Llençols i nòrdic</li><li>Cistella de benvinguda: oli doliva, sal, sucre, cafè i te</li><li>WiFi</li><li>Plaça daparcament per un cotxe</li><li>Kit nadó (bressol, trona i banyera) <em>sota reserva</em></li></ul><p>* Tovalloles: preu extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', 5, false); select add_campsite_type(52, 66, 'Cabanes de fusta', '<h3>Allotjaments de luxe</h3><p>Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.</p><p>Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.</p>', '<h4>Proxo/terrassa (13 m²)</h4><ul><li>Moblat</li></ul><h4>Planta baixa (32 m²)</h4><ul><li>Sala menjador</li><li>Cuina equipada</li><li>Una habitació llit doble (150×200)</li><li>Bany complet</li></ul><h4>Planta altell (16 m²)</h4><ul><li>Tres llits individuals (90×200)</li></ul>', '<h4>El preu inclou</h4><ul><li>Llençols i nòrdic</li><li>Cistella de benvinguda: oli doliva, sal, sucre, cafè i te</li><li>WiFi</li><li>Plaça daparcament per un cotxe</li><li>Kit nadó (bressol, trona i banyera) <em>sota reserva</em></li></ul><p>* Tovalloles: preu extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '15 h a 21 h', '12 h', 5, false);
insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info) insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info, check_in, check_out)
values (72, 'en', 'Plots', '<h3>Camp in the middle of nature</h3><p>Located on the campgrounds mountain-side and overlooking the nature that surrounds us.</p><p>Large plots with serivces close to where you are to do what you want.</p>', '<h4>Porch/terrace (13 m²)</h4><ul><li>Furnished</li></ul><h4>First floor (32 m²)</h4><ul><li>Dining room</li><li>Equipped kitchen</li><li>One room with a double bed (150×200)</li><li>Full bathroom</li></ul><h4>Loft floor (16 m²)</h4><ul><li>Three individual beds (90×200)</li></ul>', '<h4>Price includes</h4><ul><li>Sheets and duvet</li><li>Welcome basket: olive oil, salt, sugar, coffee, and tea</li><li>WiFi</li><li>Parking space for one car</li><li>Baby Kit (bassinet, high chair, and bathtub) <em>reservation required</em></li></ul><p>* Towels: extra cost</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '') values (72, 'en', 'Plots', '<h3>Camp in the middle of nature</h3><p>Located on the campgrounds mountain-side and overlooking the nature that surrounds us.</p><p>Large plots with serivces close to where you are to do what you want.</p>', '<h4>Porch/terrace (13 m²)</h4><ul><li>Furnished</li></ul><h4>First floor (32 m²)</h4><ul><li>Dining room</li><li>Equipped kitchen</li><li>One room with a double bed (150×200)</li><li>Full bathroom</li></ul><h4>Loft floor (16 m²)</h4><ul><li>Three individual beds (90×200)</li></ul>', '<h4>Price includes</h4><ul><li>Sheets and duvet</li><li>Welcome basket: olive oil, salt, sugar, coffee, and tea</li><li>WiFi</li><li>Parking space for one car</li><li>Baby Kit (bassinet, high chair, and bathtub) <em>reservation required</em></li></ul><p>* Towels: extra cost</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '3 p.m. to 9 p.m.', '12 a.m.')
, (72, 'es', 'Parcelas', '<h3>Acampa enmedio de la naturaleza</h3><p>Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.</p><p>Parcelas amplias con servicios cerca de donde eres para hacer aquello que quieres.</p>', '<h4>Proche/terraza (13 m²)</h4><ul><li>Moblado</li></ul><h4>Planta baja (32 m²)</h4><ul><li>Sala comedor</li><li>Cocina equipada</li><li>Una habitación cama doble (150×200)</li><li>Baño completo</li></ul><h4>Planta altillo (16 m²)</h4><ul><li>Tres camas individuales (90×200)</li></ul>', '<h4>El precio incluye</h4><ul><li>Sábanas y nórdico</li><li>Cesto de bienvenida: aceite de oliva, sal, azúcar, café y té</li><li>WiFi</li><li>Plaza de aparcamiento para un coche</li><li>Kit bebé (cuna, trona y bañera) <em>bajo reserva</em></li></ul><p>* Toallas: precio extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '') , (72, 'es', 'Parcelas', '<h3>Acampa enmedio de la naturaleza</h3><p>Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.</p><p>Parcelas amplias con servicios cerca de donde eres para hacer aquello que quieres.</p>', '<h4>Proche/terraza (13 m²)</h4><ul><li>Moblado</li></ul><h4>Planta baja (32 m²)</h4><ul><li>Sala comedor</li><li>Cocina equipada</li><li>Una habitación cama doble (150×200)</li><li>Baño completo</li></ul><h4>Planta altillo (16 m²)</h4><ul><li>Tres camas individuales (90×200)</li></ul>', '<h4>El precio incluye</h4><ul><li>Sábanas y nórdico</li><li>Cesto de bienvenida: aceite de oliva, sal, azúcar, café y té</li><li>WiFi</li><li>Plaza de aparcamiento para un coche</li><li>Kit bebé (cuna, trona y bañera) <em>bajo reserva</em></li></ul><p>* Toallas: precio extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '15 h a 21 h', '12 h')
, (73, 'en', 'Safari Tents', '<h3>Glamping at your disposal</h3><p>A luxury of tent for unforgettable adventures.</p><p>Two tents with wooden floors, beds, kitchen, and all the amenities to enjoy your vacation.</p>', '<h4>Porch/terrace (13 m²)</h4><ul><li>Furnished</li></ul><h4>First floor (32 m²)</h4><ul><li>Dining room</li><li>Equipped kitchen</li><li>One room with a double bed (150×200)</li><li>Full bathroom</li></ul><h4>Loft floor (16 m²)</h4><ul><li>Three individual beds (90×200)</li></ul>', '<h4>Price includes</h4><ul><li>Sheets and duvet</li><li>Welcome basket: olive oil, salt, sugar, coffee, and tea</li><li>WiFi</li><li>Parking space for one car</li><li>Baby Kit (bassinet, high chair, and bathtub) <em>reservation required</em></li></ul><p>* Towels: extra cost</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '') , (73, 'en', 'Safari Tents', '<h3>Glamping at your disposal</h3><p>A luxury of tent for unforgettable adventures.</p><p>Two tents with wooden floors, beds, kitchen, and all the amenities to enjoy your vacation.</p>', '<h4>Porch/terrace (13 m²)</h4><ul><li>Furnished</li></ul><h4>First floor (32 m²)</h4><ul><li>Dining room</li><li>Equipped kitchen</li><li>One room with a double bed (150×200)</li><li>Full bathroom</li></ul><h4>Loft floor (16 m²)</h4><ul><li>Three individual beds (90×200)</li></ul>', '<h4>Price includes</h4><ul><li>Sheets and duvet</li><li>Welcome basket: olive oil, salt, sugar, coffee, and tea</li><li>WiFi</li><li>Parking space for one car</li><li>Baby Kit (bassinet, high chair, and bathtub) <em>reservation required</em></li></ul><p>* Towels: extra cost</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '4 p.m. to 9 p.m.', '12 a.m.')
, (73, 'es', 'Tiendas Safari', '<h3>Glamping a tu disposición</h3><p>Un lujo de tiendas para vivir aventuras.</p><p>Dos tiendas con suelo de madera, camas, cocina y todo de comodidades para disfrutar de tus vacanciones.</p>', '<h4>Proche/terraza (13 m²)</h4><ul><li>Moblado</li></ul><h4>Planta baja (32 m²)</h4><ul><li>Sala comedor</li><li>Cocina equipada</li><li>Una habitación cama doble (150×200)</li><li>Baño completo</li></ul><h4>Planta altillo (16 m²)</h4><ul><li>Tres camas individuales (90×200)</li></ul>', '<h4>El precio incluye</h4><ul><li>Sábanas y nórdico</li><li>Cesto de bienvenida: aceite de oliva, sal, azúcar, café y té</li><li>WiFi</li><li>Plaza de aparcamiento para un coche</li><li>Kit bebé (cuna, trona y bañera) <em>bajo reserva</em></li></ul><p>* Toallas: precio extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '') , (73, 'es', 'Tiendas Safari', '<h3>Glamping a tu disposición</h3><p>Un lujo de tiendas para vivir aventuras.</p><p>Dos tiendas con suelo de madera, camas, cocina y todo de comodidades para disfrutar de tus vacanciones.</p>', '<h4>Proche/terraza (13 m²)</h4><ul><li>Moblado</li></ul><h4>Planta baja (32 m²)</h4><ul><li>Sala comedor</li><li>Cocina equipada</li><li>Una habitación cama doble (150×200)</li><li>Baño completo</li></ul><h4>Planta altillo (16 m²)</h4><ul><li>Tres camas individuales (90×200)</li></ul>', '<h4>El precio incluye</h4><ul><li>Sábanas y nórdico</li><li>Cesto de bienvenida: aceite de oliva, sal, azúcar, café y té</li><li>WiFi</li><li>Plaza de aparcamiento para un coche</li><li>Kit bebé (cuna, trona y bañera) <em>bajo reserva</em></li></ul><p>* Toallas: precio extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '16 h a 21 h', '12 h')
, (74, 'en', 'Bungalows', '<h3>Luxury accomomdations</h3><p>Located on the campgrounds mountain-side and overlooking the nature that surrounds us.</p><p>Two two-story solid wood cabins with a covered porch to enjoy among the trees.</p>', '<h4>Porch/terrace (13 m²)</h4><ul><li>Furnished</li></ul><h4>First floor (32 m²)</h4><ul><li>Dining room</li><li>Equipped kitchen</li><li>One room with a double bed (150×200)</li><li>Full bathroom</li></ul><h4>Loft floor (16 m²)</h4><ul><li>Three individual beds (90×200)</li></ul>', '<h4>Price includes</h4><ul><li>Sheets and duvet</li><li>Welcome basket: olive oil, salt, sugar, coffee, and tea</li><li>WiFi</li><li>Parking space for one car</li><li>Baby Kit (bassinet, high chair, and bathtub) <em>reservation required</em></li></ul><p>* Towels: extra cost</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '') , (74, 'en', 'Bungalows', '<h3>Luxury accomomdations</h3><p>Located on the campgrounds mountain-side and overlooking the nature that surrounds us.</p><p>Two two-story solid wood cabins with a covered porch to enjoy among the trees.</p>', '<h4>Porch/terrace (13 m²)</h4><ul><li>Furnished</li></ul><h4>First floor (32 m²)</h4><ul><li>Dining room</li><li>Equipped kitchen</li><li>One room with a double bed (150×200)</li><li>Full bathroom</li></ul><h4>Loft floor (16 m²)</h4><ul><li>Three individual beds (90×200)</li></ul>', '<h4>Price includes</h4><ul><li>Sheets and duvet</li><li>Welcome basket: olive oil, salt, sugar, coffee, and tea</li><li>WiFi</li><li>Parking space for one car</li><li>Baby Kit (bassinet, high chair, and bathtub) <em>reservation required</em></li></ul><p>* Towels: extra cost</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '3 p.m. to 9 p.m.', '12 a.m.')
, (74, 'es', 'Bungalós', '<h3>Alojamientos de lujo</h3><p>Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.</p><p>Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.</p>', '<h4>Proche/terraza (13 m²)</h4><ul><li>Moblado</li></ul><h4>Planta baja (32 m²)</h4><ul><li>Sala comedor</li><li>Cocina equipada</li><li>Una habitación cama doble (150×200)</li><li>Baño completo</li></ul><h4>Planta altillo (16 m²)</h4><ul><li>Tres camas individuales (90×200)</li></ul>', '<h4>El precio incluye</h4><ul><li>Sábanas y nórdico</li><li>Cesto de bienvenida: aceite de oliva, sal, azúcar, café y té</li><li>WiFi</li><li>Plaza de aparcamiento para un coche</li><li>Kit bebé (cuna, trona y bañera) <em>bajo reserva</em></li></ul><p>* Toallas: precio extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '') , (74, 'es', 'Bungalós', '<h3>Alojamientos de lujo</h3><p>Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.</p><p>Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.</p>', '<h4>Proche/terraza (13 m²)</h4><ul><li>Moblado</li></ul><h4>Planta baja (32 m²)</h4><ul><li>Sala comedor</li><li>Cocina equipada</li><li>Una habitación cama doble (150×200)</li><li>Baño completo</li></ul><h4>Planta altillo (16 m²)</h4><ul><li>Tres camas individuales (90×200)</li></ul>', '<h4>El precio incluye</h4><ul><li>Sábanas y nórdico</li><li>Cesto de bienvenida: aceite de oliva, sal, azúcar, café y té</li><li>WiFi</li><li>Plaza de aparcamiento para un coche</li><li>Kit bebé (cuna, trona y bañera) <em>bajo reserva</em></li></ul><p>* Toallas: precio extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '15 h a 21 h', '12 h')
, (75, 'en', 'Bungalows premium', '<h3>Luxury accomomdations</h3><p>Located on the campgrounds mountain-side and overlooking the nature that surrounds us.</p><p>Two two-story solid wood cabins with a covered porch to enjoy among the trees.</p>', '<h4>Porch/terrace (13 m²)</h4><ul><li>Furnished</li></ul><h4>First floor (32 m²)</h4><ul><li>Dining room</li><li>Equipped kitchen</li><li>One room with a double bed (150×200)</li><li>Full bathroom</li></ul><h4>Loft floor (16 m²)</h4><ul><li>Three individual beds (90×200)</li></ul>', '<h4>Price includes</h4><ul><li>Sheets and duvet</li><li>Welcome basket: olive oil, salt, sugar, coffee, and tea</li><li>WiFi</li><li>Parking space for one car</li><li>Baby Kit (bassinet, high chair, and bathtub) <em>reservation required</em></li></ul><p>* Towels: extra cost</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '') , (75, 'en', 'Bungalows premium', '<h3>Luxury accomomdations</h3><p>Located on the campgrounds mountain-side and overlooking the nature that surrounds us.</p><p>Two two-story solid wood cabins with a covered porch to enjoy among the trees.</p>', '<h4>Porch/terrace (13 m²)</h4><ul><li>Furnished</li></ul><h4>First floor (32 m²)</h4><ul><li>Dining room</li><li>Equipped kitchen</li><li>One room with a double bed (150×200)</li><li>Full bathroom</li></ul><h4>Loft floor (16 m²)</h4><ul><li>Three individual beds (90×200)</li></ul>', '<h4>Price includes</h4><ul><li>Sheets and duvet</li><li>Welcome basket: olive oil, salt, sugar, coffee, and tea</li><li>WiFi</li><li>Parking space for one car</li><li>Baby Kit (bassinet, high chair, and bathtub) <em>reservation required</em></li></ul><p>* Towels: extra cost</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '3 p.m. to 9 p.m.', '12 a.m.')
, (75, 'es', 'Bungalós prémium', '<h3>Alojamientos de lujo</h3><p>Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.</p><p>Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.</p>', '<h4>Proche/terraza (13 m²)</h4><ul><li>Moblado</li></ul><h4>Planta baja (32 m²)</h4><ul><li>Sala comedor</li><li>Cocina equipada</li><li>Una habitación cama doble (150×200)</li><li>Baño completo</li></ul><h4>Planta altillo (16 m²)</h4><ul><li>Tres camas individuales (90×200)</li></ul>', '<h4>El precio incluye</h4><ul><li>Sábanas y nórdico</li><li>Cesto de bienvenida: aceite de oliva, sal, azúcar, café y té</li><li>WiFi</li><li>Plaza de aparcamiento para un coche</li><li>Kit bebé (cuna, trona y bañera) <em>bajo reserva</em></li></ul><p>* Toallas: precio extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '') , (75, 'es', 'Bungalós prémium', '<h3>Alojamientos de lujo</h3><p>Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.</p><p>Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.</p>', '<h4>Proche/terraza (13 m²)</h4><ul><li>Moblado</li></ul><h4>Planta baja (32 m²)</h4><ul><li>Sala comedor</li><li>Cocina equipada</li><li>Una habitación cama doble (150×200)</li><li>Baño completo</li></ul><h4>Planta altillo (16 m²)</h4><ul><li>Tres camas individuales (90×200)</li></ul>', '<h4>El precio incluye</h4><ul><li>Sábanas y nórdico</li><li>Cesto de bienvenida: aceite de oliva, sal, azúcar, café y té</li><li>WiFi</li><li>Plaza de aparcamiento para un coche</li><li>Kit bebé (cuna, trona y bañera) <em>bajo reserva</em></li></ul><p>* Toallas: precio extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '15 h a 21 h', '12 h')
, (76, 'en', 'Wooden Lodges', '<h3>Luxury accomomdations</h3><p>Located on the campgrounds mountain-side and overlooking the nature that surrounds us.</p><p>Two two-story solid wood cabins with a covered porch to enjoy among the trees.</p>', '<h4>Porch/terrace (13 m²)</h4><ul><li>Furnished</li></ul><h4>First floor (32 m²)</h4><ul><li>Dining room</li><li>Equipped kitchen</li><li>One room with a double bed (150×200)</li><li>Full bathroom</li></ul><h4>Loft floor (16 m²)</h4><ul><li>Three individual beds (90×200)</li></ul>', '<h4>Price includes</h4><ul><li>Sheets and duvet</li><li>Welcome basket: olive oil, salt, sugar, coffee, and tea</li><li>WiFi</li><li>Parking space for one car</li><li>Baby Kit (bassinet, high chair, and bathtub) <em>reservation required</em></li></ul><p>* Towels: extra cost</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '') , (76, 'en', 'Wooden Lodges', '<h3>Luxury accomomdations</h3><p>Located on the campgrounds mountain-side and overlooking the nature that surrounds us.</p><p>Two two-story solid wood cabins with a covered porch to enjoy among the trees.</p>', '<h4>Porch/terrace (13 m²)</h4><ul><li>Furnished</li></ul><h4>First floor (32 m²)</h4><ul><li>Dining room</li><li>Equipped kitchen</li><li>One room with a double bed (150×200)</li><li>Full bathroom</li></ul><h4>Loft floor (16 m²)</h4><ul><li>Three individual beds (90×200)</li></ul>', '<h4>Price includes</h4><ul><li>Sheets and duvet</li><li>Welcome basket: olive oil, salt, sugar, coffee, and tea</li><li>WiFi</li><li>Parking space for one car</li><li>Baby Kit (bassinet, high chair, and bathtub) <em>reservation required</em></li></ul><p>* Towels: extra cost</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '3 p.m. to 9 p.m.', '12 a.m.')
, (76, 'es', 'Cabañas de madera', '<h3>Alojamientos de lujo</h3><p>Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.</p><p>Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.</p>', '<h4>Proche/terraza (13 m²)</h4><ul><li>Moblado</li></ul><h4>Planta baja (32 m²)</h4><ul><li>Sala comedor</li><li>Cocina equipada</li><li>Una habitación cama doble (150×200)</li><li>Baño completo</li></ul><h4>Planta altillo (16 m²)</h4><ul><li>Tres camas individuales (90×200)</li></ul>', '<h4>El precio incluye</h4><ul><li>Sábanas y nórdico</li><li>Cesto de bienvenida: aceite de oliva, sal, azúcar, café y té</li><li>WiFi</li><li>Plaza de aparcamiento para un coche</li><li>Kit bebé (cuna, trona y bañera) <em>bajo reserva</em></li></ul><p>* Toallas: precio extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '') , (76, 'es', 'Cabañas de madera', '<h3>Alojamientos de lujo</h3><p>Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.</p><p>Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.</p>', '<h4>Proche/terraza (13 m²)</h4><ul><li>Moblado</li></ul><h4>Planta baja (32 m²)</h4><ul><li>Sala comedor</li><li>Cocina equipada</li><li>Una habitación cama doble (150×200)</li><li>Baño completo</li></ul><h4>Planta altillo (16 m²)</h4><ul><li>Tres camas individuales (90×200)</li></ul>', '<h4>El precio incluye</h4><ul><li>Sábanas y nórdico</li><li>Cesto de bienvenida: aceite de oliva, sal, azúcar, café y té</li><li>WiFi</li><li>Plaza de aparcamiento para un coche</li><li>Kit bebé (cuna, trona y bañera) <em>bajo reserva</em></li></ul><p>* Toallas: precio extra</p>', '<p>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.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p><p>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.</p>', '', '15 h a 21 h', '12 h')
; ;
alter table campsite_type_feature alter column campsite_type_feature_id restart with 82; alter table campsite_type_feature alter column campsite_type_feature_id restart with 82;

View File

@ -8,18 +8,18 @@ begin;
set search_path to camper, public; set search_path to camper, public;
drop function if exists add_campsite_type(integer, integer, text, text, text, text, text, integer, boolean); 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, additional_info text, max_campers integer, dogs_allowed boolean) returns uuid as create or replace function add_campsite_type(company integer, media_id integer, name text, spiel text, info text, facilities text, description text, additional_info text, check_in text, check_out text, max_campers integer, dogs_allowed boolean) returns uuid as
$$ $$
insert into campsite_type (company_id, media_id, name, spiel, info, facilities, description, additional_info, max_campers, dogs_allowed) insert into campsite_type (company_id, media_id, name, spiel, info, facilities, description, additional_info, check_in, check_out, 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) values (company, media_id, name, xmlparse(content spiel), xmlparse(content info), xmlparse(content facilities), xmlparse(content description), xmlparse(content additional_info), check_in, check_out, max_campers, dogs_allowed)
returning slug; returning slug;
$$ $$
language sql language sql
; ;
revoke execute on function add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean) from public; revoke execute on function add_campsite_type(integer, integer, text, text, 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; grant execute on function add_campsite_type(integer, integer, text, text, text, text, text, text, text, text, integer, boolean) to admin;
commit; commit;

View File

@ -0,0 +1,25 @@
-- Deploy camper:add_campsite_type to pg
-- requires: roles
-- requires: schema_camper
-- requires: campsite_type
-- requires: company
begin;
set search_path to camper, public;
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, 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, 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;

View File

@ -0,0 +1,11 @@
-- Deploy camper:campsite_type__check_in_out to pg
-- requires: campsite_type
begin;
alter table camper.campsite_type
add column check_in text not null default ''
, add column check_out text not null default ''
;
commit;

View File

@ -0,0 +1,16 @@
-- Deploy camper:campsite_type_i18n__check_in_out to pg
-- requires: campsite_type_i18n
begin;
alter table camper.campsite_type_i18n
add column check_in text not null default ''
, add column check_out text not null default ''
;
alter table camper.campsite_type_i18n
alter column check_in drop default
, alter column check_out drop default
;
commit;

View File

@ -8,9 +8,9 @@ begin;
set search_path to camper, public; set search_path to camper, public;
drop function if exists edit_campsite_type(uuid, integer, text, text, text, text, text, integer, boolean, boolean); 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, additional_info text, max_campers integer, dogs_allowed boolean, active boolean) returns uuid as create or replace function edit_campsite_type(slug uuid, media_id integer, name text, spiel text, info text, facilities text, description text, additional_info text, check_in text, check_out text, max_campers integer, dogs_allowed boolean, active boolean) returns uuid as
$$ $$
update campsite_type update campsite_type
set name = edit_campsite_type.name set name = edit_campsite_type.name
@ -18,6 +18,8 @@ $$
, description = xmlparse(content edit_campsite_type.description) , description = xmlparse(content edit_campsite_type.description)
, info = xmlparse(content edit_campsite_type.info) , info = xmlparse(content edit_campsite_type.info)
, additional_info = xmlparse(content edit_campsite_type.additional_info) , additional_info = xmlparse(content edit_campsite_type.additional_info)
, check_in = edit_campsite_type.check_in
, check_out = edit_campsite_type.check_out
, facilities = xmlparse(content edit_campsite_type.facilities) , facilities = xmlparse(content edit_campsite_type.facilities)
, media_id = coalesce(edit_campsite_type.media_id, campsite_type.media_id) , media_id = coalesce(edit_campsite_type.media_id, campsite_type.media_id)
, max_campers = edit_campsite_type.max_campers , max_campers = edit_campsite_type.max_campers
@ -29,7 +31,7 @@ $$
language sql language sql
; ;
revoke execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean) from public; revoke execute on function edit_campsite_type(uuid, integer, text, text, 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; grant execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, text, text, text, integer, boolean, boolean) to admin;
commit; commit;

View File

@ -0,0 +1,35 @@
-- Deploy camper:edit_campsite_type to pg
-- requires: roles
-- requires: schema_camper
-- requires: campsite_type
-- requires: company
begin;
set search_path to camper, public;
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
, 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, 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;

View File

@ -7,12 +7,12 @@ begin;
set search_path to camper, public; set search_path to camper, public;
drop function if exists translate_campsite_type (uuid, text, text, text, text, text, text); 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, additional_info text) returns void as create or replace function translate_campsite_type (slug uuid, lang_tag text, name text, spiel text, info text, facilities text, description text, additional_info text, check_in text, check_out text) returns void as
$$ $$
insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info) insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info, check_in, check_out)
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, '')) 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, '')), coalesce(translate_campsite_type.check_in, ''), coalesce(translate_campsite_type.check_out, '')
from campsite_type from campsite_type
where slug = translate_campsite_type.slug where slug = translate_campsite_type.slug
on conflict (campsite_type_id, lang_tag) do update on conflict (campsite_type_id, lang_tag) do update
@ -22,11 +22,13 @@ $$
, facilities = excluded.facilities , facilities = excluded.facilities
, description = excluded.description , description = excluded.description
, additional_info = excluded.additional_info , additional_info = excluded.additional_info
, check_in = excluded.check_in
, check_out = excluded.check_out
$$ $$
language sql language sql
; ;
revoke execute on function translate_campsite_type (uuid, text, text, text, text, text, text, text) from public; revoke execute on function translate_campsite_type (uuid, text, text, 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; grant execute on function translate_campsite_type(uuid, text, text, text, text, text, text, text, text, text) to admin;
commit; commit;

View File

@ -0,0 +1,32 @@
-- Deploy camper:translate_campsite_type to pg
-- requires: roles
-- requires: schema_camper
-- requires: campsite_type_i18n
begin;
set search_path to camper, public;
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, 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
set name = excluded.name
, spiel = excluded.spiel
, 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, text) from public;
grant execute on function translate_campsite_type(uuid, text, text, text, text, text, text, text) to admin;
commit;

View File

@ -167,7 +167,7 @@ func addType(w http.ResponseWriter, r *http.Request, user *auth.User, company *a
} }
processTypeForm(w, r, user, company, conn, f, func(ctx context.Context, tx *database.Tx) error { processTypeForm(w, r, user, company, conn, f, func(ctx context.Context, tx *database.Tx) error {
var err error 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) 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.CheckIn[f.DefaultLang].Val, f.CheckOut[f.DefaultLang].Val, f.MaxCampers.Int(), f.DogsAllowed.Checked)
if err != nil { if err != nil {
return err return err
} }
@ -184,7 +184,7 @@ func translateTypes(ctx context.Context, tx *database.Tx, company *auth.Company,
if l == f.DefaultLang { if l == f.DefaultLang {
continue 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, f.AdditionalInfo[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, f.CheckIn[l].Val, f.CheckOut[l].Val); err != nil {
return err return err
} }
} }
@ -202,7 +202,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) { 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 { 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.AdditionalInfo[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.CheckIn[f.DefaultLang].Val, f.CheckOut[f.DefaultLang].Val, f.MaxCampers.Int(), f.DogsAllowed.Checked, f.Active.Checked); err != nil {
return err return err
} }
if err := translateTypes(ctx, tx, company, f); err != nil { if err := translateTypes(ctx, tx, company, f); err != nil {
@ -282,6 +282,8 @@ type typeForm struct {
Facilities form.I18nInput Facilities form.I18nInput
Description form.I18nInput Description form.I18nInput
AdditionalInfo form.I18nInput AdditionalInfo form.I18nInput
CheckIn form.I18nInput
CheckOut form.I18nInput
Prices map[int]*typePriceForm Prices map[int]*typePriceForm
} }
@ -317,6 +319,8 @@ func newTypeForm(ctx context.Context, company *auth.Company, conn *database.Conn
Facilities: form.NewI18nInput(company.Locales, "facilities"), Facilities: form.NewI18nInput(company.Locales, "facilities"),
Description: form.NewI18nInput(company.Locales, "description"), Description: form.NewI18nInput(company.Locales, "description"),
AdditionalInfo: form.NewI18nInput(company.Locales, "additional_info"), AdditionalInfo: form.NewI18nInput(company.Locales, "additional_info"),
CheckIn: form.NewI18nInput(company.Locales, "check_in"),
CheckOut: form.NewI18nInput(company.Locales, "check_out"),
} }
rows, err := conn.Query(ctx, "select season_id, name from season where active and company_id = $1", company.ID) rows, err := conn.Query(ctx, "select season_id, name from season where active and company_id = $1", company.ID)
@ -356,6 +360,8 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl
var facilities database.RecordArray var facilities database.RecordArray
var description database.RecordArray var description database.RecordArray
var additionalInfo database.RecordArray var additionalInfo database.RecordArray
var checkIn database.RecordArray
var checkOut database.RecordArray
row := conn.QueryRow(ctx, ` row := conn.QueryRow(ctx, `
select campsite_type.name select campsite_type.name
, campsite_type.spiel::text , campsite_type.spiel::text
@ -363,6 +369,8 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl
, campsite_type.facilities::text , campsite_type.facilities::text
, campsite_type.description::text , campsite_type.description::text
, campsite_type.additional_info::text , campsite_type.additional_info::text
, campsite_type.check_in::text
, campsite_type.check_out::text
, media_id::text , media_id::text
, max_campers::text , max_campers::text
, dogs_allowed , dogs_allowed
@ -373,6 +381,8 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl
, array_agg((lang_tag, i18n.facilities::text)) , array_agg((lang_tag, i18n.facilities::text))
, array_agg((lang_tag, i18n.description::text)) , array_agg((lang_tag, i18n.description::text))
, array_agg((lang_tag, i18n.additional_info::text)) , array_agg((lang_tag, i18n.additional_info::text))
, array_agg((lang_tag, i18n.check_in))
, array_agg((lang_tag, i18n.check_out))
from campsite_type from campsite_type
left join campsite_type_i18n as i18n using (campsite_type_id) left join campsite_type_i18n as i18n using (campsite_type_id)
where slug = $1 where slug = $1
@ -382,12 +392,14 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl
, campsite_type.facilities::text , campsite_type.facilities::text
, campsite_type.description::text , campsite_type.description::text
, campsite_type.additional_info::text , campsite_type.additional_info::text
, campsite_type.check_in
, campsite_type.check_out
, media_id::text , media_id::text
, max_campers::text , max_campers::text
, dogs_allowed , dogs_allowed
, active , active
`, pgx.QueryResultFormats{pgx.BinaryFormatCode}, slug) `, 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.AdditionalInfo[f.DefaultLang].Val, &f.Media.Val, &f.MaxCampers.Val, &f.DogsAllowed.Checked, &f.Active.Checked, &name, &spiel, &info, &facilities, &description, &additionalInfo); 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.CheckIn[f.DefaultLang].Val, &f.CheckOut[f.DefaultLang].Val, &f.Media.Val, &f.MaxCampers.Val, &f.DogsAllowed.Checked, &f.Active.Checked, &name, &spiel, &info, &facilities, &description, &additionalInfo, &checkIn, &checkOut); err != nil {
return err return err
} }
if err := f.Name.FillArray(name); err != nil { if err := f.Name.FillArray(name); err != nil {
@ -408,6 +420,12 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl
if err := f.AdditionalInfo.FillArray(additionalInfo); err != nil { if err := f.AdditionalInfo.FillArray(additionalInfo); err != nil {
return err return err
} }
if err := f.CheckIn.FillArray(checkIn); err != nil {
return err
}
if err := f.CheckOut.FillArray(checkOut); err != nil {
return err
}
rows, err := conn.Query(ctx, ` rows, err := conn.Query(ctx, `
select season_id select season_id
@ -450,6 +468,8 @@ func (f *typeForm) Parse(r *http.Request) error {
f.Facilities.FillValue(r) f.Facilities.FillValue(r)
f.Description.FillValue(r) f.Description.FillValue(r)
f.AdditionalInfo.FillValue(r) f.AdditionalInfo.FillValue(r)
f.CheckIn.FillValue(r)
f.CheckOut.FillValue(r)
f.Media.FillValue(r) f.Media.FillValue(r)
for _, p := range f.Prices { for _, p := range f.Prices {
p.PricePerNight.FillValue(r) p.PricePerNight.FillValue(r)
@ -463,6 +483,8 @@ func (f *typeForm) Valid(ctx context.Context, conn *database.Conn, l *locale.Loc
if v.CheckRequired(f.Name[f.DefaultLang], l.GettextNoop("Name can not be empty.")) { if v.CheckRequired(f.Name[f.DefaultLang], l.GettextNoop("Name can not be empty.")) {
v.CheckMinLength(f.Name[f.DefaultLang], 1, l.GettextNoop("Name must have at least one letter.")) v.CheckMinLength(f.Name[f.DefaultLang], 1, l.GettextNoop("Name must have at least one letter."))
} }
v.CheckRequired(f.CheckIn[f.DefaultLang], l.GettextNoop("Check-in can not be empty."))
v.CheckRequired(f.CheckOut[f.DefaultLang], l.GettextNoop("Check-out can not be empty."))
if v.CheckRequired(f.Media.Input, l.GettextNoop("Cover image can not be empty.")) { if v.CheckRequired(f.Media.Input, l.GettextNoop("Cover image can not be empty.")) {
if _, err := v.CheckImageMedia(ctx, conn, f.Media.Input, l.GettextNoop("Cover image must be an image media type.")); err != nil { if _, err := v.CheckImageMedia(ctx, conn, f.Media.Input, l.GettextNoop("Cover image must be an image media type.")); err != nil {
return false, err return false, err

View File

@ -76,6 +76,8 @@ type publicPage struct {
Facilities gotemplate.HTML Facilities gotemplate.HTML
Description gotemplate.HTML Description gotemplate.HTML
AdditionalInfo gotemplate.HTML AdditionalInfo gotemplate.HTML
CheckIn string
CheckOut string
} }
type typePrice struct { type typePrice struct {
@ -125,6 +127,8 @@ func newPublicPage(ctx context.Context, company *auth.Company, conn *database.Co
, coalesce(i18n.facilities, campsite_type.facilities)::text as l10n_facilities , coalesce(i18n.facilities, campsite_type.facilities)::text as l10n_facilities
, coalesce(i18n.description, campsite_type.description)::text as l10n_description , coalesce(i18n.description, campsite_type.description)::text as l10n_description
, coalesce(i18n.additional_info, campsite_type.additional_info)::text as l10n_description , coalesce(i18n.additional_info, campsite_type.additional_info)::text as l10n_description
, coalesce(i18n.check_in, campsite_type.check_in)::text as l10n_check_in
, coalesce(i18n.check_out, campsite_type.check_out)::text as l10n_check_out
, dogs_allowed , dogs_allowed
, '3.50' as dogs_prices , '3.50' as dogs_prices
from campsite_type from campsite_type
@ -132,7 +136,7 @@ func newPublicPage(ctx context.Context, company *auth.Company, conn *database.Co
where slug = $2 where slug = $2
and active and active
`, loc.Language, slug) `, loc.Language, slug)
if err := row.Scan(&page.Name, &page.Spiel, &page.Info, &page.Facilities, &page.Description, &page.AdditionalInfo, &page.DogsAllowed, &page.DogsPrice); err != nil { if err := row.Scan(&page.Name, &page.Spiel, &page.Info, &page.Facilities, &page.Description, &page.AdditionalInfo, &page.CheckIn, &page.CheckOut, &page.DogsAllowed, &page.DogsPrice); err != nil {
return nil, err return nil, err
} }
if err := conn.QueryRow(ctx, "select to_price(tourist_tax, $1) from company where company_id = $2", company.DecimalDigits, company.ID).Scan(&page.TouristTax); err != nil { if err := conn.QueryRow(ctx, "select to_price(tourist_tax, $1) from company where company_id = $2", company.DecimalDigits, company.ID).Scan(&page.TouristTax); err != nil {

View File

@ -11,12 +11,12 @@ import (
"golang.org/x/text/language" "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, additionalInfo string, maxCampers int, dogsAllowed bool) (string, error) { func (tx *Tx) AddCampsiteType(ctx context.Context, companyID int, mediaID int, name string, spiel string, info string, facilities string, description string, additionalInfo string, checkIn string, checkOut 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) return tx.GetText(ctx, "select add_campsite_type($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)", companyID, mediaID, name, spiel, info, facilities, description, additionalInfo, checkIn, checkOut, maxCampers, dogsAllowed)
} }
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) { func (tx *Tx) EditCampsiteType(ctx context.Context, slug string, mediaID int, name string, spiel string, info string, facilities string, description string, additionalInfo string, checkIn string, checkOut 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) return tx.GetText(ctx, "select edit_campsite_type($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)", slug, mediaID, name, spiel, info, facilities, description, additionalInfo, checkIn, checkOut, maxCampers, dogsAllowed, active)
} }
func (c *Conn) OrderCampsiteTypes(ctx context.Context, slugs []string) error { 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 return err
} }
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 { func (tx *Tx) TranslateCampsiteType(ctx context.Context, slug string, langTag language.Tag, name string, spiel string, info string, facilities string, description string, additionalInfo string, checkIn string, checkOut 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) _, err := tx.Exec(ctx, "select translate_campsite_type($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)", slug, langTag, name, spiel, info, facilities, description, additionalInfo, checkIn, checkOut)
return err return err
} }
func (tx *Tx) SetCampsiteTypeCost(ctx context.Context, slug string, seasonID int, minNights int, costPerNight string) error { func (tx *Tx) SetCampsiteTypeCost(ctx context.Context, slug string, seasonID int, minNights int, costPerNight string) error {

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: camper\n" "Project-Id-Version: camper\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2024-01-22 03:38+0100\n" "POT-Creation-Date: 2024-01-22 19:51+0100\n"
"PO-Revision-Date: 2023-07-22 23:45+0200\n" "PO-Revision-Date: 2023-07-22 23:45+0200\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n" "Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Catalan <ca@dodds.net>\n" "Language-Team: Catalan <ca@dodds.net>\n"
@ -134,7 +134,7 @@ msgstr "Calendari"
#: web/templates/public/campsite/type.gohtml:73 #: web/templates/public/campsite/type.gohtml:73
#: web/templates/admin/campsite/option/form.gohtml:70 #: web/templates/admin/campsite/option/form.gohtml:70
#: web/templates/admin/campsite/type/form.gohtml:83 #: web/templates/admin/campsite/type/form.gohtml:109
msgctxt "title" msgctxt "title"
msgid "Prices" msgid "Prices"
msgstr "Preus" msgstr "Preus"
@ -195,22 +195,14 @@ msgstr "Informació addicional"
#: web/templates/public/campsite/type.gohtml:138 #: web/templates/public/campsite/type.gohtml:138
msgctxt "time" msgctxt "time"
msgid "Check in" msgid "Check-in"
msgstr "Entrada" msgstr "Entrada"
#: web/templates/public/campsite/type.gohtml:139
msgid "4 p.m. to 9 p.m."
msgstr "16 h a 21 h"
#: web/templates/public/campsite/type.gohtml:142 #: web/templates/public/campsite/type.gohtml:142
msgctxt "time" msgctxt "time"
msgid "Check out" msgid "Check-out"
msgstr "Sortida" msgstr "Sortida"
#: web/templates/public/campsite/type.gohtml:143
msgid "10 a.m."
msgstr "10 h"
#: web/templates/public/campsite/calendar.gohtml:18 #: web/templates/public/campsite/calendar.gohtml:18
#: web/templates/admin/season/calendar.gohtml:16 #: web/templates/admin/season/calendar.gohtml:16
msgctxt "day" msgctxt "day"
@ -483,7 +475,7 @@ msgstr "Contingut"
#: web/templates/admin/campsite/carousel/form.gohtml:59 #: web/templates/admin/campsite/carousel/form.gohtml:59
#: web/templates/admin/campsite/form.gohtml:74 #: web/templates/admin/campsite/form.gohtml:74
#: web/templates/admin/campsite/option/form.gohtml:90 #: web/templates/admin/campsite/option/form.gohtml:90
#: web/templates/admin/campsite/type/form.gohtml:176 #: web/templates/admin/campsite/type/form.gohtml:202
#: web/templates/admin/season/form.gohtml:73 #: web/templates/admin/season/form.gohtml:73
#: web/templates/admin/services/form.gohtml:80 #: web/templates/admin/services/form.gohtml:80
#: web/templates/admin/surroundings/form.gohtml:69 #: web/templates/admin/surroundings/form.gohtml:69
@ -498,7 +490,7 @@ msgstr "Actualitza"
#: web/templates/admin/campsite/carousel/form.gohtml:61 #: web/templates/admin/campsite/carousel/form.gohtml:61
#: web/templates/admin/campsite/form.gohtml:76 #: web/templates/admin/campsite/form.gohtml:76
#: web/templates/admin/campsite/option/form.gohtml:92 #: web/templates/admin/campsite/option/form.gohtml:92
#: web/templates/admin/campsite/type/form.gohtml:178 #: web/templates/admin/campsite/type/form.gohtml:204
#: web/templates/admin/season/form.gohtml:75 #: web/templates/admin/season/form.gohtml:75
#: web/templates/admin/services/form.gohtml:82 #: web/templates/admin/services/form.gohtml:82
#: web/templates/admin/surroundings/form.gohtml:71 #: web/templates/admin/surroundings/form.gohtml:71
@ -758,7 +750,7 @@ msgid "Maximum"
msgstr "Màxim" msgstr "Màxim"
#: web/templates/admin/campsite/option/form.gohtml:76 #: web/templates/admin/campsite/option/form.gohtml:76
#: web/templates/admin/campsite/type/form.gohtml:89 #: web/templates/admin/campsite/type/form.gohtml:115
msgctxt "input" msgctxt "input"
msgid "Price per night" msgid "Price per night"
msgstr "Preu per nit" msgstr "Preu per nit"
@ -825,42 +817,52 @@ msgstr "Actiu"
#: web/templates/admin/campsite/type/form.gohtml:67 #: web/templates/admin/campsite/type/form.gohtml:67
msgctxt "input" msgctxt "input"
msgid "Check-in"
msgstr "Entrada"
#: web/templates/admin/campsite/type/form.gohtml:80
msgctxt "input"
msgid "Check-out"
msgstr "Sortida"
#: web/templates/admin/campsite/type/form.gohtml:93
msgctxt "input"
msgid "Maximum number of campers" msgid "Maximum number of campers"
msgstr "Número màxim de persones" msgstr "Número màxim de persones"
#: web/templates/admin/campsite/type/form.gohtml:77 #: web/templates/admin/campsite/type/form.gohtml:103
msgctxt "input" msgctxt "input"
msgid "Dogs allowed" msgid "Dogs allowed"
msgstr "Es permeten gossos" msgstr "Es permeten gossos"
#: web/templates/admin/campsite/type/form.gohtml:97 #: web/templates/admin/campsite/type/form.gohtml:123
msgctxt "input" msgctxt "input"
msgid "Minimum number of nights" msgid "Minimum number of nights"
msgstr "Número mínim de nits" msgstr "Número mínim de nits"
#: web/templates/admin/campsite/type/form.gohtml:109 #: web/templates/admin/campsite/type/form.gohtml:135
msgctxt "input" msgctxt "input"
msgid "Spiel" msgid "Spiel"
msgstr "Introducció" msgstr "Introducció"
#: web/templates/admin/campsite/type/form.gohtml:122 #: web/templates/admin/campsite/type/form.gohtml:148
msgctxt "input" msgctxt "input"
msgid "Info" msgid "Info"
msgstr "Informació" msgstr "Informació"
#: web/templates/admin/campsite/type/form.gohtml:135 #: web/templates/admin/campsite/type/form.gohtml:161
msgctxt "input" msgctxt "input"
msgid "Facilities" msgid "Facilities"
msgstr "Equipaments" msgstr "Equipaments"
#: web/templates/admin/campsite/type/form.gohtml:148 #: web/templates/admin/campsite/type/form.gohtml:174
#: web/templates/admin/services/form.gohtml:65 #: web/templates/admin/services/form.gohtml:65
#: web/templates/admin/surroundings/form.gohtml:54 #: web/templates/admin/surroundings/form.gohtml:54
msgctxt "input" msgctxt "input"
msgid "Description" msgid "Description"
msgstr "Descripció" msgstr "Descripció"
#: web/templates/admin/campsite/type/form.gohtml:161 #: web/templates/admin/campsite/type/form.gohtml:187
msgctxt "input" msgctxt "input"
msgid "Additional Information" msgid "Additional Information"
msgstr "Informació addicional" msgstr "Informació addicional"
@ -1424,14 +1426,14 @@ msgid "No booking found."
msgstr "No sha trobat cap reserva." msgstr "No sha trobat cap reserva."
#: pkg/legal/admin.go:258 pkg/app/user.go:249 pkg/campsite/types/option.go:344 #: 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:463 #: pkg/campsite/types/feature.go:259 pkg/campsite/types/admin.go:483
#: pkg/season/admin.go:412 pkg/services/admin.go:316 #: pkg/season/admin.go:412 pkg/services/admin.go:316
#: pkg/surroundings/admin.go:321 #: pkg/surroundings/admin.go:321
msgid "Name can not be empty." msgid "Name can not be empty."
msgstr "No podeu deixar el nom en blanc." msgstr "No podeu deixar el nom en blanc."
#: pkg/legal/admin.go:259 pkg/campsite/types/option.go:345 #: pkg/legal/admin.go:259 pkg/campsite/types/option.go:345
#: pkg/campsite/types/feature.go:260 pkg/campsite/types/admin.go:464 #: pkg/campsite/types/feature.go:260 pkg/campsite/types/admin.go:484
msgid "Name must have at least one letter." msgid "Name must have at least one letter."
msgstr "El nom ha de tenir com a mínim una lletra." msgstr "El nom ha de tenir com a mínim una lletra."
@ -1518,15 +1520,15 @@ msgstr "El valor del màxim ha de ser un número enter."
msgid "Maximum must be equal or greater than minimum." 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." 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:477 #: pkg/campsite/types/option.go:361 pkg/campsite/types/admin.go:499
msgid "Price per night can not be empty." msgid "Price per night can not be empty."
msgstr "No podeu deixar el preu per nit en blanc." msgstr "No podeu deixar el preu per nit en blanc."
#: pkg/campsite/types/option.go:362 pkg/campsite/types/admin.go:478 #: pkg/campsite/types/option.go:362 pkg/campsite/types/admin.go:500
msgid "Price per night must be a decimal number." msgid "Price per night must be a decimal number."
msgstr "El preu per nit ha de ser un número decimal." msgstr "El preu per nit ha de ser un número decimal."
#: pkg/campsite/types/option.go:363 pkg/campsite/types/admin.go:479 #: pkg/campsite/types/option.go:363 pkg/campsite/types/admin.go:501
msgid "Price per night must be zero or greater." msgid "Price per night must be zero or greater."
msgstr "El preu per nit ha de ser com a mínim zero." msgstr "El preu per nit ha de ser com a mínim zero."
@ -1534,45 +1536,53 @@ msgstr "El preu per nit ha de ser com a mínim zero."
msgid "Selected icon is not valid." msgid "Selected icon is not valid."
msgstr "La icona escollida no és vàlida." msgstr "La icona escollida no és vàlida."
#: pkg/campsite/types/admin.go:305 #: pkg/campsite/types/admin.go:307
msgctxt "input" msgctxt "input"
msgid "Cover image" msgid "Cover image"
msgstr "Imatge de portada" msgstr "Imatge de portada"
#: pkg/campsite/types/admin.go:306 #: pkg/campsite/types/admin.go:308
msgctxt "action" msgctxt "action"
msgid "Set campsite type cover" msgid "Set campsite type cover"
msgstr "Estableix la portada del tipus dallotjament" msgstr "Estableix la portada del tipus dallotjament"
#: pkg/campsite/types/admin.go:466 #: pkg/campsite/types/admin.go:486
msgid "Check-in can not be empty."
msgstr "No podeu deixar lentrada en blanc."
#: pkg/campsite/types/admin.go:487
msgid "Check-out can not be empty."
msgstr "No podeu deixar la sortida en blanc."
#: pkg/campsite/types/admin.go:488
msgid "Cover image can not be empty." msgid "Cover image can not be empty."
msgstr "No podeu deixar la imatge de portada en blanc." msgstr "No podeu deixar la imatge de portada en blanc."
#: pkg/campsite/types/admin.go:467 #: pkg/campsite/types/admin.go:489
msgid "Cover image must be an image media type." msgid "Cover image must be an image media type."
msgstr "La imatge de portada ha de ser un mèdia de tipus imatge." msgstr "La imatge de portada ha de ser un mèdia de tipus imatge."
#: pkg/campsite/types/admin.go:471 #: pkg/campsite/types/admin.go:493
msgid "Maximum number of campers can not be empty." msgid "Maximum number of campers can not be empty."
msgstr "No podeu deixar el número màxim de persones en blanc." msgstr "No podeu deixar el número màxim de persones en blanc."
#: pkg/campsite/types/admin.go:472 #: pkg/campsite/types/admin.go:494
msgid "Maximum number of campers must be an integer number." msgid "Maximum number of campers must be an integer number."
msgstr "El número màxim de persones ha de ser enter." msgstr "El número màxim de persones ha de ser enter."
#: pkg/campsite/types/admin.go:473 #: pkg/campsite/types/admin.go:495
msgid "Maximum number of campers must be one or greater." msgid "Maximum number of campers must be one or greater."
msgstr "El número màxim de persones no pot ser zero." msgstr "El número màxim de persones no pot ser zero."
#: pkg/campsite/types/admin.go:482 #: pkg/campsite/types/admin.go:504
msgid "Minimum number of nights can not be empty." msgid "Minimum number of nights can not be empty."
msgstr "No podeu deixar el número mínim de nits en blanc." msgstr "No podeu deixar el número mínim de nits en blanc."
#: pkg/campsite/types/admin.go:483 #: pkg/campsite/types/admin.go:505
msgid "Minimum number of nights must be an integer." msgid "Minimum number of nights must be an integer."
msgstr "El número mínim de nits ha de ser enter." msgstr "El número mínim de nits ha de ser enter."
#: pkg/campsite/types/admin.go:484 #: pkg/campsite/types/admin.go:506
msgid "Minimum number of nights must be one or greater." msgid "Minimum number of nights must be one or greater."
msgstr "El número mínim de nits no pot ser zero." msgstr "El número mínim de nits no pot ser zero."

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: camper\n" "Project-Id-Version: camper\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2024-01-22 03:38+0100\n" "POT-Creation-Date: 2024-01-22 19:51+0100\n"
"PO-Revision-Date: 2023-07-22 23:46+0200\n" "PO-Revision-Date: 2023-07-22 23:46+0200\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n" "Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Spanish <es@tp.org.es>\n" "Language-Team: Spanish <es@tp.org.es>\n"
@ -134,7 +134,7 @@ msgstr "Calendario"
#: web/templates/public/campsite/type.gohtml:73 #: web/templates/public/campsite/type.gohtml:73
#: web/templates/admin/campsite/option/form.gohtml:70 #: web/templates/admin/campsite/option/form.gohtml:70
#: web/templates/admin/campsite/type/form.gohtml:83 #: web/templates/admin/campsite/type/form.gohtml:109
msgctxt "title" msgctxt "title"
msgid "Prices" msgid "Prices"
msgstr "Precios" msgstr "Precios"
@ -195,22 +195,14 @@ msgstr "Información adicional"
#: web/templates/public/campsite/type.gohtml:138 #: web/templates/public/campsite/type.gohtml:138
msgctxt "time" msgctxt "time"
msgid "Check in" msgid "Check-in"
msgstr "Entrada" msgstr "Entrada"
#: web/templates/public/campsite/type.gohtml:139
msgid "4 p.m. to 9 p.m."
msgstr "16 h a 21 h"
#: web/templates/public/campsite/type.gohtml:142 #: web/templates/public/campsite/type.gohtml:142
msgctxt "time" msgctxt "time"
msgid "Check out" msgid "Check-out"
msgstr "Salida" msgstr "Salida"
#: web/templates/public/campsite/type.gohtml:143
msgid "10 a.m."
msgstr "10 h"
#: web/templates/public/campsite/calendar.gohtml:18 #: web/templates/public/campsite/calendar.gohtml:18
#: web/templates/admin/season/calendar.gohtml:16 #: web/templates/admin/season/calendar.gohtml:16
msgctxt "day" msgctxt "day"
@ -483,7 +475,7 @@ msgstr "Contenido"
#: web/templates/admin/campsite/carousel/form.gohtml:59 #: web/templates/admin/campsite/carousel/form.gohtml:59
#: web/templates/admin/campsite/form.gohtml:74 #: web/templates/admin/campsite/form.gohtml:74
#: web/templates/admin/campsite/option/form.gohtml:90 #: web/templates/admin/campsite/option/form.gohtml:90
#: web/templates/admin/campsite/type/form.gohtml:176 #: web/templates/admin/campsite/type/form.gohtml:202
#: web/templates/admin/season/form.gohtml:73 #: web/templates/admin/season/form.gohtml:73
#: web/templates/admin/services/form.gohtml:80 #: web/templates/admin/services/form.gohtml:80
#: web/templates/admin/surroundings/form.gohtml:69 #: web/templates/admin/surroundings/form.gohtml:69
@ -498,7 +490,7 @@ msgstr "Actualizar"
#: web/templates/admin/campsite/carousel/form.gohtml:61 #: web/templates/admin/campsite/carousel/form.gohtml:61
#: web/templates/admin/campsite/form.gohtml:76 #: web/templates/admin/campsite/form.gohtml:76
#: web/templates/admin/campsite/option/form.gohtml:92 #: web/templates/admin/campsite/option/form.gohtml:92
#: web/templates/admin/campsite/type/form.gohtml:178 #: web/templates/admin/campsite/type/form.gohtml:204
#: web/templates/admin/season/form.gohtml:75 #: web/templates/admin/season/form.gohtml:75
#: web/templates/admin/services/form.gohtml:82 #: web/templates/admin/services/form.gohtml:82
#: web/templates/admin/surroundings/form.gohtml:71 #: web/templates/admin/surroundings/form.gohtml:71
@ -758,7 +750,7 @@ msgid "Maximum"
msgstr "Màximo" msgstr "Màximo"
#: web/templates/admin/campsite/option/form.gohtml:76 #: web/templates/admin/campsite/option/form.gohtml:76
#: web/templates/admin/campsite/type/form.gohtml:89 #: web/templates/admin/campsite/type/form.gohtml:115
msgctxt "input" msgctxt "input"
msgid "Price per night" msgid "Price per night"
msgstr "Precio por noche" msgstr "Precio por noche"
@ -825,42 +817,52 @@ msgstr "Activo"
#: web/templates/admin/campsite/type/form.gohtml:67 #: web/templates/admin/campsite/type/form.gohtml:67
msgctxt "input" msgctxt "input"
msgid "Check-in"
msgstr "Entrada"
#: web/templates/admin/campsite/type/form.gohtml:80
msgctxt "input"
msgid "Check-out"
msgstr "Salida"
#: web/templates/admin/campsite/type/form.gohtml:93
msgctxt "input"
msgid "Maximum number of campers" msgid "Maximum number of campers"
msgstr "Número máximo de personas" msgstr "Número máximo de personas"
#: web/templates/admin/campsite/type/form.gohtml:77 #: web/templates/admin/campsite/type/form.gohtml:103
msgctxt "input" msgctxt "input"
msgid "Dogs allowed" msgid "Dogs allowed"
msgstr "Se permiten perros" msgstr "Se permiten perros"
#: web/templates/admin/campsite/type/form.gohtml:97 #: web/templates/admin/campsite/type/form.gohtml:123
msgctxt "input" msgctxt "input"
msgid "Minimum number of nights" msgid "Minimum number of nights"
msgstr "Número mínimos de noches" msgstr "Número mínimos de noches"
#: web/templates/admin/campsite/type/form.gohtml:109 #: web/templates/admin/campsite/type/form.gohtml:135
msgctxt "input" msgctxt "input"
msgid "Spiel" msgid "Spiel"
msgstr "Introducción" msgstr "Introducción"
#: web/templates/admin/campsite/type/form.gohtml:122 #: web/templates/admin/campsite/type/form.gohtml:148
msgctxt "input" msgctxt "input"
msgid "Info" msgid "Info"
msgstr "Información" msgstr "Información"
#: web/templates/admin/campsite/type/form.gohtml:135 #: web/templates/admin/campsite/type/form.gohtml:161
msgctxt "input" msgctxt "input"
msgid "Facilities" msgid "Facilities"
msgstr "Equipamento" msgstr "Equipamento"
#: web/templates/admin/campsite/type/form.gohtml:148 #: web/templates/admin/campsite/type/form.gohtml:174
#: web/templates/admin/services/form.gohtml:65 #: web/templates/admin/services/form.gohtml:65
#: web/templates/admin/surroundings/form.gohtml:54 #: web/templates/admin/surroundings/form.gohtml:54
msgctxt "input" msgctxt "input"
msgid "Description" msgid "Description"
msgstr "Descripción" msgstr "Descripción"
#: web/templates/admin/campsite/type/form.gohtml:161 #: web/templates/admin/campsite/type/form.gohtml:187
msgctxt "input" msgctxt "input"
msgid "Additional Information" msgid "Additional Information"
msgstr "Información adicional" msgstr "Información adicional"
@ -1424,14 +1426,14 @@ msgid "No booking found."
msgstr "No se ha encontrado ninguna reserva." msgstr "No se ha encontrado ninguna reserva."
#: pkg/legal/admin.go:258 pkg/app/user.go:249 pkg/campsite/types/option.go:344 #: 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:463 #: pkg/campsite/types/feature.go:259 pkg/campsite/types/admin.go:483
#: pkg/season/admin.go:412 pkg/services/admin.go:316 #: pkg/season/admin.go:412 pkg/services/admin.go:316
#: pkg/surroundings/admin.go:321 #: pkg/surroundings/admin.go:321
msgid "Name can not be empty." msgid "Name can not be empty."
msgstr "No podéis dejar el nombre en blanco." msgstr "No podéis dejar el nombre en blanco."
#: pkg/legal/admin.go:259 pkg/campsite/types/option.go:345 #: pkg/legal/admin.go:259 pkg/campsite/types/option.go:345
#: pkg/campsite/types/feature.go:260 pkg/campsite/types/admin.go:464 #: pkg/campsite/types/feature.go:260 pkg/campsite/types/admin.go:484
msgid "Name must have at least one letter." msgid "Name must have at least one letter."
msgstr "El nombre tiene que tener como mínimo una letra." msgstr "El nombre tiene que tener como mínimo una letra."
@ -1518,15 +1520,15 @@ msgstr "El valor del máximo tiene que ser un número entero."
msgid "Maximum must be equal or greater than minimum." 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." 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:477 #: pkg/campsite/types/option.go:361 pkg/campsite/types/admin.go:499
msgid "Price per night can not be empty." msgid "Price per night can not be empty."
msgstr "No podéis dejar el precio por noche en blanco." msgstr "No podéis dejar el precio por noche en blanco."
#: pkg/campsite/types/option.go:362 pkg/campsite/types/admin.go:478 #: pkg/campsite/types/option.go:362 pkg/campsite/types/admin.go:500
msgid "Price per night must be a decimal number." msgid "Price per night must be a decimal number."
msgstr "El precio por noche tiene que ser un número decimal." msgstr "El precio por noche tiene que ser un número decimal."
#: pkg/campsite/types/option.go:363 pkg/campsite/types/admin.go:479 #: pkg/campsite/types/option.go:363 pkg/campsite/types/admin.go:501
msgid "Price per night must be zero or greater." msgid "Price per night must be zero or greater."
msgstr "El precio por noche tiene que ser como mínimo cero." msgstr "El precio por noche tiene que ser como mínimo cero."
@ -1534,45 +1536,53 @@ msgstr "El precio por noche tiene que ser como mínimo cero."
msgid "Selected icon is not valid." msgid "Selected icon is not valid."
msgstr "El icono escogido no es válido." msgstr "El icono escogido no es válido."
#: pkg/campsite/types/admin.go:305 #: pkg/campsite/types/admin.go:307
msgctxt "input" msgctxt "input"
msgid "Cover image" msgid "Cover image"
msgstr "Imagen de portada" msgstr "Imagen de portada"
#: pkg/campsite/types/admin.go:306 #: pkg/campsite/types/admin.go:308
msgctxt "action" msgctxt "action"
msgid "Set campsite type cover" msgid "Set campsite type cover"
msgstr "Establecer la portada del tipo de alojamiento" msgstr "Establecer la portada del tipo de alojamiento"
#: pkg/campsite/types/admin.go:466 #: pkg/campsite/types/admin.go:486
msgid "Check-in can not be empty."
msgstr "No podéis dejar la entrada en blanco."
#: pkg/campsite/types/admin.go:487
msgid "Check-out can not be empty."
msgstr "No podéis dejar la salida en blanco."
#: pkg/campsite/types/admin.go:488
msgid "Cover image can not be empty." msgid "Cover image can not be empty."
msgstr "No podéis dejar la imagen de portada en blanco." msgstr "No podéis dejar la imagen de portada en blanco."
#: pkg/campsite/types/admin.go:467 #: pkg/campsite/types/admin.go:489
msgid "Cover image must be an image media type." msgid "Cover image must be an image media type."
msgstr "La imagen de portada tiene que ser un medio de tipo imagen." msgstr "La imagen de portada tiene que ser un medio de tipo imagen."
#: pkg/campsite/types/admin.go:471 #: pkg/campsite/types/admin.go:493
msgid "Maximum number of campers can not be empty." msgid "Maximum number of campers can not be empty."
msgstr "No podéis dejar el número máximo de personas en blanco." msgstr "No podéis dejar el número máximo de personas en blanco."
#: pkg/campsite/types/admin.go:472 #: pkg/campsite/types/admin.go:494
msgid "Maximum number of campers must be an integer number." msgid "Maximum number of campers must be an integer number."
msgstr "El número máximo de personas tiene que ser entero." msgstr "El número máximo de personas tiene que ser entero."
#: pkg/campsite/types/admin.go:473 #: pkg/campsite/types/admin.go:495
msgid "Maximum number of campers must be one or greater." msgid "Maximum number of campers must be one or greater."
msgstr "El número máximo de personas no puede ser cero." msgstr "El número máximo de personas no puede ser cero."
#: pkg/campsite/types/admin.go:482 #: pkg/campsite/types/admin.go:504
msgid "Minimum number of nights can not be empty." msgid "Minimum number of nights can not be empty."
msgstr "No podéis dejar el número mínimo de noches en blanco." msgstr "No podéis dejar el número mínimo de noches en blanco."
#: pkg/campsite/types/admin.go:483 #: pkg/campsite/types/admin.go:505
msgid "Minimum number of nights must be an integer." msgid "Minimum number of nights must be an integer."
msgstr "El número mínimo de noches tiene que ser entero." msgstr "El número mínimo de noches tiene que ser entero."
#: pkg/campsite/types/admin.go:484 #: pkg/campsite/types/admin.go:506
msgid "Minimum number of nights must be one or greater." msgid "Minimum number of nights must be one or greater."
msgstr "El número mínimo de noches no puede ser cero." msgstr "El número mínimo de noches no puede ser cero."

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: camper\n" "Project-Id-Version: camper\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2024-01-22 03:38+0100\n" "POT-Creation-Date: 2024-01-22 19:51+0100\n"
"PO-Revision-Date: 2023-12-20 10:13+0100\n" "PO-Revision-Date: 2023-12-20 10:13+0100\n"
"Last-Translator: Oriol Carbonell <info@oriolcarbonell.cat>\n" "Last-Translator: Oriol Carbonell <info@oriolcarbonell.cat>\n"
"Language-Team: French <traduc@traduc.org>\n" "Language-Team: French <traduc@traduc.org>\n"
@ -135,7 +135,7 @@ msgstr "Calendrier"
#: web/templates/public/campsite/type.gohtml:73 #: web/templates/public/campsite/type.gohtml:73
#: web/templates/admin/campsite/option/form.gohtml:70 #: web/templates/admin/campsite/option/form.gohtml:70
#: web/templates/admin/campsite/type/form.gohtml:83 #: web/templates/admin/campsite/type/form.gohtml:109
msgctxt "title" msgctxt "title"
msgid "Prices" msgid "Prices"
msgstr "Prix" msgstr "Prix"
@ -196,22 +196,14 @@ msgstr "Informations Complémentaires"
#: web/templates/public/campsite/type.gohtml:138 #: web/templates/public/campsite/type.gohtml:138
msgctxt "time" msgctxt "time"
msgid "Check in" msgid "Check-in"
msgstr "Arrivée" msgstr "Arrivée"
#: web/templates/public/campsite/type.gohtml:139
msgid "4 p.m. to 9 p.m."
msgstr "16 h à 21 h"
#: web/templates/public/campsite/type.gohtml:142 #: web/templates/public/campsite/type.gohtml:142
msgctxt "time" msgctxt "time"
msgid "Check out" msgid "Check-out"
msgstr "Départ" msgstr "Départ"
#: web/templates/public/campsite/type.gohtml:143
msgid "10 a.m."
msgstr "10 h"
#: web/templates/public/campsite/calendar.gohtml:18 #: web/templates/public/campsite/calendar.gohtml:18
#: web/templates/admin/season/calendar.gohtml:16 #: web/templates/admin/season/calendar.gohtml:16
msgctxt "day" msgctxt "day"
@ -484,7 +476,7 @@ msgstr "Contenu"
#: web/templates/admin/campsite/carousel/form.gohtml:59 #: web/templates/admin/campsite/carousel/form.gohtml:59
#: web/templates/admin/campsite/form.gohtml:74 #: web/templates/admin/campsite/form.gohtml:74
#: web/templates/admin/campsite/option/form.gohtml:90 #: web/templates/admin/campsite/option/form.gohtml:90
#: web/templates/admin/campsite/type/form.gohtml:176 #: web/templates/admin/campsite/type/form.gohtml:202
#: web/templates/admin/season/form.gohtml:73 #: web/templates/admin/season/form.gohtml:73
#: web/templates/admin/services/form.gohtml:80 #: web/templates/admin/services/form.gohtml:80
#: web/templates/admin/surroundings/form.gohtml:69 #: web/templates/admin/surroundings/form.gohtml:69
@ -499,7 +491,7 @@ msgstr "Mettre à jour"
#: web/templates/admin/campsite/carousel/form.gohtml:61 #: web/templates/admin/campsite/carousel/form.gohtml:61
#: web/templates/admin/campsite/form.gohtml:76 #: web/templates/admin/campsite/form.gohtml:76
#: web/templates/admin/campsite/option/form.gohtml:92 #: web/templates/admin/campsite/option/form.gohtml:92
#: web/templates/admin/campsite/type/form.gohtml:178 #: web/templates/admin/campsite/type/form.gohtml:204
#: web/templates/admin/season/form.gohtml:75 #: web/templates/admin/season/form.gohtml:75
#: web/templates/admin/services/form.gohtml:82 #: web/templates/admin/services/form.gohtml:82
#: web/templates/admin/surroundings/form.gohtml:71 #: web/templates/admin/surroundings/form.gohtml:71
@ -759,7 +751,7 @@ msgid "Maximum"
msgstr "Maximum" msgstr "Maximum"
#: web/templates/admin/campsite/option/form.gohtml:76 #: web/templates/admin/campsite/option/form.gohtml:76
#: web/templates/admin/campsite/type/form.gohtml:89 #: web/templates/admin/campsite/type/form.gohtml:115
msgctxt "input" msgctxt "input"
msgid "Price per night" msgid "Price per night"
msgstr "Prix par nuit" msgstr "Prix par nuit"
@ -826,42 +818,52 @@ msgstr "Actif"
#: web/templates/admin/campsite/type/form.gohtml:67 #: web/templates/admin/campsite/type/form.gohtml:67
msgctxt "input" msgctxt "input"
msgid "Check-in"
msgstr "Arrivée"
#: web/templates/admin/campsite/type/form.gohtml:80
msgctxt "input"
msgid "Check-out"
msgstr "Départ"
#: web/templates/admin/campsite/type/form.gohtml:93
msgctxt "input"
msgid "Maximum number of campers" msgid "Maximum number of campers"
msgstr "Nombre maximum de campeurs" msgstr "Nombre maximum de campeurs"
#: web/templates/admin/campsite/type/form.gohtml:77 #: web/templates/admin/campsite/type/form.gohtml:103
msgctxt "input" msgctxt "input"
msgid "Dogs allowed" msgid "Dogs allowed"
msgstr "Chiens acceptés" msgstr "Chiens acceptés"
#: web/templates/admin/campsite/type/form.gohtml:97 #: web/templates/admin/campsite/type/form.gohtml:123
msgctxt "input" msgctxt "input"
msgid "Minimum number of nights" msgid "Minimum number of nights"
msgstr "Nombre minimum de nuits" msgstr "Nombre minimum de nuits"
#: web/templates/admin/campsite/type/form.gohtml:109 #: web/templates/admin/campsite/type/form.gohtml:135
msgctxt "input" msgctxt "input"
msgid "Spiel" msgid "Spiel"
msgstr "Boniment" msgstr "Boniment"
#: web/templates/admin/campsite/type/form.gohtml:122 #: web/templates/admin/campsite/type/form.gohtml:148
msgctxt "input" msgctxt "input"
msgid "Info" msgid "Info"
msgstr "Info" msgstr "Info"
#: web/templates/admin/campsite/type/form.gohtml:135 #: web/templates/admin/campsite/type/form.gohtml:161
msgctxt "input" msgctxt "input"
msgid "Facilities" msgid "Facilities"
msgstr "Installations" msgstr "Installations"
#: web/templates/admin/campsite/type/form.gohtml:148 #: web/templates/admin/campsite/type/form.gohtml:174
#: web/templates/admin/services/form.gohtml:65 #: web/templates/admin/services/form.gohtml:65
#: web/templates/admin/surroundings/form.gohtml:54 #: web/templates/admin/surroundings/form.gohtml:54
msgctxt "input" msgctxt "input"
msgid "Description" msgid "Description"
msgstr "Description" msgstr "Description"
#: web/templates/admin/campsite/type/form.gohtml:161 #: web/templates/admin/campsite/type/form.gohtml:187
msgctxt "input" msgctxt "input"
msgid "Additional Information" msgid "Additional Information"
msgstr "Informations Complémentaires" msgstr "Informations Complémentaires"
@ -1425,14 +1427,14 @@ msgid "No booking found."
msgstr "Aucune réservation trouvée." msgstr "Aucune réservation trouvée."
#: pkg/legal/admin.go:258 pkg/app/user.go:249 pkg/campsite/types/option.go:344 #: 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:463 #: pkg/campsite/types/feature.go:259 pkg/campsite/types/admin.go:483
#: pkg/season/admin.go:412 pkg/services/admin.go:316 #: pkg/season/admin.go:412 pkg/services/admin.go:316
#: pkg/surroundings/admin.go:321 #: pkg/surroundings/admin.go:321
msgid "Name can not be empty." msgid "Name can not be empty."
msgstr "Le nom ne peut pas être laissé vide." msgstr "Le nom ne peut pas être laissé vide."
#: pkg/legal/admin.go:259 pkg/campsite/types/option.go:345 #: pkg/legal/admin.go:259 pkg/campsite/types/option.go:345
#: pkg/campsite/types/feature.go:260 pkg/campsite/types/admin.go:464 #: pkg/campsite/types/feature.go:260 pkg/campsite/types/admin.go:484
msgid "Name must have at least one letter." msgid "Name must have at least one letter."
msgstr "Le nom doit comporter au moins une lettre." msgstr "Le nom doit comporter au moins une lettre."
@ -1519,15 +1521,15 @@ msgstr "Le maximum doit être un nombre entier."
msgid "Maximum must be equal or greater than minimum." msgid "Maximum must be equal or greater than minimum."
msgstr "Le maximum doit être égal ou supérieur au minimum." msgstr "Le maximum doit être égal ou supérieur au minimum."
#: pkg/campsite/types/option.go:361 pkg/campsite/types/admin.go:477 #: pkg/campsite/types/option.go:361 pkg/campsite/types/admin.go:499
msgid "Price per night can not be empty." msgid "Price per night can not be empty."
msgstr "Le prix par nuit ne peut pas être vide." msgstr "Le prix par nuit ne peut pas être vide."
#: pkg/campsite/types/option.go:362 pkg/campsite/types/admin.go:478 #: pkg/campsite/types/option.go:362 pkg/campsite/types/admin.go:500
msgid "Price per night must be a decimal number." msgid "Price per night must be a decimal number."
msgstr "Le prix par nuit doit être un nombre décimal." msgstr "Le prix par nuit doit être un nombre décimal."
#: pkg/campsite/types/option.go:363 pkg/campsite/types/admin.go:479 #: pkg/campsite/types/option.go:363 pkg/campsite/types/admin.go:501
msgid "Price per night must be zero or greater." msgid "Price per night must be zero or greater."
msgstr "Le prix par nuit doit être égal ou supérieur." msgstr "Le prix par nuit doit être égal ou supérieur."
@ -1535,45 +1537,53 @@ msgstr "Le prix par nuit doit être égal ou supérieur."
msgid "Selected icon is not valid." msgid "Selected icon is not valid."
msgstr "Licône sélectionnée nest pas valide." msgstr "Licône sélectionnée nest pas valide."
#: pkg/campsite/types/admin.go:305 #: pkg/campsite/types/admin.go:307
msgctxt "input" msgctxt "input"
msgid "Cover image" msgid "Cover image"
msgstr "Image de couverture" msgstr "Image de couverture"
#: pkg/campsite/types/admin.go:306 #: pkg/campsite/types/admin.go:308
msgctxt "action" msgctxt "action"
msgid "Set campsite type cover" msgid "Set campsite type cover"
msgstr "Définir une couverture type camping" msgstr "Définir une couverture type camping"
#: pkg/campsite/types/admin.go:466 #: pkg/campsite/types/admin.go:486
msgid "Check-in can not be empty."
msgstr "Larrivée ne peut pas être vide."
#: pkg/campsite/types/admin.go:487
msgid "Check-out can not be empty."
msgstr "Le départ ne peut pas être vide."
#: pkg/campsite/types/admin.go:488
msgid "Cover image can not be empty." msgid "Cover image can not be empty."
msgstr "Limage de couverture ne peut pas être vide." msgstr "Limage de couverture ne peut pas être vide."
#: pkg/campsite/types/admin.go:467 #: pkg/campsite/types/admin.go:489
msgid "Cover image must be an image media type." msgid "Cover image must be an image media type."
msgstr "Limage de couverture doit être de type média dimage." msgstr "Limage de couverture doit être de type média dimage."
#: pkg/campsite/types/admin.go:471 #: pkg/campsite/types/admin.go:493
msgid "Maximum number of campers can not be empty." msgid "Maximum number of campers can not be empty."
msgstr "Le nombre maximum de campeurs ne peut pas être vide." msgstr "Le nombre maximum de campeurs ne peut pas être vide."
#: pkg/campsite/types/admin.go:472 #: pkg/campsite/types/admin.go:494
msgid "Maximum number of campers must be an integer number." msgid "Maximum number of campers must be an integer number."
msgstr "Le nombre maximum de campeurs doit être un nombre entier." msgstr "Le nombre maximum de campeurs doit être un nombre entier."
#: pkg/campsite/types/admin.go:473 #: pkg/campsite/types/admin.go:495
msgid "Maximum number of campers must be one or greater." msgid "Maximum number of campers must be one or greater."
msgstr "Le nombre maximum de campeurs doit être égal ou supérieur à un campeur." msgstr "Le nombre maximum de campeurs doit être égal ou supérieur à un campeur."
#: pkg/campsite/types/admin.go:482 #: pkg/campsite/types/admin.go:504
msgid "Minimum number of nights can not be empty." msgid "Minimum number of nights can not be empty."
msgstr "Le nombre minimum de nuits ne peut pas être vide." msgstr "Le nombre minimum de nuits ne peut pas être vide."
#: pkg/campsite/types/admin.go:483 #: pkg/campsite/types/admin.go:505
msgid "Minimum number of nights must be an integer." msgid "Minimum number of nights must be an integer."
msgstr "Le nombre minimum de nuits doit être un entier." msgstr "Le nombre minimum de nuits doit être un entier."
#: pkg/campsite/types/admin.go:484 #: pkg/campsite/types/admin.go:506
msgid "Minimum number of nights must be one or greater." msgid "Minimum number of nights must be one or greater."
msgstr "Le nombre minimum de nuits doit être supérieur ou égal à une nuit." msgstr "Le nombre minimum de nuits doit être supérieur ou égal à une nuit."

View File

@ -8,18 +8,18 @@ begin;
set search_path to camper, public; set search_path to camper, public;
drop function if exists add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean); drop function if exists add_campsite_type(integer, integer, text, text, 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 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) 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), 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; returning slug;
$$ $$
language sql language sql
; ;
revoke execute on function add_campsite_type(integer, integer, text, text, text, text, text, integer, boolean) from public; 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, integer, boolean) to admin; grant execute on function add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean) to admin;
commit; commit;

View File

@ -0,0 +1,25 @@
-- Deploy camper:add_campsite_type to pg
-- requires: roles
-- requires: schema_camper
-- requires: campsite_type
-- requires: company
begin;
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;

View File

@ -0,0 +1,10 @@
-- Revert camper:campsite_type__check_in_out from pg
begin;
alter table camper.campsite_type
drop column if exists check_in
, drop column if exists check_out
;
commit;

View File

@ -0,0 +1,10 @@
-- Revert camper:campsite_type_i18n__check_in_out from pg
begin;
alter table camper.campsite_type_i18n
drop column if exists check_in
, drop column if exists check_out
;
commit;

View File

@ -8,15 +8,16 @@ begin;
set search_path to camper, public; set search_path to camper, public;
drop function if exists edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean); drop function if exists edit_campsite_type(uuid, integer, text, text, 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 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 update campsite_type
set name = edit_campsite_type.name set name = edit_campsite_type.name
, spiel = xmlparse(content edit_campsite_type.spiel) , spiel = xmlparse(content edit_campsite_type.spiel)
, description = xmlparse(content edit_campsite_type.description) , description = xmlparse(content edit_campsite_type.description)
, info = xmlparse(content edit_campsite_type.info) , info = xmlparse(content edit_campsite_type.info)
, additional_info = xmlparse(content edit_campsite_type.additional_info)
, facilities = xmlparse(content edit_campsite_type.facilities) , facilities = xmlparse(content edit_campsite_type.facilities)
, media_id = coalesce(edit_campsite_type.media_id, campsite_type.media_id) , media_id = coalesce(edit_campsite_type.media_id, campsite_type.media_id)
, max_campers = edit_campsite_type.max_campers , max_campers = edit_campsite_type.max_campers
@ -28,7 +29,7 @@ $$
language sql language sql
; ;
revoke execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, integer, boolean, boolean) from public; 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, integer, boolean, boolean) to admin; grant execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean) to admin;
commit; commit;

View File

@ -0,0 +1,34 @@
-- Deploy camper:edit_campsite_type to pg
-- requires: roles
-- requires: schema_camper
-- requires: campsite_type
-- requires: company
begin;
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;

View File

@ -7,12 +7,12 @@ begin;
set search_path to camper, public; set search_path to camper, public;
drop function if exists translate_campsite_type (uuid, text, text, text, text, text, text, text); drop function if exists translate_campsite_type (uuid, text, text, 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 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) 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, '')) 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 from campsite_type
where slug = translate_campsite_type.slug where slug = translate_campsite_type.slug
on conflict (campsite_type_id, lang_tag) do update on conflict (campsite_type_id, lang_tag) do update
@ -21,11 +21,12 @@ $$
, info = excluded.info , info = excluded.info
, facilities = excluded.facilities , facilities = excluded.facilities
, description = excluded.description , description = excluded.description
, additional_info = excluded.additional_info
$$ $$
language sql language sql
; ;
revoke execute on function translate_campsite_type (uuid, text, text, text, text, text, text) from public; 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) to admin; grant execute on function translate_campsite_type(uuid, text, text, text, text, text, text, text) to admin;
commit; commit;

View File

@ -0,0 +1,31 @@
-- Deploy camper:translate_campsite_type to pg
-- requires: roles
-- requires: schema_camper
-- requires: campsite_type_i18n
begin;
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;

View File

@ -160,3 +160,10 @@ booking_status [roles schema_camper] 2024-01-18T14:34:53Z jordi fita mas <jordi@
booking_status_i18n [roles schema_camper booking_status language] 2024-01-18T14:39:49Z jordi fita mas <jordi@tandem.blog> # Add relation of booking status translations booking_status_i18n [roles schema_camper booking_status language] 2024-01-18T14:39:49Z jordi fita mas <jordi@tandem.blog> # Add relation of booking status translations
available_booking_status [booking_status booking_status_i18n] 2024-01-18T14:45:37Z jordi fita mas <jordi@tandem.blog> # Add the list of available booking statuses available_booking_status [booking_status booking_status_i18n] 2024-01-18T14:45:37Z jordi fita mas <jordi@tandem.blog> # Add the list of available booking statuses
booking [roles schema_camper company user_profile campsite_type booking_status] 2024-01-18T16:48:07Z jordi fita mas <jordi@tandem.blog> # Booking relation booking [roles schema_camper company user_profile campsite_type booking_status] 2024-01-18T16:48:07Z jordi fita mas <jordi@tandem.blog> # Booking relation
@v1 2024-01-22T17:26:01Z jordi fita mas <jordi@tandem.blog> # Version 1
campsite_type__check_in_out [campsite_type] 2024-01-22T17:36:56Z jordi fita mas <jordi@tandem.blog> # Add check_in and check_out fields to campsite_type
add_campsite_type [add_campsite_type@v1 campsite_type__check_in_out] 2024-01-22T17:58:51Z jordi fita mas <jordi@tandem.blog> # Add check_in and check_out parameters to add_campsite_type function
edit_campsite_type [edit_campsite_type@v1 campsite_type__check_in_out] 2024-01-22T18:04:34Z jordi fita mas <jordi@tandem.blog> # Add check_in and check_out parameters to edit_campsite_type function
campsite_type_i18n__check_in_out [campsite_type_i18n] 2024-01-22T18:07:21Z jordi fita mas <jordi@tandem.blog> # Add check_in and check_out fields to campsite_type_i18n
translate_campsite_type [translate_campsite_type@v1 campsite_type_i18n__check_in_out] 2024-01-22T18:14:26Z jordi fita mas <jordi@tandem.blog> # Add check_in and check_out parameters to translate_campsite_type function

View File

@ -9,15 +9,15 @@ set search_path to camper, public;
select plan(13); select plan(13);
select has_function('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean']); select has_function('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', '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_lang_is('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', '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 function_returns('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', '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 isnt_definer('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', '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 volatility_is('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', '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', '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', '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', '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[]); select function_privs_are('camper', 'add_campsite_type', array ['integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean'], 'authenticator', array[]::text[]);
set client_min_messages to warning; 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 lives_ok(
$$ select add_campsite_type(1, 3, 'Type A', '', '<p>Features</p>', '', '<!-- block --><h2>This is what, exactly?</h2><!-- /block --><p>Dunno</p>', '', 5, true) $$, $$ select add_campsite_type(1, 3, 'Type A', '', '<p>Features</p>', '', '<!-- block --><h2>This is what, exactly?</h2><!-- /block --><p>Dunno</p>', '', 'After 4 p.m.', '12 a.m.', 5, true) $$,
'Should be able to add a campsite type to the first company' 'Should be able to add a campsite type to the first company'
); );
select lives_ok( select lives_ok(
$$ select add_campsite_type(2, 4, 'Type B', '<p>One</p><p>Two</p>', '', '<p>Pricing</p>', '', '<p>More</p>', 2, false) $$, $$ select add_campsite_type(2, 4, 'Type B', '<p>One</p><p>Two</p>', '', '<p>Pricing</p>', '', '<p>More</p>', 'After 9 p.m.', '9 a.m.', 2, false) $$,
'Should be able to add a campsite type to the second company' 'Should be able to add a campsite type to the second company'
); );
select bag_eq( select bag_eq(
$$ 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 $$, $$ select company_id, media_id, name, spiel::text, info::text, facilities::text, description::text, additional_info::text, check_in, check_out, active, max_campers, dogs_allowed from campsite_type $$,
$$ values (1, 3, 'Type A', '', '<p>Features</p>', '', '<!-- block --><h2>This is what, exactly?</h2><!-- /block --><p>Dunno</p>', '', true, 5, true) $$ values (1, 3, 'Type A', '', '<p>Features</p>', '', '<!-- block --><h2>This is what, exactly?</h2><!-- /block --><p>Dunno</p>', '', 'After 4 p.m.', '12 a.m.', true, 5, true)
, (2, 4, 'Type B', '<p>One</p><p>Two</p>', '', '<p>Pricing</p>', '', '<p>More</p>', true, 2, false) , (2, 4, 'Type B', '<p>One</p><p>Two</p>', '', '<p>Pricing</p>', '', '<p>More</p>', 'After 9 p.m.', '9 a.m.', true, 2, false)
$$, $$,
'Should have added all two campsite type' 'Should have added all two campsite type'
); );

View File

@ -5,7 +5,7 @@ reset client_min_messages;
begin; begin;
select plan(86); select plan(96);
set search_path to camper, public; set search_path to camper, public;
@ -88,6 +88,18 @@ select col_type_is('campsite_type', 'dogs_allowed', 'boolean');
select col_not_null('campsite_type', 'dogs_allowed'); select col_not_null('campsite_type', 'dogs_allowed');
select col_hasnt_default('campsite_type', 'dogs_allowed'); select col_hasnt_default('campsite_type', 'dogs_allowed');
select has_column('campsite_type', 'check_in');
select col_type_is('campsite_type', 'check_in', 'text');
select col_not_null('campsite_type', 'check_in');
select col_has_default('campsite_type', 'check_in');
select col_default_is('campsite_type', 'check_in', '');
select has_column('campsite_type', 'check_out');
select col_type_is('campsite_type', 'check_out', 'text');
select col_not_null('campsite_type', 'check_out');
select col_has_default('campsite_type', 'check_out');
select col_default_is('campsite_type', 'check_out', '');
select has_column('campsite_type', 'active'); select has_column('campsite_type', 'active');
select col_type_is('campsite_type', 'active', 'boolean'); select col_type_is('campsite_type', 'active', 'boolean');
select col_not_null('campsite_type', 'active'); select col_not_null('campsite_type', 'active');

View File

@ -5,7 +5,7 @@ reset client_min_messages;
begin; begin;
select plan(43); select plan(51);
set search_path to camper, public; set search_path to camper, public;
@ -61,6 +61,16 @@ select col_type_is('campsite_type_i18n', 'additional_info', 'xml');
select col_not_null('campsite_type_i18n', 'additional_info'); select col_not_null('campsite_type_i18n', 'additional_info');
select col_hasnt_default('campsite_type_i18n', 'additional_info'); select col_hasnt_default('campsite_type_i18n', 'additional_info');
select has_column('campsite_type_i18n', 'check_in');
select col_type_is('campsite_type_i18n', 'check_in', 'text');
select col_not_null('campsite_type_i18n', 'check_in');
select col_hasnt_default('campsite_type_i18n', 'check_in');
select has_column('campsite_type_i18n', 'check_out');
select col_type_is('campsite_type_i18n', 'check_out', 'text');
select col_not_null('campsite_type_i18n', 'check_out');
select col_hasnt_default('campsite_type_i18n', 'check_out');
select * select *
from finish(); from finish();

View File

@ -9,15 +9,15 @@ set search_path to camper, public;
select plan(12); select plan(12);
select has_function('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean']); select has_function('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', '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_lang_is('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', '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 function_returns('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', '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 isnt_definer('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', '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 volatility_is('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', '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', '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', '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', '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[]); select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'authenticator', array[]::text[]);
set client_min_messages to warning; set client_min_messages to warning;
truncate campsite_type cascade; 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"};')) , (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, additional_info, max_campers, dogs_allowed, active) insert into campsite_type (company_id, slug, media_id, name, spiel, info, facilities, description, additional_info, check_in, check_out, max_campers, dogs_allowed, active)
values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', '<h1>1</h1>', '<p>info 1</p>', '<p>facilities A</p>', '<p>A</p>', '<p>Additional A</p>', 5, false, true) values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', '<h1>1</h1>', '<p>info 1</p>', '<p>facilities A</p>', '<p>A</p>', '<p>Additional A</p>', '', '', 5, false, true)
, (1, '9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type B', '<h2>2</h2>', '<p>info 2</p>', '<p>facilities B</p>', '<p>B</p>', '<p>Additional B</p>', 4, true, false) , (1, '9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type B', '<h2>2</h2>', '<p>info 2</p>', '<p>facilities B</p>', '<p>B</p>', '<p>Additional B</p>', '', '', 4, true, false)
; ;
select lives_ok( select lives_ok(
$$ select edit_campsite_type('87452b88-b48f-48d3-bb6c-0296de64164e', 4, 'Type 1', '<h3>A</h3>', '<p>Features A</p>', '<p>Pricing 1</p>', '<p>1</p>', '<p>Additional 1</p>', 2, true, false) $$, $$ select edit_campsite_type('87452b88-b48f-48d3-bb6c-0296de64164e', 4, 'Type 1', '<h3>A</h3>', '<p>Features A</p>', '<p>Pricing 1</p>', '<p>1</p>', '<p>Additional 1</p>', 'Check-in 1', 'Check-out 1', 2, true, false) $$,
'Should be able to edit the first type' 'Should be able to edit the first type'
); );
select lives_ok( select lives_ok(
$$ select edit_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', null, 'Type 2', '<h1>B</h1>', '<p>Features B</p>', '<p>Pricing 2</p>', '<p>2</p>', '<p>Additional 2</p>', 9, false, true) $$, $$ select edit_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', null, 'Type 2', '<h1>B</h1>', '<p>Features B</p>', '<p>Pricing 2</p>', '<p>2</p>', '<p>Additional 2</p>', 'Check-in 2', 'Check-out 2', 9, false, true) $$,
'Should be able to edit the second type' 'Should be able to edit the second type'
); );
select bag_eq( select bag_eq(
$$ 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 $$, $$ select slug::text, media_id, name, spiel::text, info::text, facilities::text, description::text, additional_info::text, check_in, check_out, max_campers, dogs_allowed, active from campsite_type $$,
$$ values ('87452b88-b48f-48d3-bb6c-0296de64164e', 4, 'Type 1', '<h3>A</h3>', '<p>Features A</p>', '<p>Pricing 1</p>', '<p>1</p>', '<p>Additional 1</p>', 2, true, false) $$ values ('87452b88-b48f-48d3-bb6c-0296de64164e', 4, 'Type 1', '<h3>A</h3>', '<p>Features A</p>', '<p>Pricing 1</p>', '<p>1</p>', '<p>Additional 1</p>', 'Check-in 1', 'Check-out 1', 2, true, false)
, ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type 2', '<h1>B</h1>', '<p>Features B</p>', '<p>Pricing 2</p>', '<p>2</p>', '<p>Additional 2</p>', 9, false, true) , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type 2', '<h1>B</h1>', '<p>Features B</p>', '<p>Pricing 2</p>', '<p>2</p>', '<p>Additional 2</p>', 'Check-in 2', 'Check-out 2', 9, false, true)
$$, $$,
'Should have updated all campsite types.' 'Should have updated all campsite types.'
); );

View File

@ -9,15 +9,15 @@ select plan(13);
set search_path to camper, public; set search_path to camper, public;
select has_function('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text']); select has_function('camper', 'translate_campsite_type', array['uuid', 'text', 'text', '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_lang_is('camper', 'translate_campsite_type', array['uuid', 'text', 'text', '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 function_returns('camper', 'translate_campsite_type', array['uuid', 'text', 'text', '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 isnt_definer('camper', 'translate_campsite_type', array['uuid', 'text', 'text', '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 volatility_is('camper', 'translate_campsite_type', array['uuid', 'text', 'text', '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', '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', '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', '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[]); select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'authenticator', array[]::text[]);
set client_min_messages to warning; 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"};')) , (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, additional_info, active, dogs_allowed, max_campers) insert into campsite_type (company_id, slug, media_id, name, spiel, info, facilities, description, additional_info, check_in, check_out, active, dogs_allowed, max_campers)
values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', '<h2>One</h2>', '<p>Features A</p>', '<p>Pricing A</p>', '<p>A</p>', '<p>Additional A</p>', true, false, 4) values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', '<h2>One</h2>', '<p>Features A</p>', '<p>Pricing A</p>', '<p>A</p>', '<p>Additional A</p>', '', '', true, false, 4)
, (1, '9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type B', '<h2>Two</h2>', '<p>Features B</p>', '<p>Pricing B</p>', '<p>B</p>', '<p>Additional B</p>', false, true, 5) , (1, '9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type B', '<h2>Two</h2>', '<p>Features B</p>', '<p>Pricing B</p>', '<p>B</p>', '<p>Additional B</p>', '', '', false, true, 5)
; ;
insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info) insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info, check_in, check_out)
select campsite_type_id, 'ca', 'tipusb', '<h2>dos</h2>', '<p>característiques b</p>', '<p>preus b</p>', '<p>B</p>', '<p>B addicional</p>' from campsite_type select campsite_type_id, 'ca', 'tipusb', '<h2>dos</h2>', '<p>característiques b</p>', '<p>preus b</p>', '<p>B</p>', '<p>B addicional</p>', 'entrada', 'sortida' from campsite_type
where slug = '9b6370f7-f941-46f2-bc6e-de455675bd0a' where slug = '9b6370f7-f941-46f2-bc6e-de455675bd0a'
; ;
select lives_ok( select lives_ok(
$$ select translate_campsite_type('87452b88-b48f-48d3-bb6c-0296de64164e', 'ca', 'Tipus A', null, '<p>Característiques A</p>', null, '<p>a</p>', null) $$, $$ select translate_campsite_type('87452b88-b48f-48d3-bb6c-0296de64164e', 'ca', 'Tipus A', null, '<p>Característiques A</p>', null, '<p>a</p>', null, 'CI1', null) $$,
'Should be able to translate the first type' 'Should be able to translate the first type'
); );
select lives_ok( select lives_ok(
$$ select translate_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'es', 'Tipo B', '<h2>Dos</h2>', null, '<p>Precios B</p>', null, '<p>B adicional</p>') $$, $$ select translate_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'es', 'Tipo B', '<h2>Dos</h2>', null, '<p>Precios B</p>', null, '<p>B adicional</p>', null, 'CO2') $$,
'Should be able to translate the second type' 'Should be able to translate the second type'
); );
select lives_ok( select lives_ok(
$$ select translate_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'ca', 'Tipus B', '<h2>Dos</h2>', '<p>Característiques B</p>', '<p>Preus B</p>', '<p>2</p>', '<p>2 addicional</p>') $$, $$ select translate_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'ca', 'Tipus B', '<h2>Dos</h2>', '<p>Característiques B</p>', '<p>Preus B</p>', '<p>2</p>', '<p>2 addicional</p>', 'E2', 'S2') $$,
'Should be able to overwrite the catalan translation of the second type' 'Should be able to overwrite the catalan translation of the second type'
); );
select bag_eq( select bag_eq(
$$ 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) $$, $$ select slug::text, lang_tag, i18n.name, i18n.spiel::text, i18n.info::text, i18n.facilities::text, i18n.description::text, i18n.additional_info::text, i18n.check_in, i18n.check_out from campsite_type_i18n as i18n join campsite_type using (campsite_type_id) $$,
$$ values ('87452b88-b48f-48d3-bb6c-0296de64164e', 'ca', 'Tipus A', '', '<p>Característiques A</p>', '', '<p>a</p>', '') $$ values ('87452b88-b48f-48d3-bb6c-0296de64164e', 'ca', 'Tipus A', '', '<p>Característiques A</p>', '', '<p>a</p>', '', 'CI1', '')
, ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'ca', 'Tipus B', '<h2>Dos</h2>', '<p>Característiques B</p>', '<p>Preus B</p>', '<p>2</p>', '<p>2 addicional</p>') , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'ca', 'Tipus B', '<h2>Dos</h2>', '<p>Característiques B</p>', '<p>Preus B</p>', '<p>2</p>', '<p>2 addicional</p>', 'E2', 'S2')
, ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'es', 'Tipo B', '<h2>Dos</h2>', '', '<p>Precios B</p>', '', '<p>B adicional</p>') , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'es', 'Tipo B', '<h2>Dos</h2>', '', '<p>Precios B</p>', '', '<p>B adicional</p>', '', 'CO2')
$$, $$,
'Should have added and updated all translations.' 'Should have added and updated all translations.'
); );

View File

@ -2,6 +2,6 @@
begin; begin;
select has_function_privilege('camper.add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean)', 'execute'); select has_function_privilege('camper.add_campsite_type(integer, integer, text, text, text, text, text, text, text, text, integer, boolean)', 'execute');
rollback; rollback;

View File

@ -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, text, integer, boolean)', 'execute');
rollback;

View File

@ -0,0 +1,11 @@
-- Verify camper:campsite_type__check_in_out on pg
begin;
select check_in
, check_out
from camper.campsite_type
where false
;
rollback;

View File

@ -0,0 +1,11 @@
-- Verify camper:campsite_type_i18n__check_in_out on pg
begin;
select check_in
, check_out
from camper.campsite_type_i18n
where false
;
rollback;

View File

@ -2,6 +2,6 @@
begin; begin;
select has_function_privilege('camper.edit_campsite_type(uuid, integer, text, 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, text, text, integer, boolean, boolean)', 'execute');
rollback; rollback;

View File

@ -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, text, integer, boolean, boolean)', 'execute');
rollback;

View File

@ -2,6 +2,6 @@
begin; begin;
select has_function_privilege('camper.translate_campsite_type(uuid, text, text, text, text, text, text, text)', 'execute'); select has_function_privilege('camper.translate_campsite_type(uuid, text, text, text, text, text, text, text, text, text)', 'execute');
rollback; rollback;

View File

@ -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, text)', 'execute');
rollback;

View File

@ -62,6 +62,32 @@
{{ with .Media -}} {{ with .Media -}}
{{ template "media-picker" . }} {{ template "media-picker" . }}
{{- end }} {{- end }}
{{ with .CheckIn -}}
<fieldset>
<legend>{{( pgettext "Check-in" "input")}}</legend>
{{ template "lang-selector" . }}
{{ range $lang, $input := . -}}
<label x-cloak x-show="lang === '{{ $lang }}'"><span>{{ $lang }}</span><br>
<input type="text" name="{{ $input.Name }}" value="{{ $input.Val }}"
{{ template "error-attrs" . }}><br>
</label>
{{- end }}
{{ template "error-message" . }}
</fieldset>
{{- end }}
{{ with .CheckOut -}}
<fieldset>
<legend>{{( pgettext "Check-out" "input")}}</legend>
{{ template "lang-selector" . }}
{{ range $lang, $input := . -}}
<label x-cloak x-show="lang === '{{ $lang }}'"><span>{{ $lang }}</span><br>
<input type="text" name="{{ $input.Name }}" value="{{ $input.Val }}"
{{ template "error-attrs" . }}><br>
</label>
{{- end }}
{{ template "error-message" . }}
</fieldset>
{{- end }}
{{ with .MaxCampers -}} {{ with .MaxCampers -}}
<label> <label>
{{( pgettext "Maximum number of campers" "input")}}<br> {{( pgettext "Maximum number of campers" "input")}}<br>

View File

@ -135,12 +135,12 @@
<h3 class="sr-only">{{( pgettext "Additional Information" "title" )}}</h3> <h3 class="sr-only">{{( pgettext "Additional Information" "title" )}}</h3>
<dl class="checkin-checkout"> <dl class="checkin-checkout">
<div> <div>
<dt>{{( pgettext "Check in" "time" )}}</dt> <dt>{{( pgettext "Check-in" "time" )}}</dt>
<dd>{{( gettext "4 p.m. to 9 p.m." )}}</dd> <dd>{{ .CheckIn }}</dd>
</div> </div>
<div> <div>
<dt>{{( pgettext "Check out" "time" )}}</dt> <dt>{{( pgettext "Check-out" "time" )}}</dt>
<dd>{{( gettext "10 a.m." )}}</dd> <dd>{{ .CheckOut }}</dd>
</div> </div>
</dl> </dl>
{{ .AdditionalInfo }} {{ .AdditionalInfo }}