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