Si è verificato un errore nell'elaborarazione del modello.
The following has evaluated to null or missing: ==> response.data.docs.getJSONObject(0) [in template "3572636#3572671#4339473" at line 24, column 24] ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign doc = response.data.docs.getJ... [in template "3572636#3572671#4339473" at line 24, column 9] ----
1<#import "_TEMPLATE_CONTEXT_/3572636/3574130/23609/3793037" as d40>
2
3<#setting url_escaping_charset="UTF-8">
4
5<#assign
6 PUTIL = objectUtil("com.liferay.portal.kernel.util.PortalUtil")
7 uuid = themeDisplay.getURLCurrent()?keep_after("-/c/n/")?keep_before("?")?keep_after_last("_")
8 langId = locale?keep_before("_")
9 contentType = "poi"
10 vueActions = ""
11 doc = ""
12 lat = "0"
13 lng = "0"
14 hasCoords = false
15/>
16
17<#assign currentUrl = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() />
18<#assign z=request.setAttribute("ogUrl","${currentUrl}")>
19
20<#if uuid?has_content>
21 <#assign response = d40.fetchData("https://guestapp.d40.it/v1/search/apt-trento/${contentType}/?uuid=${uuid}")>
22
23 <#if !response.error && response.data.docs?has_content>
24 <#assign doc = response.data.docs.getJSONObject(0)>
25
26 ${request.session.removeAttribute("circularCategories")}
27 ${request.session.setAttribute("circularCategories", doc.details.assetCategoryIds)}
28 </#if>
29</#if>
30
31<#if doc?has_content>
32 <#if doc.details?? && doc.details.name[langId]?has_content>
33 ${PUTIL.setPageTitle(doc.details.name[langId], request)}
34 </#if>
35
36 <#assign vueActions = "getFavorites();">
37
38 <#if doc.details.location.geoCoords.lat?has_content && doc.details.location.geoCoords.lon?has_content>
39 <#assign
40 hasCoords = true
41 lat = doc.details.location.geoCoords.lat
42 lng = doc.details.location.geoCoords.lon
43 vueActions = "getFavorites();buildMap(${lat}, ${lng})"
44 />
45 </#if>
46</#if>
47
48<style>
49 .swiper-button-next:after{
50 content: "";
51 }
52 .swiper-button-prev:after{
53 content: "";
54 }
55 .bg-darkgray{
56 background-color: #e5e5e5 !important;
57 }
58 .min-h-12{
59 min-height: 3rem;
60 }
61 .-ml-5{
62 margin-left: -5%;
63 }
64</style>
65
66<div v-scope id="${d40.portletNamespace}" @vue:mounted="${vueActions}" v-cloak>
67 <#if doc?has_content>
68 <#if themeDisplay.getLayout().getAncestors()?has_content>
69 <section id="breadcrumb" class="z-15 mt-25">
70 <div class="container">
71 <ol class="breadcrumb flex lg:justify-center">
72 <li class="pl-1 text-sm mr-2 relative">${d40.getLabel("sei_in")}:</li>
73
74 <li class="breadcrumb-item">
75 <a href="/" class="breadcrumb-link" title="Home">
76 <span class="breadcrumb-text-truncate text-dark underline">Home</span>
77 </a>
78 </li>
79
80 <#list themeDisplay.getLayout().getAncestors()?reverse as ancestor>
81 <li class="breadcrumb-item">
82 <a href="${ancestor.getFriendlyURL()}" class="breadcrumb-link" title="${d40.escape(ancestor.getHTMLTitle(locale))}">
83 <span class="breadcrumb-text-truncate text-dark underline">
84 ${d40.escape(ancestor.getHTMLTitle(locale))}
85 </span>
86 </a>
87 </li>
88 </#list>
89
90 <li class="breadcrumb-item active">
91 <span class="breadcrumb-text-truncate text-dark">
92 ${doc.details.name[langId]}
93 </span>
94 </li>
95 </ol>
96 </div>
97 </section>
98 </#if>
99
100 <section class="relative mt-20">
101 <div class="container">
102 <div class="row">
103 <div class="col-12 col-lg-7">
104 <div class="card-row flex-col lg:flex-row mb-10">
105 <div class="autofit-col autofit-col-expand order-2 lg:order-1">
106 <div class="autofit-section">
107 <p class="text-dark font-semibold font-heading text-3xl lg:text-4xl uppercase">
108 ${doc.details.name[langId]}
109 <#assign z=request.setAttribute("ogTitle","${doc.details.name[langId]}")>
110 </p>
111 </div>
112 </div>
113 <div class="autofit-col justify-start order-1 lg:order-2 mb-3 lg:mb-0">
114 <div class="autofit-section">
115 <div class="flex space-x-4">
116 <button type="button" v-if="isFavorite('${doc.uuid}')" @click="removeFavorite($event, '${doc.uuid}')" class="btn btn-link px-2">
117 <i class="fas fa-heart text-dark fa-2x"></i>
118 </button>
119 <button type="button" v-else @click="setFavorite($event, {id: '${doc.uuid}', contentJSON: {title: '${doc.details.name[langId]?js_string}', previewDescription: '', description: '', geoRef: '', previewPicture: '${d40.getDTNPreview(doc)}', viewUrl: '${d40.getDTNUrl(doc.details.name[langId], doc.uuid, contentType)}'}})" class="btn btn-link px-2">
120 <i class="fal fa-heart text-dark fa-2x"></i>
121 </button>
122
123 <button type="button" @click="share('${doc.details.name[langId]}', '')" class="btn btn-link px-2">
124 <i class="fas fa-share-alt text-dark fa-2x"></i>
125 </button>
126 </div>
127 </div>
128 </div>
129 </div>
130
131 <#if doc.timetables.timeDescription[langId]?has_content>
132 <div class="text-dark text-lg font-light mb-15 mt-5">
133 ${doc.timetables.timeDescription[langId]}
134 </div>
135 </#if>
136
137 <#if doc.details.description[langId]?has_content>
138 <div class="underline-grow text-dark font-light lg:text-lg leading-loose">
139 ${doc.details.description[langId]}
140
141 <#if doc.details.description[langId]?length lt 160>
142 <#assign
143 z=request.setAttribute("ogDesc","${htmlUtil.stripHtml(doc.details.description[langId])}")
144 />
145 <#else>
146 <#assign
147 z=request.setAttribute("ogDesc","${htmlUtil.stripHtml(doc.details.description[langId])?substring(0,160)}")
148 />
149 </#if>
150 </div>
151 </#if>
152 </div>
153
154 <div class="xl:absolute col-12 col-lg-5 xl:max-w-xl lg:right-0">
155 <div class="bg-light">
156 <div class="card-body px-5 pt-5 lg:px-10 lg:pt-10 pb-0">
157 <p class="text-dark font-bold uppercase text-lg mb-0">
158 ${d40.getLabel("informazioni_contatti")}
159 </p>
160 <#if doc.details.townLabel != "{}">
161 <p class="text-dark text-lg mb-0">
162 ${d40.getLabel("localita")}: <span class="text-capitalize">${doc.details.townLabel[langId]}</span>
163 </p>
164 </#if>
165 <#if doc.timetables.time_infos?has_content>
166 <p class="text-dark font-bold text-lg mb-0 mt-3">
167 ${d40.getLabel("date_apertura")}
168 </p>
169 </#if>
170 </div>
171
172 <#if doc.timetables.time_infos?has_content>
173 <div class="flex min-h-12">
174 <details class="bg-darkgray w-full lg:w-105% right-0 -ml-5">
175 <summary class="btn btn-link text-dark no-underline my-1 ml-12">
176 <i class="fal fa-calendar-alt"></i>
177 <span>${doc.timetables.time_infos.getJSONObject(0).date_from} - ${doc.timetables.time_infos.getJSONObject(0).time_from} - ${doc.timetables.time_infos.getJSONObject(0).time_to}</span>
178 <i class="fal fa-chevron-down fa-lg ml-5"></i>
179 </summary>
180
181 <div class="card-body px-5 lg:px-10">
182 <ul>
183 <#list doc.timetables.time_infos.iterator() as datetime>
184 <li class="text-dark mb-1">
185 ${d40.getLabel("dal")} ${datetime.date_from}
186 ${d40.getLabel("al")} ${datetime.date_to}
187 ${d40.getLabel("dalle")} ${datetime.time_from}
188 ${d40.getLabel("alle")} ${datetime.time_to}
189 </li>
190 </#list>
191 </ul>
192 </div>
193 </details>
194 </div>
195 </#if>
196 <div class="card-body px-5 lg:px-10">
197 <#if doc.contacts.getJSONObject(0).telephone?? && doc.contacts.getJSONObject(0).telephone?has_content>
198 <#list doc.contacts.getJSONObject(0).telephone.iterator() as phone>
199 <p class="text-dark text-lg mb-0">
200 Tel: ${phone}
201 </p>
202 </#list>
203 </#if>
204 <#if doc.contacts.getJSONObject(0).mail?? && doc.contacts.getJSONObject(0).mail?has_content>
205 <a href="mailto:${doc.contacts.getJSONObject(0).mail}" class="block no-underline text-dark text-lg space-x-2 mb-0">
206 <i class="far fa-envelope text-dark"></i>
207 <u>${doc.contacts.getJSONObject(0).mail}</u>
208 </a>
209 </#if>
210 <#if doc.contacts.getJSONObject(0).websiteUrl[langId]?? && doc.contacts.getJSONObject(0).websiteUrl[langId]?has_content>
211 <a href="${doc.contacts.getJSONObject(0).websiteUrl[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank">
212 <i class="far fa-external-link text-dark"></i>
213 <u>${d40.getLabel("sito_web")}</u>
214 </a>
215 </#if>
216
217 <#if langId == 'en'>
218 <#assign ri_url = "/contact-tourist-office-trento" />
219 <#elseif langId == 'de'>
220 <#assign ri_url = "/kontakt-info-anfrage-trento" />
221 <#else>
222 <#assign ri_url = "/richiesta-informazioni" />
223 </#if>
224
225 <a href="#contact-form" class="btn bg-green text-white font-bold uppercase px-4 py-2 rounded-0 mt-10">
226 ${d40.getLabel("richiedi_info")}
227 </a>
228 </div>
229
230 <#if hasCoords>
231 <div class="relative flex h-70">
232 <div class="absolute w-full lg:w-105% h-full right-0">
233 <div id="suggesto-map" class="monochrome-map size-full border-0"></div>
234 </div>
235 </div>
236 <div class="card-body p-5 lg:px-10">
237 <!-- https://www.google.com/maps/@${lat},${lng},14z -->
238 <a href="https://www.google.com/maps/dir/?api=1&travelmode=driving&destination=${lat},${lng}" class="d-block no-underline space-x-5" target="_blank">
239 <span class="font-bold text-dark uppercase">
240 ${d40.getLabel("indicazioni_stradali")}
241 </span>
242 <img src="${d40.icons_folder}/arrow_circle-dark.svg" class="w-20" />
243 </a>
244 </div>
245 </#if>
246 </div>
247 </div>
248 </div>
249 </div>
250 </section>
251
252 <#if doc.details.images?has_content>
253 <#assign usePreview = false>
254
255 <section id="gallery" class="relative overflow-x-hidden mt-20 lg:mt-40">
256 <div class="container">
257 <p class="text-dark uppercase text-lg lg:text-3xl mb-7">
258 ${d40.getLabel("galleria_immagini")}
259 </p>
260
261 <div class="swiper-container">
262 <div class="swiper-wrapper">
263 <#if doc.details.cover != "[]">
264 <#assign usePreview = true>
265
266 <#list doc.details.cover.iterator() as pic>
267 <div class="swiper-slide">
268 <a href="javascript:void(0);" class="card shadow-none border-0 bg-transparent no-underline" data-toggle="modal" data-target="#lightbox-modal" data-slider="${pic?index}" data-senna-off="true">
269 <div class="relative">
270 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload rounded-custom size-full fit-cover" alt="" />
271 </div>
272 </a>
273 </div>
274 <#-- assign z=request.setAttribute("ogImage","${pic[langId]}")-->
275 <#assign z=request.setAttribute("ogImage","${d40.getKitPrefix(pic[langId], 'n-preview_h')}")>
276
277 <#break>
278 </#list>
279 </#if>
280
281 <#list doc.details.images.iterator() as pic>
282 <#if usePreview>
283 <#assign counter = pic?counter>
284 <#else>
285 <#assign counter = pic?index>
286 </#if>
287
288 <div class="swiper-slide">
289 <a href="javascript:void(0);" class="card shadow-none border-0 bg-transparent no-underline" data-toggle="modal" data-target="#lightbox-modal" data-slider="${counter}" data-senna-off="true">
290 <div class="relative">
291 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload rounded-custom size-full fit-cover" alt="" />
292 </div>
293 </a>
294 </div>
295 </#list>
296 </div>
297 </div>
298 </div>
299 <div class="btn-square absolute btn-prev bg-white left-0">
300 <span class="sr-only">${d40.getLabel("precedente")}</span>
301 <i class="fas fa-chevron-left text-dark w-6 h-6"></i>
302 </div>
303 <div class="btn-square absolute btn-next bg-white right-0">
304 <span class="sr-only">${d40.getLabel("successivo")}</span>
305 <i class="fas fa-chevron-right text-dark w-6 h-6"></i>
306 </div>
307 </section>
308
309 <div id="lightbox-modal" tabindex="-1" role="dialog" class="modal fade">
310 <div class="modal-dialog modal-full-screen inset-0 border-0 shadow-none">
311 <div class="modal-content bg-transparent">
312 <div class="modal-body overflow-hidden">
313 <div class="absolute top-0 right-0 z-5">
314 <button type="button" data-dismiss="modal" class="btn btn-monospaced btn-secondary m-3">
315 <span class="sr-only">${d40.getLabel("chiudi")}</span>
316 <i class="fal fa-times fa-lg"></i>
317 </button>
318 </div>
319
320 <#-- lightbox -->
321 <div id="lightbox-swiper" class="swiper-container h-75 my-auto">
322 <div class="swiper-button-prev w-12 h-12">
323 <span class="sticker sticker-circle bg-green size-full">
324 <span class="sticker-overlay">
325 <i class="fas fa-chevron-left fa-2x text-white"></i>
326 </span>
327 </span>
328 </div>
329
330 <div class="swiper-button-next w-12 h-12">
331 <span class="sticker sticker-circle bg-green size-full">
332 <span class="sticker-overlay">
333 <i class="fas fa-chevron-right fa-2x text-white"></i>
334 </span>
335 </span>
336 </div>
337
338 <div class="swiper-wrapper h-full">
339 <#if doc.details.cover != "[]">
340 <#list doc.details.cover.iterator() as pic>
341 <div class="swiper-slide h-full">
342 <img data-src="${d40.getKitPrefix(pic[langId], 'n-full_hd')}" loading="lazy" class="lazyload flex h-full object-contain mx-auto" alt="">
343 </div>
344 <#break>
345 </#list>
346 </#if>
347
348 <#list doc.details.images.iterator() as pic>
349 <div class="swiper-slide h-full">
350 <img data-src="${d40.getKitPrefix(pic[langId], 'n-full_hd')}" loading="lazy" class="lazyload flex h-full object-contain mx-auto" alt="">
351 </div>
352 </#list>
353 </div>
354 </div>
355
356 <#-- thumbnails -->
357 <div id="thumbnail-swiper" class="swiper-container" thumbsSlider="">
358 <div class="swiper-wrapper">
359 <#if doc.details.cover != "[]">
360 <#list doc.details.cover.iterator() as pic>
361 <div class="swiper-slide">
362 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload object-cover cursor-pointer size-full" alt="">
363 </div>
364 <#break>
365 </#list>
366 </#if>
367
368 <#list doc.details.images.iterator() as pic>
369 <div class="swiper-slide">
370 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload object-cover cursor-pointer size-full" alt="">
371 </div>
372 </#list>
373 </div>
374 </div>
375 </div>
376 </div>
377 </div>
378 </div>
379 </#if>
380
381 <#-- SEZIONE NON USATA
382 <section class="mt-20">
383 <div class="container">
384 <div class="bg-light max-w-xl p-5 lg:p-10">
385 <div class="card-row space-x-5">
386 <div class="autofit-col">
387 <div class="autofit-section">
388 <i class="fas fa-download text-dark w-7 h-7"></i>
389 </div>
390 </div>
391 <div class="autofit-col autofit-col-expand">
392 <div class="autofit-section">
393 <p class="text-dark font-bold text-lg lg:text-xl uppercase mb-0"> Programma completo </p>
394 </div>
395 </div>
396 </div>
397 </div>
398
399 <div class="row mt-10 lg:mt-20">
400 <div class="col-12 col-lg-8">
401 <div class="space-y-10">
402 <p class="text-dark uppercase text-lg lg:text-3xl">
403 ${d40.getLabel("dettagli")}
404 </p>
405 <div class="space-y-5">
406 <div class="row">
407 <div class="col-12 col-md-3 col-lg-2">
408 <p class="text-dark font-bold uppercase">Data</p>
409 </div>
410 <div class="col-12 col-md-9 col-lg-10">
411 <div class="text-dark font-light text-lg">
412 Dettagli
413 </div>
414 </div>
415 </div>
416 </div>
417 </div>
418 </div>
419 </div>
420 </div>
421 </section>
422 -->
423
424 <section class="mt-20">
425 <div class="container">
426 <div class="bg-light">
427 <div class="space-y-10 p-5 lg:p-10">
428 <p class="text-dark uppercase text-lg lg:text-3xl mb-0">
429 ${d40.getLabel("organizzazione")}
430 </p>
431 <div class="space-y-2">
432 <#if doc.contacts.getJSONObject(0).address.fulltext?? && doc.contacts.getJSONObject(0).address.fulltext?has_content>
433 <p class="text-dark mb-0">
434 ${doc.contacts.getJSONObject(0).address.fulltext}
435 </p>
436 </#if>
437
438 <#if doc.contacts.getJSONObject(0).mail?? && doc.contacts.getJSONObject(0).mail?has_content>
439 <a href="mailto:${doc.contacts.getJSONObject(0).mail}" class="d-block text-dark underline">
440 ${doc.contacts.getJSONObject(0).mail}
441 </a>
442 </#if>
443
444 <#if doc.contacts.getJSONObject(0).telephone?? && doc.contacts.getJSONObject(0).telephone?has_content>
445 <#list doc.contacts.getJSONObject(0).telephone.iterator() as phone>
446 <p class="text-dark mb-0">
447 <span class="font-bold">${d40.getLabel("telefono")}:</span>
448 ${phone}
449 </p>
450 </#list>
451 </#if>
452 </div>
453 </div>
454 </div>
455 </div>
456 </section>
457
458 <#--
459 <section class="mt-10">
460 <div class="container">
461 <p class="text-dark uppercase text-lg lg:text-3xl mb-7"> Info sezione </p>
462 <p class="text-dark text-lg font-light mb-0"> 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>
463 </div>
464 </section>
465 -->
466 <#else>
467 <div class="text-center mt-35">
468 <p class="text-dark">
469 ${d40.getLabel("errore_caricamento_contenuto")}
470 </p>
471 </div>
472 </#if>
473</div>
474
475<script type="module">
476 import { createApp } from "https://cdnjs.cloudflare.com/ajax/libs/petite-vue/0.4.1/petite-vue.es.min.js";
477
478 createApp({
479 isMobile: window.innerWidth < 768,
480 favorites: [],
481 getFavorites() {
482 if(localStorage.getItem("favorites") !== null) {
483 this.favorites = JSON.parse(localStorage.getItem("favorites"));
484 }
485 },
486 setFavorite(e, item) {
487 e.preventDefault();
488 this.getFavorites();
489
490 var newFavorite = {
491 id: item.id,
492 contentJSON: {
493 title: item.contentJSON.title,
494 previewDescription: item.contentJSON.previewDescription,
495 description: item.contentJSON.description,
496 geoRef: item.contentJSON.geoRef,
497 previewPicture: item.contentJSON.previewPicture,
498 viewUrl: item.contentJSON.viewUrl,
499 type: "lfr",
500 }
501 };
502
503 this.favorites.push(newFavorite);
504 this.saveFavorites();
505 },
506 removeFavorite(e, itemId) {
507 e.preventDefault();
508 this.favorites = this.favorites.filter((obj) => obj.id !== itemId);
509 this.saveFavorites();
510 },
511 saveFavorites() {
512 localStorage.setItem("favorites", JSON.stringify(this.favorites));
513 },
514 isFavorite(itemId) {
515 if (this.favorites.some((e) => e.id == itemId)) {
516 return true;
517 }
518
519 return false;
520 },
521 buildMap(lat, lng) {
522 var map = new SuggestoMap("suggesto-map"),
523 location = [parseFloat(lat), parseFloat(lng)];
524
525 var svgIcon = L.divIcon({
526 html: `
527 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44.537 64.343">
528 <path d="M32.952,68c-4.491-5.935-9.221-11.692-12.837-18.251-3.4-6.175-5.892-12.453-4.094-19.725,2.422-9.787,12.253-17.363,22.112-16.878,11.322.558,20.189,8.638,21.649,19.385.8,5.867-1.25,10.892-3.84,15.837A105.38,105.38,0,0,1,43.958,65.889c-.687.844-1.309,1.739-1.96,2.611-.953,1.06-1.971,2.068-2.841,3.191-.965,1.245-1.729,1.629-2.844.1A50.506,50.506,0,0,0,32.952,68m4.722-46.328A14.156,14.156,0,0,0,23.76,35.59c-.168,7.053,6.542,13.748,13.813,13.783A14.234,14.234,0,0,0,51.46,35.693,14.138,14.138,0,0,0,37.674,21.676" transform="translate(-15.419 -13.129)" fill="#5098c6"/>
529 <path d="M31.941,63.206A50.288,50.288,0,0,1,35.3,67c1.116,1.526,1.878,1.142,2.844-.1.87-1.123,1.889-2.132,2.841-3.191a8.579,8.579,0,0,1,5.414,2.22c1.659,1.642,1.586,3.631-.455,4.627a21.209,21.209,0,0,1-16.871.723c-1.611-.565-3.293-1.51-3.092-3.645.19-2.018,1.855-2.718,3.511-3.342.833-.315,1.791-.363,2.447-1.079" transform="translate(-14.408 -8.331)" fill="#222"/>
530 <path d="M36.946,20.929A14.137,14.137,0,0,1,50.732,34.944,14.236,14.236,0,0,1,36.844,48.626c-7.27-.036-13.98-6.732-13.813-13.783A14.157,14.157,0,0,1,36.946,20.929m-.023,5.445a8.4,8.4,0,1,0,8.394,8.22,8.5,8.5,0,0,0-8.394-8.22" transform="translate(-14.69 -12.381)" fill="#fdfcf9"/>
531 <path d="M36.45,25.9a8.4,8.4,0,0,1,.077,16.809A8.405,8.405,0,1,1,36.45,25.9" transform="translate(-14.218 -11.905)" fill="#222"/>
532 </svg>`,
533 className: "",
534 iconSize: [44.537, 64.343],
535 iconAnchor: [22.287, 64.343],
536 });
537
538 var mapData = {
539 tilelayer: "osm",
540 gestureHandling: true,
541 fitBounds: false,
542 mapcenter: location,
543 zoom: 15,
544 markersFilter: "*",
545 markers: [],
546 layers: []
547 };
548
549 map.sm.createMap(mapData);
550
551 L.circleMarker(location, {
552 radius: 0,
553 color: "#000",
554 fillOpacity: 0,
555 weight: 0
556 }).addTo(map.sm.lmap);
557
558 L.marker(location, {
559 icon: svgIcon
560 }).addTo(map.sm.lmap);
561 },
562 share(title, desc, mode = "legacy") {
563 if (this.isMobile) {
564 var shareData = {
565 title: title,
566 text: desc,
567 url: window.location.href.replaceAll("{", "%7B").replaceAll("}", "%7D")
568 };
569
570 try {
571 navigator.share(shareData);
572 } catch (err) {
573 console.error("Error sharing: " + err);
574
575 if (mode == "legacy") {
576 this.legacyShare();
577 } else if (mode == "social") {
578 this.socialShare(title, desc);
579 }
580 }
581 } else {
582 if (mode == "legacy") {
583 this.legacyShare();
584 } else if (mode == "social") {
585 this.socialShare(title, desc);
586 }
587 }
588 },
589 legacyShare() {
590 var clip = document.createElement("input"),
591 toCopy = window.location.href.replaceAll("{", "%7B").replaceAll("}", "%7D");
592
593 document.body.appendChild(clip);
594 clip.value = toCopy;
595 clip.select();
596 clip.setSelectionRange(0, 999999);
597
598 navigator.clipboard.writeText(clip.value);
599 document.body.removeChild(clip);
600
601 alert("Link copiato");
602 },
603 socialShare(title, desc, image = "") {
604 var link = "#",
605 winHeight = 450,
606 winWidth = 600,
607 winTop = window.screen.height / 2 - winHeight / 2,
608 winLeft = window.screen.width / 2 - winWidth / 2,
609 params = "scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=" + winWidth + ",height=" + winHeight + ",left=" + winLeft + ",top=" + winTop;
610
611 link = "http://www.facebook.com/sharer.php?s=100&p[title]=" + encodeURIComponent(title) + "&p[summary]=" + encodeURIComponent(desc) + "&p[url]=" + window.location.href + "&p[images][0]=" + image;
612
613 window.open(link, "Facebook", params);
614 }
615 }).mount("#${d40.portletNamespace}");
616</script>
617
618<#if doc?has_content>
619 <script>
620 document.addEventListener("DOMContentLoaded", function(){
621
622 document.querySelectorAll('a[href^="#contact"]').forEach(anchor => {
623 anchor.addEventListener('click', function (e) {
624 e.preventDefault();
625
626 document.querySelector(this.getAttribute('href')).scrollIntoView({
627 behavior: 'smooth'
628 });
629 });
630 });
631
632 if(${(doc.details.images?has_content)?c}){
633 new Swiper("#gallery .swiper-container", {
634 slidesPerView: 1,
635 spaceBetween: 50,
636 centerSlides: true,
637 centerInsufficientSlides: true,
638 breakpoints: {
639 768: {
640 slidesPerView: 2,
641 spaceBetween: 25
642 },
643 992: {
644 slidesPerView: 3,
645 spaceBetween: 25
646 }
647 },
648 navigation: {
649 prevEl: "#gallery .btn-prev",
650 nextEl: "#gallery .btn-next"
651 }
652 });
653
654 var thumbnails = new Swiper("#thumbnail-swiper", {
655 spaceBetween: 10,
656 slidesPerView: 2,
657 centerInsufficientSlides: true,
658 freeMode: true,
659 watchSlidesVisibility: true,
660 watchSlidesProgress: true,
661 breakpoints: {
662 768: {
663 slidesPerView: 3
664 },
665 992: {
666 slidesPerView: 4
667 },
668 1200: {
669 slidesPerView: 5
670 }
671 },
672 });
673
674 var lightbox = new Swiper("#lightbox-swiper", {
675 spaceBetween: 10,
676 autoHeight: true,
677 observer: true,
678 observeSlideChildren: true,
679 keyboard: {
680 enabled: true
681 },
682 navigation: {
683 nextEl: ".swiper-button-next",
684 prevEl: ".swiper-button-prev"
685 },
686 thumbs: {
687 swiper: thumbnails
688 }
689 });
690
691 $("#lightbox-modal").on("shown.bs.modal", function(e){
692 lightbox.update();
693 thumbnails.update();
694 lightbox.slideTo($(e.relatedTarget).data("slider"));
695 lightbox.update();
696 });
697
698 $("#lightbox-modal .swiper-wrapper").on("click", function(e){
699 if($(e.target).attr("class").includes("swiper-slide")){
700 $("#lightbox-modal").modal("hide");
701 }
702 });
703
704
705 if ($(window).width() > 991) {
706 var left_col_h = $(".relative.mt-20 > .container > .row > .col-lg-7").outerHeight();
707 var right_col_h = $(".relative.mt-20 > .container > .row > .col-lg-5").outerHeight();
708 var marg_h = right_col_h - left_col_h + 40;
709
710 if(right_col_h > left_col_h)
711 {
712 $('#gallery').removeClass('lg:mt-40 mt-20');
713 $('#gallery').css({'margin-top':marg_h+'px'});
714 }
715 }
716 }
717 });
718 </script>
719</#if>
L'invio della richiesta è andata a buon fine
L'invio della richiesta non è andata a buon fine
Acconsento al passaggio dei miei dati personali al destinatario della mia richiesta per l'invio delle informazioni richieste (privacy policy)