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#4212428" at line 21, 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#4212428" at line 21, 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_after_last("_")
8 langId = locale?keep_before("_")
9 contentType = "event"
10 vueActions = ""
11 doc = ""
12 lat = "0"
13 lng = "0"
14 hasCoords = false
15/>
16
17<#if uuid?has_content>
18 <#assign response = d40.fetchData("https://guestapp.d40.it/v1/search/apt-trento/${contentType}/?uuid=${uuid}")>
19
20 <#if !response.error && response.data.docs?has_content>
21 <#assign doc = response.data.docs.getJSONObject(0)>
22
23 ${request.session.removeAttribute("circularCategories")}
24 ${request.session.setAttribute("circularCategories", doc.details.assetCategoryIds)}
25 </#if>
26</#if>
27
28<#if doc?has_content>
29 <#if doc.details?? && doc.details.name[langId]?has_content>
30 ${PUTIL.setPageTitle(doc.details.name[langId], request)}
31 </#if>
32
33 <#assign vueActions = "getFavorites();">
34
35 <#if doc.details.location.geoCoords.lat?has_content && doc.details.location.geoCoords.lon?has_content>
36 <#assign
37 hasCoords = true
38 lat = doc.details.location.geoCoords.lat
39 lng = doc.details.location.geoCoords.lon
40 vueActions = "getFavorites();buildMap(${lat}, ${lng})"
41 />
42 </#if>
43</#if>
44
45<style>
46 .swiper-button-next:after{
47 content: "";
48 }
49 .swiper-button-prev:after{
50 content: "";
51 }
52 .bg-darkgray{
53 background-color: #e5e5e5 !important;
54 }
55 .min-h-12{
56 min-height: 3rem;
57 }
58 .-ml-5{
59 margin-left: -5%;
60 }
61</style>
62
63<div v-scope id="${d40.portletNamespace}" @vue:mounted="${vueActions}" v-cloak>
64 <#if doc?has_content>
65 <#if themeDisplay.getLayout().getAncestors()?has_content>
66 <section id="breadcrumb" class="z-15 mt-25">
67 <div class="container">
68 <ol class="breadcrumb flex lg:justify-center">
69 <li class="pl-1 text-sm mr-2 relative">${d40.getLabel("sei_in")}:</li>
70
71 <li class="breadcrumb-item">
72 <a href="/" class="breadcrumb-link" title="Home">
73 <span class="breadcrumb-text-truncate text-dark underline">Home</span>
74 </a>
75 </li>
76
77 <#list themeDisplay.getLayout().getAncestors()?reverse as ancestor>
78 <li class="breadcrumb-item">
79 <a href="${ancestor.getFriendlyURL()}" class="breadcrumb-link" title="${d40.escape(ancestor.getHTMLTitle(locale))}">
80 <span class="breadcrumb-text-truncate text-dark underline">
81 ${d40.escape(ancestor.getHTMLTitle(locale))}
82 </span>
83 </a>
84 </li>
85 </#list>
86
87 <li class="breadcrumb-item active">
88 <span class="breadcrumb-text-truncate text-dark">
89 ${doc.details.name[langId]}
90 </span>
91 </li>
92 </ol>
93 </div>
94 </section>
95 </#if>
96
97 <section class="relative mt-20">
98 <div class="container">
99 <div class="row">
100 <div class="col-12 col-lg-7">
101 <div class="card-row flex-col lg:flex-row mb-10">
102 <div class="autofit-col autofit-col-expand order-2 lg:order-1">
103 <div class="autofit-section">
104 <p class="text-dark font-semibold font-heading text-3xl lg:text-4xl uppercase">
105 ${doc.details.name[langId]}
106 </p>
107 </div>
108 </div>
109 <div class="autofit-col justify-start order-1 lg:order-2 mb-3 lg:mb-0">
110 <div class="autofit-section">
111 <div class="flex space-x-4">
112 <button type="button" v-if="isFavorite('${doc.uuid}')" @click="removeFavorite($event, '${doc.uuid}')" class="btn btn-link px-2">
113 <i class="fas fa-heart text-dark fa-2x"></i>
114 </button>
115 <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">
116 <i class="fal fa-heart text-dark fa-2x"></i>
117 </button>
118
119 <button type="button" @click="share('${doc.details.name[langId]}', '')" class="btn btn-link px-2">
120 <i class="fas fa-share-alt text-dark fa-2x"></i>
121 </button>
122 </div>
123 </div>
124 </div>
125 </div>
126
127 <#if doc.details.description[langId]?has_content>
128 <div class="underline-grow text-dark font-light lg:text-lg leading-loose">
129 ${doc.details.description[langId]}
130 </div>
131 </#if>
132
133 <#if doc.timetables.timeDescription[langId]?has_content>
134 <div class="text-dark text-lg font-light mb-5 mt-10">
135 ${doc.timetables.timeDescription[langId]?keep_before("<br><p><b>")}
136 </div>
137 </#if>
138
139 <#-- <#if d40.isDev> -->
140 <#if doc.booking?has_content>
141 <#if doc.booking.bookable?has_content && doc.booking.bookable>
142 <#if doc.booking.standartPrices?has_content>
143 <#attempt>
144 <div class="text-dark text-lg font-light mb-5 mt-10">
145 <#list doc.booking.standartPrices.iterator() as single_price >
146 <#if single_price[langId]?has_content>
147
148 <#if single_price?index == 0>
149 <p class="mt-3"><b>${d40.getLabel("costo_biglietto")}:</b></p>
150 <ul style="padding-left:0;list-style: none;">
151 </#if>
152
153 <li>
154 • ${single_price[langId]}
155 </li>
156 </#if>
157 </#list>
158 </ul>
159 </div>
160 <#recover>
161 <div style="display:none !important;"></div>
162 </#attempt>
163 </#if>
164 </#if>
165 </#if>
166 <#-- </#if> -->
167
168 </div>
169
170 <div class="xl:absolute col-12 col-lg-5 xl:max-w-xl lg:right-0">
171 <div class="bg-light">
172 <div class="card-body px-5 pt-5 lg:px-10 lg:pt-10 pb-0">
173 <p class="text-dark font-bold uppercase text-lg mb-0">
174 ${d40.getLabel("informazioni_contatti")}
175 </p>
176 <#if doc.details.townLabel != "{}">
177 <p class="text-dark text-lg mb-0">
178 ${d40.getLabel("localita")}: <span class="text-capitalize">${doc.details.townLabel[langId]}</span>
179 </p>
180 </#if>
181 <#if doc.details.location.address.fulltext?? && doc.details.location.address.fulltext?has_content>
182 <p class="text-dark text-lg mb-0">
183 ${doc.details.location.address.fulltext}
184 </p>
185 </#if>
186 <#if doc.timetables.timeInfos?has_content>
187 <p class="text-dark font-bold text-lg mb-0 mt-3">
188 ${d40.getLabel("date_evento")}
189 </p>
190 </#if>
191 </div>
192
193 <#if doc.timetables.timeInfos?has_content>
194 <div class="flex min-h-12">
195 <details class="bg-darkgray w-full lg:w-105% right-0 -ml-5">
196 <summary class="btn btn-link text-dark no-underline my-1 ml-12">
197 <i class="fal fa-calendar-alt"></i>
198
199 <#attempt>
200 <#assign day_count = 0>
201
202 <#list doc.timetables.timeInfos.getJSONObject(0).openingDays.iterator()?keys as single_day >
203 <#assign day_count += 1>
204 </#list>
205
206 <div style="display:none !important;">
207 ${jsonFactoryUtil.looseSerialize(day_count)}
208 </div>
209 <#recover>
210 <#assign test = doc.timetables.timeInfos.getJSONObject(0).openingDays />
211 <div style="display:none !important;">
212
213 </div>
214 </#attempt>
215
216
217 <#assign
218 split_fdf = doc.timetables.timeInfos.getJSONObject(0).dateFrom?split('-')
219 split_fdt = doc.timetables.timeInfos.getJSONObject(0).dateTo?split('-')
220 fdf = split_fdf[2]+"."+split_fdf[1]+"."+split_fdf[0]
221 fdt = split_fdt[2]+"."+split_fdt[1]+"."+split_fdt[0]
222 ftf = doc.timetables.timeInfos.getJSONObject(0).timeFrom
223 ftt = doc.timetables.timeInfos.getJSONObject(0).timeTo
224 />
225
226 <#if fdf == fdt>
227 ${fdf}
228 <#else>
229 ${d40.getLabel("dal")} ${fdf} ${d40.getLabel("al")} ${fdt}
230 </#if>
231
232 <i class="fal fa-chevron-down fa-lg ml-5"></i>
233 </summary>
234
235 <#if doc.timetables.timeDescription[langId]?has_content>
236 <div class="card-body px-5 lg:px-15">
237 <div class="text-dark">
238 ${doc.timetables.timeDescription[langId]?keep_after('<br>')?keep_before("<br><p><b>")}
239 </div>
240 </div>
241 </#if>
242
243 <#-- <#if d40.isDev> -->
244 <#if doc.booking?has_content>
245 <#if doc.booking.bookable?has_content && doc.booking.bookable>
246 <#if doc.booking.standartPrices?has_content>
247 <#attempt>
248 <div class="card-body px-5 lg:px-15">
249 <#list doc.booking.standartPrices.iterator() as single_price >
250 <#if single_price[langId]?has_content>
251
252 <#if single_price?index == 0>
253 <p class="mt-3"><b>${d40.getLabel("costo_biglietto")}:</b></p>
254 <ul style="padding-left:0;list-style: none;">
255 </#if>
256
257 <li>
258 • ${single_price[langId]}
259 </li>
260 </#if>
261 </#list>
262 </ul>
263 </div>
264 <#recover>
265 <div style="display:none !important;"></div>
266 </#attempt>
267 </#if>
268 </#if>
269 </#if>
270 <#-- </#if> -->
271
272 <div class="card-body px-5 lg:px-10" style="display:none">
273 <ul>
274 <#list doc.timetables.timeInfos.iterator() as datetime>
275 <li class="text-dark mb-1">
276
277 <#assign
278 split_df = datetime.dateFrom?split('-')
279 split_dt = datetime.dateTo?split('-')
280 df = split_df[2]+"."+split_df[1]+"."+split_df[0]
281 dt = split_dt[2]+"."+split_dt[1]+"."+split_dt[0]
282 tf = datetime.timeFrom
283 tt = datetime.timeTo
284 />
285
286 <#if df == dt>
287 ${d40.getLabel("il")} ${df} - ${tf} - ${tt}
288 <#else>
289 ${d40.getLabel("dal")} ${df} ${d40.getLabel("al")} ${dt} - ${tf} - ${tt}
290 </#if>
291 </li>
292 </#list>
293 </ul>
294 </div>
295 </details>
296 </div>
297 </#if>
298
299 <div class="card-body px-5 lg:px-10">
300 <#if doc.contacts.getJSONObject(0).address.fulltext?? && doc.contacts.getJSONObject(0).address.fulltext?has_content>
301 <p class="text-dark font-bold uppercase text-lg mb-0">
302 ${d40.getLabel("organizzazione")}
303 </p>
304 </#if>
305
306 <#if doc.contacts.getJSONObject(0).supplierName?? && doc.contacts.getJSONObject(0).supplierName?has_content>
307 <p class="text-dark text-lg mb-1 font-bold">
308 ${doc.contacts.getJSONObject(0).supplierName}
309 </p>
310 </#if>
311
312 <#if doc.contacts.getJSONObject(0).address.fulltext?? && doc.contacts.getJSONObject(0).address.fulltext?has_content>
313 <p class="text-dark text-lg mb-1">
314 ${doc.contacts.getJSONObject(0).address.fulltext}
315 </p>
316 </#if>
317
318 <#if doc.contacts.getJSONObject(0).telephone?? && doc.contacts.getJSONObject(0).telephone?has_content>
319 <#list doc.contacts.getJSONObject(0).telephone.iterator() as phone>
320 <#if phone?? && phone?has_content>
321 <a href="tel:${phone}" class="block no-underline text-dark text-lg space-x-2 mb-0">
322 <#assign clear_phone = phone?replace('+39', '')/>
323 <#if clear_phone?starts_with("0461")>
324 <#assign display_phone = clear_phone?replace('0461', '0461 ')/>
325 <#else>
326 <#attempt>
327 <#assign
328 pre_chunk = clear_phone[0..2]
329 display_phone = pre_chunk+" "+clear_phone[3..]
330 />
331 <#recover>
332 </#attempt>
333 </#if>
334
335 <#if display_phone?? && display_phone?has_content>
336 <i class="far fa-phone text-dark"></i>
337 <u>${display_phone}</u>
338 </#if>
339 </a>
340 </#if>
341 </#list>
342 </#if>
343 <#if doc.contacts.getJSONObject(0).mail?? && doc.contacts.getJSONObject(0).mail?has_content>
344 <a href="mailto:${doc.contacts.getJSONObject(0).mail}" class="block no-underline text-dark text-lg space-x-2 mb-0">
345 <i class="far fa-envelope text-dark"></i>
346 <u>${doc.contacts.getJSONObject(0).mail}</u>
347 </a>
348 </#if>
349 <#if doc.contacts.getJSONObject(0).websiteUrl[langId]?? && doc.contacts.getJSONObject(0).websiteUrl[langId]?has_content>
350 <a href="${doc.contacts.getJSONObject(0).websiteUrl[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank">
351 <i class="far fa-external-link text-dark"></i>
352 <u>${d40.getLabel("sito_web")}</u>
353 </a>
354 </#if>
355
356 <#if doc.contacts.getJSONObject(0).socialRefs.facebook?? && doc.contacts.getJSONObject(0).socialRefs.facebook?has_content>
357 <a href="${doc.contacts.getJSONObject(0).socialRefs.facebook[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank">
358 <i class="fab fa-facebook-square text-dark"></i>
359 <u>facebook</u>
360 </a>
361 </#if>
362
363 <#if doc.contacts.getJSONObject(0).socialRefs.twitter?? && doc.contacts.getJSONObject(0).socialRefs.twitter?has_content>
364 <a href="${doc.contacts.getJSONObject(0).socialRefs.twitter[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank">
365 <i class="fab fa-twitter-square text-dark"></i>
366 <u>twitter</u>
367 </a>
368 </#if>
369
370 <#if doc.contacts.getJSONObject(0).socialRefs.instagram?? && doc.contacts.getJSONObject(0).socialRefs.instagram?has_content>
371 <a href="${doc.contacts.getJSONObject(0).socialRefs.instagram[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank">
372 <i class="fab fa-instagram-square text-dark"></i>
373 <u>instagram</u>
374 </a>
375 </#if>
376
377 <a href="/richiesta-informazioni" class="btn bg-green text-white font-bold uppercase px-4 py-2 rounded-0 mt-10">
378 ${d40.getLabel("richiedi_info")}
379 </a>
380 </div>
381 <#if hasCoords>
382 <div class="relative flex h-70">
383 <div class="absolute w-full lg:w-105% h-full right-0">
384 <div id="suggesto-map" class="monochrome-map size-full border-0"></div>
385 </div>
386 </div>
387
388 <div class="card-body p-5 lg:px-10">
389 <a href="https://www.google.com/maps/@${lat},${lng},14z" class="d-block no-underline space-x-5" target="_blank">
390 <span class="font-bold text-dark uppercase">
391 ${d40.getLabel("indicazioni_stradali")}
392 </span>
393 <img src="${d40.icons_folder}/arrow_circle-dark.svg" class="w-20" />
394 </a>
395 </div>
396 </#if>
397 </div>
398 </div>
399 </div>
400 </div>
401 </section>
402
403 <#if doc.details.images?has_content>
404 <#assign usePreview = false>
405
406 <section id="gallery" class="relative overflow-x-hidden mt-20 lg:mt-40">
407 <div class="container">
408 <p class="text-dark uppercase text-lg lg:text-3xl mb-7">
409 ${d40.getLabel("galleria_immagini")}
410 </p>
411
412 <div class="swiper-container">
413 <div class="swiper-wrapper">
414 <#if doc.details.cover != "[]">
415 <#assign usePreview = true>
416
417 <#list doc.details.cover.iterator() as pic>
418 <div class="swiper-slide">
419 <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">
420 <div class="relative">
421 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload rounded-custom size-full fit-cover" alt="" />
422 </div>
423 </a>
424 </div>
425
426 <#break>
427 </#list>
428 </#if>
429
430 <#list doc.details.images.iterator() as pic>
431 <#if usePreview>
432 <#assign counter = pic?counter>
433 <#else>
434 <#assign counter = pic?index>
435 </#if>
436
437 <div class="swiper-slide">
438 <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">
439 <div class="relative">
440 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload rounded-custom size-full fit-cover" alt="" />
441 </div>
442 </a>
443 </div>
444 </#list>
445 </div>
446 </div>
447 </div>
448 <div class="btn-square absolute btn-prev bg-white left-0">
449 <span class="sr-only">${d40.getLabel("precedente")}</span>
450 <i class="fas fa-chevron-left text-dark w-6 h-6"></i>
451 </div>
452 <div class="btn-square absolute btn-next bg-white right-0">
453 <span class="sr-only">${d40.getLabel("successivo")}</span>
454 <i class="fas fa-chevron-right text-dark w-6 h-6"></i>
455 </div>
456 </section>
457
458 <div id="lightbox-modal" tabindex="-1" role="dialog" class="modal fade">
459 <div class="modal-dialog modal-full-screen inset-0 border-0 shadow-none">
460 <div class="modal-content bg-transparent">
461 <div class="modal-body overflow-hidden">
462 <div class="absolute top-0 right-0 z-5">
463 <button type="button" data-dismiss="modal" class="btn btn-monospaced btn-secondary m-3">
464 <span class="sr-only">${d40.getLabel("chiudi")}</span>
465 <i class="fal fa-times fa-lg"></i>
466 </button>
467 </div>
468
469 <#-- lightbox -->
470 <div id="lightbox-swiper" class="swiper-container h-75 my-auto">
471 <div class="swiper-button-prev w-12 h-12">
472 <span class="sticker sticker-circle bg-green size-full">
473 <span class="sticker-overlay">
474 <i class="fas fa-chevron-left fa-2x text-white"></i>
475 </span>
476 </span>
477 </div>
478
479 <div class="swiper-button-next w-12 h-12">
480 <span class="sticker sticker-circle bg-green size-full">
481 <span class="sticker-overlay">
482 <i class="fas fa-chevron-right fa-2x text-white"></i>
483 </span>
484 </span>
485 </div>
486
487 <div class="swiper-wrapper h-full">
488 <#if doc.details.cover != "[]">
489 <#list doc.details.cover.iterator() as pic>
490 <div class="swiper-slide h-full">
491 <img data-src="${d40.getKitPrefix(pic[langId], 'n-full_hd')}" loading="lazy" class="lazyload flex h-full object-contain mx-auto" alt="">
492 </div>
493 <#break>
494 </#list>
495 </#if>
496
497 <#list doc.details.images.iterator() as pic>
498 <div class="swiper-slide h-full">
499 <img data-src="${d40.getKitPrefix(pic[langId], 'n-full_hd')}" loading="lazy" class="lazyload flex h-full object-contain mx-auto" alt="">
500 </div>
501 </#list>
502 </div>
503 </div>
504
505 <#-- thumbnails -->
506 <div id="thumbnail-swiper" class="swiper-container" thumbsSlider="">
507 <div class="swiper-wrapper">
508 <#if doc.details.cover != "[]">
509 <#list doc.details.cover.iterator() as pic>
510 <div class="swiper-slide">
511 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload object-cover cursor-pointer size-full" alt="">
512 </div>
513 <#break>
514 </#list>
515 </#if>
516
517 <#list doc.details.images.iterator() as pic>
518 <div class="swiper-slide">
519 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload object-cover cursor-pointer size-full" alt="">
520 </div>
521 </#list>
522 </div>
523 </div>
524 </div>
525 </div>
526 </div>
527 </div>
528 </#if>
529
530 <#-- SEZIONE NON USATA
531 <section class="mt-20">
532 <div class="container">
533 <div class="bg-light max-w-xl p-5 lg:p-10">
534 <div class="card-row space-x-5">
535 <div class="autofit-col">
536 <div class="autofit-section">
537 <i class="fas fa-download text-dark w-7 h-7"></i>
538 </div>
539 </div>
540 <div class="autofit-col autofit-col-expand">
541 <div class="autofit-section">
542 <p class="text-dark font-bold text-lg lg:text-xl uppercase mb-0"> Programma completo </p>
543 </div>
544 </div>
545 </div>
546 </div>
547
548 <div class="row mt-10 lg:mt-20">
549 <div class="col-12 col-lg-8">
550 <div class="space-y-10">
551 <p class="text-dark uppercase text-lg lg:text-3xl">
552 ${d40.getLabel("dettagli")}
553 </p>
554 <div class="space-y-5">
555 <div class="row">
556 <div class="col-12 col-md-3 col-lg-2">
557 <p class="text-dark font-bold uppercase">Data</p>
558 </div>
559 <div class="col-12 col-md-9 col-lg-10">
560 <div class="text-dark font-light text-lg">
561 Dettagli
562 </div>
563 </div>
564 </div>
565 </div>
566 </div>
567 </div>
568 </div>
569 </div>
570 </section>
571 -->
572
573 <#-- <section class="mt-20">
574 <div class="container">
575 <div class="bg-light">
576 <div class="space-y-10 p-5 lg:p-10">
577 <p class="text-dark uppercase text-lg lg:text-3xl mb-0">
578 ${d40.getLabel("organizzazione")}
579 </p>
580 <div class="space-y-2">
581 <#if doc.contacts.getJSONObject(0).address.fulltext?? && doc.contacts.getJSONObject(0).address.fulltext?has_content>
582 <p class="text-dark mb-0">
583 ${doc.contacts.getJSONObject(0).address.fulltext}
584 </p>
585 </#if>
586
587 <#if doc.contacts.getJSONObject(0).mail?? && doc.contacts.getJSONObject(0).mail?has_content>
588 <a href="mailto:${doc.contacts.getJSONObject(0).mail}" class="d-block text-dark underline">
589 ${doc.contacts.getJSONObject(0).mail}
590 </a>
591 </#if>
592
593 <#if doc.contacts.getJSONObject(0).telephone?? && doc.contacts.getJSONObject(0).telephone?has_content>
594 <#list doc.contacts.getJSONObject(0).telephone.iterator() as phone>
595 <p class="text-dark mb-0">
596 <span class="font-bold">${d40.getLabel("telefono")}:</span>
597 ${phone}
598 </p>
599 </#list>
600 </#if>
601
602 <#if doc.contacts.getJSONObject(0).socialRefs.facebook?? && doc.contacts.getJSONObject(0).socialRefs.facebook?has_content>
603 <a href="${doc.contacts.getJSONObject(0).socialRefs.facebook[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank">
604 <i class="fab fa-facebook-square text-dark"></i>
605 <u>facebook</u>
606 </a>
607 </#if>
608
609 <#if doc.contacts.getJSONObject(0).socialRefs.twitter?? && doc.contacts.getJSONObject(0).socialRefs.twitter?has_content>
610 <a href="${doc.contacts.getJSONObject(0).socialRefs.twitter[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank">
611 <i class="fab fa-twitter-square text-dark"></i>
612 <u>twitter</u>
613 </a>
614 </#if>
615
616 <#if doc.contacts.getJSONObject(0).socialRefs.instagram?? && doc.contacts.getJSONObject(0).socialRefs.instagram?has_content>
617 <a href="${doc.contacts.getJSONObject(0).socialRefs.instagram[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank">
618 <i class="fab fa-instagram-square text-dark"></i>
619 <u>instagram</u>
620 </a>
621 </#if>
622 </div>
623 </div>
624 </div>
625 </div>
626 </section> -->
627
628 <#-- SEZIONE NON USATA
629 <section class="mt-10">
630 <div class="container">
631 <p class="text-dark uppercase text-lg lg:text-3xl mb-7"> Info sezione </p>
632 <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>
633 </div>
634 </section>
635 -->
636 <#else>
637 <div class="text-center mt-35">
638 <p class="text-dark">
639 ${d40.getLabel("errore_caricamento_contenuto")}
640 </p>
641 </div>
642 </#if>
643</div>
644
645<script type="module">
646 import { createApp } from "https://cdnjs.cloudflare.com/ajax/libs/petite-vue/0.4.1/petite-vue.es.min.js";
647
648 createApp({
649 isMobile: window.innerWidth < 768,
650 favorites: [],
651 getFavorites() {
652 if(localStorage.getItem("favorites") !== null) {
653 this.favorites = JSON.parse(localStorage.getItem("favorites"));
654 }
655 },
656 setFavorite(e, item) {
657 e.preventDefault();
658 this.getFavorites();
659
660 var newFavorite = {
661 id: item.id,
662 contentJSON: {
663 title: item.contentJSON.title,
664 previewDescription: item.contentJSON.previewDescription,
665 description: item.contentJSON.description,
666 geoRef: item.contentJSON.geoRef,
667 previewPicture: item.contentJSON.previewPicture,
668 viewUrl: item.contentJSON.viewUrl,
669 type: "lfr",
670 }
671 };
672
673 this.favorites.push(newFavorite);
674 this.saveFavorites();
675 },
676 removeFavorite(e, itemId) {
677 e.preventDefault();
678 this.favorites = this.favorites.filter((obj) => obj.id !== itemId);
679 this.saveFavorites();
680 },
681 saveFavorites() {
682 localStorage.setItem("favorites", JSON.stringify(this.favorites));
683 },
684 isFavorite(itemId) {
685 if (this.favorites.some((e) => e.id == itemId)) {
686 return true;
687 }
688
689 return false;
690 },
691 buildMap(lat, lng) {
692 var map = new SuggestoMap("suggesto-map"),
693 location = [parseFloat(lat), parseFloat(lng)];
694
695 var svgIcon = L.divIcon({
696 html: `
697 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44.537 64.343">
698 <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"/>
699 <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"/>
700 <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"/>
701 <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"/>
702 </svg>`,
703 className: "",
704 iconSize: [44.537, 64.343],
705 iconAnchor: [22.287, 64.343],
706 });
707
708 var mapData = {
709 tilelayer: "osm",
710 gestureHandling: true,
711 fitBounds: false,
712 mapcenter: location,
713 zoom: 15,
714 markersFilter: "*",
715 markers: [],
716 layers: []
717 };
718
719 map.sm.createMap(mapData);
720
721 L.circleMarker(location, {
722 radius: 0,
723 color: "#000",
724 fillOpacity: 0,
725 weight: 0
726 }).addTo(map.sm.lmap);
727
728 L.marker(location, {
729 icon: svgIcon
730 }).addTo(map.sm.lmap);
731 },
732 share(title, desc, mode = "legacy") {
733 if (this.isMobile) {
734 var shareData = {
735 title: title,
736 text: desc,
737 url: window.location.href.replaceAll("{", "%7B").replaceAll("}", "%7D")
738 };
739
740 try {
741 navigator.share(shareData);
742 } catch (err) {
743 console.error("Error sharing: " + err);
744
745 if (mode == "legacy") {
746 this.legacyShare();
747 } else if (mode == "social") {
748 this.socialShare(title, desc);
749 }
750 }
751 } else {
752 if (mode == "legacy") {
753 this.legacyShare();
754 } else if (mode == "social") {
755 this.socialShare(title, desc);
756 }
757 }
758 },
759 legacyShare() {
760 var clip = document.createElement("input"),
761 toCopy = window.location.href.replaceAll("{", "%7B").replaceAll("}", "%7D");
762
763 document.body.appendChild(clip);
764 clip.value = toCopy;
765 clip.select();
766 clip.setSelectionRange(0, 999999);
767
768 navigator.clipboard.writeText(clip.value);
769 document.body.removeChild(clip);
770
771 alert("Link copiato");
772 },
773 socialShare(title, desc, image = "") {
774 var link = "#",
775 winHeight = 450,
776 winWidth = 600,
777 winTop = window.screen.height / 2 - winHeight / 2,
778 winLeft = window.screen.width / 2 - winWidth / 2,
779 params = "scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=" + winWidth + ",height=" + winHeight + ",left=" + winLeft + ",top=" + winTop;
780
781 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;
782
783 window.open(link, "Facebook", params);
784 }
785 }).mount("#${d40.portletNamespace}");
786</script>
787
788<#if doc?has_content>
789 <script>
790 document.addEventListener("DOMContentLoaded", function(){
791 if(${(doc.details.images?has_content)?c}){
792 new Swiper("#gallery .swiper-container", {
793 slidesPerView: 1,
794 spaceBetween: 50,
795 centerSlides: true,
796 centerInsufficientSlides: true,
797 breakpoints: {
798 768: {
799 slidesPerView: 2,
800 spaceBetween: 25
801 },
802 992: {
803 slidesPerView: 3,
804 spaceBetween: 25
805 }
806 },
807 navigation: {
808 prevEl: "#gallery .btn-prev",
809 nextEl: "#gallery .btn-next"
810 }
811 });
812
813 var thumbnails = new Swiper("#thumbnail-swiper", {
814 spaceBetween: 10,
815 slidesPerView: 2,
816 centerInsufficientSlides: true,
817 freeMode: true,
818 watchSlidesVisibility: true,
819 watchSlidesProgress: true,
820 breakpoints: {
821 768: {
822 slidesPerView: 3
823 },
824 992: {
825 slidesPerView: 4
826 },
827 1200: {
828 slidesPerView: 5
829 }
830 },
831 });
832
833 var lightbox = new Swiper("#lightbox-swiper", {
834 spaceBetween: 10,
835 autoHeight: true,
836 observer: true,
837 observeSlideChildren: true,
838 keyboard: {
839 enabled: true
840 },
841 navigation: {
842 nextEl: ".swiper-button-next",
843 prevEl: ".swiper-button-prev"
844 },
845 thumbs: {
846 swiper: thumbnails
847 }
848 });
849
850 $("#lightbox-modal").on("shown.bs.modal", function(e){
851 lightbox.update();
852 thumbnails.update();
853 lightbox.slideTo($(e.relatedTarget).data("slider"));
854 lightbox.update();
855 });
856
857 $("#lightbox-modal .swiper-wrapper").on("click", function(e){
858 if($(e.target).attr("class").includes("swiper-slide")){
859 $("#lightbox-modal").modal("hide");
860 }
861 });
862 }
863 });
864 </script>
865</#if>