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#4320625" at line 28, 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#4320625" at line 28, 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 z=request.setAttribute("ogTitle","title")>
18<#assign z=request.setAttribute("ogImage","imgg")>
19<#assign z=request.setAttribute("ogDesc","desc")> -->
20
21<#assign currentUrl = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() />
22<#assign z=request.setAttribute("ogUrl","${currentUrl}")>
23
24<#if uuid?has_content>
25 <#assign response = d40.fetchData("https://guestapp.d40.it/v1/search/apt-trento/${contentType}/?uuid=${uuid}")>
26
27 <#if !response.error && response.data.docs?has_content>
28 <#assign doc = response.data.docs.getJSONObject(0)>
29
30 ${request.session.removeAttribute("circularCategories")}
31 ${request.session.setAttribute("circularCategories", doc.details.assetCategoryIds)}
32 </#if>
33</#if>
34
35<#if doc?has_content>
36 <#if doc.details?? && doc.details.name[langId]?has_content>
37 ${PUTIL.setPageTitle(doc.details.name[langId], request)}
38 </#if>
39
40 <#assign vueActions = "getFavorites();">
41
42 <#if doc.details.location.geoCoords.lat?has_content && doc.details.location.geoCoords.lon?has_content>
43 <#assign
44 hasCoords = true
45 lat = doc.details.location.geoCoords.lat
46 lng = doc.details.location.geoCoords.lon
47 vueActions = "getFavorites();buildMap(${lat}, ${lng})"
48 />
49 </#if>
50</#if>
51
52<style>
53 .swiper-button-next:after{
54 content: "";
55 }
56 .swiper-button-prev:after{
57 content: "";
58 }
59</style>
60
61<div v-scope id="${d40.portletNamespace}" @vue:mounted="${vueActions}" v-cloak>
62 <#if doc?has_content>
63 <#if themeDisplay.getLayout().getAncestors()?has_content>
64 <section id="breadcrumb" class="z-15 mt-25">
65 <div class="container">
66 <ol class="breadcrumb flex lg:justify-center">
67 <li class="pl-1 text-sm mr-2 relative">${d40.getLabel("sei_in")}:</li>
68
69 <li class="breadcrumb-item">
70 <a href="/" class="breadcrumb-link" title="Home">
71 <span class="breadcrumb-text-truncate text-dark underline">Home</span>
72 </a>
73 </li>
74
75 <#list themeDisplay.getLayout().getAncestors()?reverse as ancestor>
76 <li class="breadcrumb-item">
77 <a href="${ancestor.getFriendlyURL()}" class="breadcrumb-link" title="${d40.escape(ancestor.getHTMLTitle(locale))}">
78 <span class="breadcrumb-text-truncate text-dark underline">
79 ${d40.escape(ancestor.getHTMLTitle(locale))}
80 </span>
81 </a>
82 </li>
83 </#list>
84
85 <li class="breadcrumb-item active">
86 <span class="breadcrumb-text-truncate text-dark">
87 ${doc.details.name[langId]}
88 </span>
89 </li>
90 </ol>
91 </div>
92 </section>
93 </#if>
94
95 <section class="relative mt-20">
96 <div class="container">
97 <div class="row">
98 <div class="col-12 col-lg-7">
99 <div class="card-row flex-col lg:flex-row mb-10">
100 <div class="autofit-col autofit-col-expand order-2 lg:order-1">
101 <div class="autofit-section">
102 <p class="text-dark font-semibold font-heading text-3xl lg:text-4xl uppercase">
103 ${doc.details.name[langId]}
104
105 <#assign z=request.setAttribute("ogTitle","${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.timetables.timeDescription[langId]?has_content>
128 <div class="text-dark text-lg font-light mb-15 mt-5">
129 ${doc.timetables.timeDescription[langId]}
130 </div>
131 </#if>
132
133 <#if doc.details.description[langId]?has_content>
134 <div class="underline-grow text-dark font-light lg:text-lg leading-loose">
135 ${doc.details.description[langId]}
136
137 <#if doc.details.description[langId]?length lt 160>
138 <#assign
139 z=request.setAttribute("ogDesc","${htmlUtil.stripHtml(doc.details.description[langId])}")
140 />
141 <#else>
142 <#assign
143 z=request.setAttribute("ogDesc","${htmlUtil.stripHtml(doc.details.description[langId])?substring(0,160)}")
144 />
145 </#if>
146 </div>
147 </#if>
148 </div>
149
150 <div class="xl:absolute col-12 col-lg-5 xl:max-w-xl lg:right-0">
151 <div class="bg-light">
152 <div class="card-body px-5 pt-5 lg:px-10 lg:pt-10 pb-0">
153 <p class="text-dark font-bold uppercase text-lg mb-0">
154 ${d40.getLabel("informazioni_contatti")}
155 </p>
156 <#if doc.details.townLabel != "{}">
157 <p class="text-dark text-lg mb-0">
158 ${d40.getLabel("localita")}: <span class="text-capitalize">${doc.details.townLabel[langId]}</span>
159 </p>
160 </#if>
161 <#if doc.timetables.time_infos?has_content>
162 <p class="text-dark font-bold text-lg mb-0 mt-3">
163 ${d40.getLabel("date_apertura")}
164 </p>
165 </#if>
166 </div>
167
168 <#if doc.timetables.time_infos?has_content>
169 <div class="flex min-h-12">
170 <details class="bg-darkgray w-full lg:w-105% right-0 -ml-5">
171 <summary class="btn btn-link text-dark no-underline my-1 ml-12">
172 <i class="fal fa-calendar-alt"></i>
173 <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>
174 <i class="fal fa-chevron-down fa-lg ml-5"></i>
175 </summary>
176
177 <div class="card-body px-5 lg:px-10">
178 <ul>
179 <#list doc.timetables.time_infos.iterator() as datetime>
180 <li class="text-dark mb-1">
181 ${d40.getLabel("dal")} ${datetime.date_from}
182 ${d40.getLabel("al")} ${datetime.date_to}
183 ${d40.getLabel("dalle")} ${datetime.time_from}
184 ${d40.getLabel("alle")} ${datetime.time_to}
185 </li>
186 </#list>
187 </ul>
188 </div>
189 </details>
190 </div>
191 </#if>
192 <div class="card-body px-5 lg:px-10">
193 <#if doc.contacts.getJSONObject(0).telephone?? && doc.contacts.getJSONObject(0).telephone?has_content>
194 <#attempt>
195 <#list doc.contacts.getJSONObject(0).telephone.iterator() as phone>
196 <p class="text-dark text-lg mb-0">
197 Tel: ${phone}
198 </p>
199 </#list>
200 <#recover>
201 <p class="text-dark text-lg mb-0">
202 Tel: ${doc.contacts.getJSONObject(0).telephone}
203 </p>
204 </#attempt>
205
206 </#if>
207 <#if doc.contacts.getJSONObject(0).mail?? && doc.contacts.getJSONObject(0).mail?has_content>
208 <a href="mailto:${doc.contacts.getJSONObject(0).mail}" class="block no-underline text-dark text-lg space-x-2 mb-0">
209 <i class="far fa-envelope text-dark"></i>
210 <u>${doc.contacts.getJSONObject(0).mail}</u>
211 </a>
212 </#if>
213 <#if doc.contacts.getJSONObject(0).websiteUrl[langId]?? && doc.contacts.getJSONObject(0).websiteUrl[langId]?has_content>
214 <a href="${doc.contacts.getJSONObject(0).websiteUrl[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank">
215 <i class="far fa-external-link text-dark"></i>
216 <u>${d40.getLabel("sito_web")}</u>
217 </a>
218 </#if>
219
220 <#if langId == 'en'>
221 <#assign ri_url = "/contact-tourist-office-trento" />
222 <#elseif langId == 'de'>
223 <#assign ri_url = "/kontakt-info-anfrage-trento" />
224 <#else>
225 <#assign ri_url = "/richiesta-informazioni" />
226 </#if>
227
228 <a href="${ri_url}" class="btn bg-green text-white font-bold uppercase px-4 py-2 rounded-0 mt-10">
229 ${d40.getLabel("richiedi_info")}
230 </a>
231 </div>
232
233 </div>
234 </div>
235 </div>
236 </div>
237 </section>
238
239 <#if doc.details.images?has_content>
240 <#assign usePreview = false>
241
242 <section id="gallery" class="relative overflow-x-hidden mt-20">
243 <div class="container">
244 <p class="text-dark uppercase text-lg lg:text-3xl mb-7">
245 ${d40.getLabel("galleria_immagini")}
246 </p>
247
248 <div class="swiper-container">
249 <div class="swiper-wrapper">
250 <#if doc.details.cover != "[]">
251 <#assign usePreview = true>
252
253 <#list doc.details.cover.iterator() as pic>
254 <div class="swiper-slide">
255 <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">
256 <div class="relative">
257 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload rounded-custom size-full fit-cover" alt="" />
258 </div>
259 </a>
260 </div>
261
262 <#--assign z=request.setAttribute("ogImage","${pic[langId]}")-->
263 <#assign z=request.setAttribute("ogImage","${d40.getKitPrefix(pic[langId], 'n-preview_h')}")>
264
265 <#break>
266 </#list>
267 </#if>
268
269 <#list doc.details.images.iterator() as pic>
270 <#if usePreview>
271 <#assign counter = pic?counter>
272 <#else>
273 <#assign counter = pic?index>
274 </#if>
275
276 <div class="swiper-slide">
277 <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">
278 <div class="relative">
279 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload rounded-custom size-full fit-cover" alt="" />
280 </div>
281 </a>
282 </div>
283 </#list>
284 </div>
285 </div>
286 </div>
287 <div class="btn-square absolute btn-prev bg-white left-0">
288 <span class="sr-only">${d40.getLabel("precedente")}</span>
289 <i class="fas fa-chevron-left text-dark w-6 h-6"></i>
290 </div>
291 <div class="btn-square absolute btn-next bg-white right-0">
292 <span class="sr-only">${d40.getLabel("successivo")}</span>
293 <i class="fas fa-chevron-right text-dark w-6 h-6"></i>
294 </div>
295 </section>
296
297 <div id="lightbox-modal" tabindex="-1" role="dialog" class="modal fade">
298 <div class="modal-dialog modal-full-screen inset-0 border-0 shadow-none">
299 <div class="modal-content bg-transparent">
300 <div class="modal-body overflow-hidden">
301 <div class="absolute top-0 right-0 z-5">
302 <button type="button" data-dismiss="modal" class="btn btn-monospaced btn-secondary m-3">
303 <span class="sr-only">${d40.getLabel("chiudi")}</span>
304 <i class="fal fa-times fa-lg"></i>
305 </button>
306 </div>
307
308 <#-- lightbox -->
309 <div id="lightbox-swiper" class="swiper-container h-75 my-auto">
310 <div class="swiper-button-prev w-12 h-12">
311 <span class="sticker sticker-circle bg-green size-full">
312 <span class="sticker-overlay">
313 <i class="fas fa-chevron-left fa-2x text-white"></i>
314 </span>
315 </span>
316 </div>
317
318 <div class="swiper-button-next w-12 h-12">
319 <span class="sticker sticker-circle bg-green size-full">
320 <span class="sticker-overlay">
321 <i class="fas fa-chevron-right fa-2x text-white"></i>
322 </span>
323 </span>
324 </div>
325
326 <div class="swiper-wrapper h-full">
327 <#if doc.details.cover != "[]">
328 <#list doc.details.cover.iterator() as pic>
329 <div class="swiper-slide h-full">
330 <img data-src="${d40.getKitPrefix(pic[langId], 'n-full_hd')}" loading="lazy" class="lazyload flex h-full object-contain mx-auto" alt="">
331 </div>
332 <#break>
333 </#list>
334 </#if>
335
336 <#list doc.details.images.iterator() as pic>
337 <div class="swiper-slide h-full">
338 <img data-src="${d40.getKitPrefix(pic[langId], 'n-full_hd')}" loading="lazy" class="lazyload flex h-full object-contain mx-auto" alt="">
339 </div>
340 </#list>
341 </div>
342 </div>
343
344 <#-- thumbnails -->
345 <div id="thumbnail-swiper" class="swiper-container" thumbsSlider="">
346 <div class="swiper-wrapper">
347 <#if doc.details.cover != "[]">
348 <#list doc.details.cover.iterator() as pic>
349 <div class="swiper-slide">
350 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload object-cover cursor-pointer size-full" alt="">
351 </div>
352 <#break>
353 </#list>
354 </#if>
355
356 <#list doc.details.images.iterator() as pic>
357 <div class="swiper-slide">
358 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload object-cover cursor-pointer size-full" alt="">
359 </div>
360 </#list>
361 </div>
362 </div>
363 </div>
364 </div>
365 </div>
366 </div>
367 </#if>
368
369 <#-- <#if doc.details.categories?has_content>
370 <section class="mt-20">
371 <div class="container">
372 <div class="border-t-2 border-b-2 border-light py-10">
373 <div class="row">
374 <#list doc.details.categories.iterator() as cat>
375 <div class="col-12 col-md-6 col-lg-4 mb-7">
376 <div class="card-row space-x-4">
377 <div class="autofit-col">
378 <div class="autofit-section">
379 <div class="flex items-center justify-center w-18 h-18 rounded-full border-1 border-dark">
380 <i class="fas fa-user fa-lg"></i>
381 </div>
382 </div>
383 </div>
384 <div class="autofit-col autofit-col-expand">
385 <div class="autofit-section">
386 <p class="text-dark font-bold uppercase mb-1">
387 ${cat}
388 </p>
389
390 </div>
391 </div>
392 </div>
393 </div>
394 </#list>
395 </div>
396 </div>
397 </div>
398 </section>
399 </#if> -->
400
401 <#if hasCoords>
402 <section class="mt-20">
403 <div class="bg-light py-10">
404 <div class="container">
405 <div class="flex justify-between items-center">
406 <div>
407 <p class="text-dark uppercase text-lg font-bold mb-0">
408 ${d40.getLabel("posizione")}
409 </p>
410 </div>
411
412 <div>
413 <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">
414 <span class="font-bold text-dark uppercase">
415 ${d40.getLabel("indicazioni_stradali")}
416 </span>
417 <img src="${d40.icons_folder}/arrow_circle-dark.svg" class="w-20" />
418 </a>
419 </div>
420 </div>
421
422 <div class="mt-5">
423 <div id="suggesto-map" class="monochrome-map h-500px"></div>
424 </div>
425 </div>
426 </div>
427 </section>
428 </#if>
429
430
431 <#else>
432 <div class="text-center mt-35">
433 <p class="text-dark">Errore durante il caricamento del contenuto.</p>
434 </div>
435 </#if>
436</div>
437
438<script type="module">
439 import { createApp } from "https://cdnjs.cloudflare.com/ajax/libs/petite-vue/0.4.1/petite-vue.es.min.js";
440
441 createApp({
442 isMobile: window.innerWidth < 768,
443 favorites: [],
444 getFavorites() {
445 if(localStorage.getItem("favorites") !== null) {
446 this.favorites = JSON.parse(localStorage.getItem("favorites"));
447 }
448 },
449 setFavorite(e, item) {
450 e.preventDefault();
451 this.getFavorites();
452
453 var newFavorite = {
454 id: item.id,
455 contentJSON: {
456 title: item.contentJSON.title,
457 previewDescription: item.contentJSON.previewDescription,
458 description: item.contentJSON.description,
459 geoRef: item.contentJSON.geoRef,
460 previewPicture: item.contentJSON.previewPicture,
461 viewUrl: item.contentJSON.viewUrl,
462 type: "lfr",
463 }
464 };
465
466 this.favorites.push(newFavorite);
467 this.saveFavorites();
468 },
469 removeFavorite(e, itemId) {
470 e.preventDefault();
471 this.favorites = this.favorites.filter((obj) => obj.id !== itemId);
472 this.saveFavorites();
473 },
474 saveFavorites() {
475 localStorage.setItem("favorites", JSON.stringify(this.favorites));
476 },
477 isFavorite(itemId) {
478 if (this.favorites.some((e) => e.id == itemId)) {
479 return true;
480 }
481
482 return false;
483 },
484 buildMap(lat, lng) {
485 var map = new SuggestoMap("suggesto-map"),
486 location = [parseFloat(lat), parseFloat(lng)];
487
488 var svgIcon = L.divIcon({
489 html: `
490 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44.537 64.343">
491 <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"/>
492 <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"/>
493 <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"/>
494 <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"/>
495 </svg>`,
496 className: "",
497 iconSize: [44.537, 64.343],
498 iconAnchor: [22.287, 64.343],
499 });
500
501 var mapData = {
502 tilelayer: "osm",
503 gestureHandling: true,
504 fitBounds: false,
505 mapcenter: location,
506 zoom: 15,
507 markersFilter: "*",
508 markers: [],
509 layers: []
510 };
511
512 map.sm.createMap(mapData);
513
514 L.circleMarker(location, {
515 radius: 0,
516 color: "#000",
517 fillOpacity: 0,
518 weight: 0
519 }).addTo(map.sm.lmap);
520
521 L.marker(location, {
522 icon: svgIcon
523 }).addTo(map.sm.lmap);
524 },
525 share(title, desc, mode = "legacy") {
526 if (this.isMobile) {
527 var shareData = {
528 title: title,
529 text: desc,
530 url: window.location.href.replaceAll("{", "%7B").replaceAll("}", "%7D")
531 };
532
533 try {
534 navigator.share(shareData);
535 } catch (err) {
536 console.error("Error sharing: " + err);
537
538 if (mode == "legacy") {
539 this.legacyShare();
540 } else if (mode == "social") {
541 this.socialShare(title, desc);
542 }
543 }
544 } else {
545 if (mode == "legacy") {
546 this.legacyShare();
547 } else if (mode == "social") {
548 this.socialShare(title, desc);
549 }
550 }
551 },
552 legacyShare() {
553 var clip = document.createElement("input"),
554 toCopy = window.location.href.replaceAll("{", "%7B").replaceAll("}", "%7D");
555
556 document.body.appendChild(clip);
557 clip.value = toCopy;
558 clip.select();
559 clip.setSelectionRange(0, 999999);
560
561 navigator.clipboard.writeText(clip.value);
562 document.body.removeChild(clip);
563
564 alert("Link copiato");
565 },
566 socialShare(title, desc, image = "") {
567 var link = "#",
568 winHeight = 450,
569 winWidth = 600,
570 winTop = window.screen.height / 2 - winHeight / 2,
571 winLeft = window.screen.width / 2 - winWidth / 2,
572 params = "scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=" + winWidth + ",height=" + winHeight + ",left=" + winLeft + ",top=" + winTop;
573
574 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;
575
576 window.open(link, "Facebook", params);
577 }
578 }).mount("#${d40.portletNamespace}");
579</script>
580
581<#if doc?has_content>
582 <script>
583 document.addEventListener("DOMContentLoaded", function(){
584 if(${(doc.details.images?has_content)?c}){
585 new Swiper("#gallery .swiper-container", {
586 slidesPerView: 1,
587 spaceBetween: 50,
588 centerSlides: true,
589 centerInsufficientSlides: true,
590 breakpoints: {
591 768: {
592 slidesPerView: 2,
593 spaceBetween: 25
594 },
595 992: {
596 slidesPerView: 3,
597 spaceBetween: 25
598 }
599 },
600 navigation: {
601 prevEl: "#gallery .btn-prev",
602 nextEl: "#gallery .btn-next"
603 }
604 });
605
606 var thumbnails = new Swiper("#thumbnail-swiper", {
607 spaceBetween: 10,
608 slidesPerView: 2,
609 centerInsufficientSlides: true,
610 freeMode: true,
611 watchSlidesVisibility: true,
612 watchSlidesProgress: true,
613 breakpoints: {
614 768: {
615 slidesPerView: 3
616 },
617 992: {
618 slidesPerView: 4
619 },
620 1200: {
621 slidesPerView: 5
622 }
623 },
624 });
625
626 var lightbox = new Swiper("#lightbox-swiper", {
627 spaceBetween: 10,
628 autoHeight: true,
629 observer: true,
630 observeSlideChildren: true,
631 keyboard: {
632 enabled: true
633 },
634 navigation: {
635 nextEl: ".swiper-button-next",
636 prevEl: ".swiper-button-prev"
637 },
638 thumbs: {
639 swiper: thumbnails
640 }
641 });
642
643 $("#lightbox-modal").on("shown.bs.modal", function(e){
644 lightbox.update();
645 thumbnails.update();
646 lightbox.slideTo($(e.relatedTarget).data("slider"));
647 lightbox.update();
648 });
649
650 $("#lightbox-modal .swiper-wrapper").on("click", function(e){
651 if($(e.target).attr("class").includes("swiper-slide")){
652 $("#lightbox-modal").modal("hide");
653 }
654 });
655
656 if ($(window).width() > 991) {
657 var left_col_h = $(".relative.mt-20 > .container > .row > .col-lg-7").outerHeight();
658 var right_col_h = $(".relative.mt-20 > .container > .row > .col-lg-5").outerHeight();
659 var marg_h = right_col_h - left_col_h + 40;
660
661 if(right_col_h > left_col_h)
662 {
663 $('#gallery').removeClass('lg:mt-40 mt-20');
664 $('#gallery').css({'margin-top':marg_h+'px'});
665 }
666 }
667 }
668 });
669 </script>
670</#if>