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_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 <#list doc.contacts.getJSONObject(0).telephone.iterator() as phone>
195 <p class="text-dark text-lg mb-0">
196 Tel: ${phone}
197 </p>
198 </#list>
199 </#if>
200 <#if doc.contacts.getJSONObject(0).mail?? && doc.contacts.getJSONObject(0).mail?has_content>
201 <a href="mailto:${doc.contacts.getJSONObject(0).mail}" class="block no-underline text-dark text-lg space-x-2 mb-0">
202 <i class="far fa-envelope text-dark"></i>
203 <u>${doc.contacts.getJSONObject(0).mail}</u>
204 </a>
205 </#if>
206 <#if doc.contacts.getJSONObject(0).websiteUrl[langId]?? && doc.contacts.getJSONObject(0).websiteUrl[langId]?has_content>
207 <a href="${doc.contacts.getJSONObject(0).websiteUrl[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank">
208 <i class="far fa-external-link text-dark"></i>
209 <u>${d40.getLabel("sito_web")}</u>
210 </a>
211 </#if>
212
213 <#if langId == 'en'>
214 <#assign ri_url = "/contact-tourist-office-trento" />
215 <#elseif langId == 'de'>
216 <#assign ri_url = "/kontakt-info-anfrage-trento" />
217 <#else>
218 <#assign ri_url = "/richiesta-informazioni" />
219 </#if>
220
221 <a href="${ri_url}" class="btn bg-green text-white font-bold uppercase px-4 py-2 rounded-0 mt-10">
222 ${d40.getLabel("richiedi_info")}
223 </a>
224 </div>
225
226 </div>
227 </div>
228 </div>
229 </div>
230 </section>
231
232 <#if doc.details.images?has_content>
233 <#assign usePreview = false>
234
235 <section id="gallery" class="relative overflow-x-hidden mt-20">
236 <div class="container">
237 <p class="text-dark uppercase text-lg lg:text-3xl mb-7">
238 ${d40.getLabel("galleria_immagini")}
239 </p>
240
241 <div class="swiper-container">
242 <div class="swiper-wrapper">
243 <#if doc.details.cover != "[]">
244 <#assign usePreview = true>
245
246 <#list doc.details.cover.iterator() as pic>
247 <div class="swiper-slide">
248 <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">
249 <div class="relative">
250 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload rounded-custom size-full fit-cover" alt="" />
251 </div>
252 </a>
253 </div>
254
255 <#assign z=request.setAttribute("ogImage","${pic[langId]}")>
256
257 <#break>
258 </#list>
259 </#if>
260
261 <#list doc.details.images.iterator() as pic>
262 <#if usePreview>
263 <#assign counter = pic?counter>
264 <#else>
265 <#assign counter = pic?index>
266 </#if>
267
268 <div class="swiper-slide">
269 <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">
270 <div class="relative">
271 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload rounded-custom size-full fit-cover" alt="" />
272 </div>
273 </a>
274 </div>
275 </#list>
276 </div>
277 </div>
278 </div>
279 <div class="btn-square absolute btn-prev bg-white left-0">
280 <span class="sr-only">${d40.getLabel("precedente")}</span>
281 <i class="fas fa-chevron-left text-dark w-6 h-6"></i>
282 </div>
283 <div class="btn-square absolute btn-next bg-white right-0">
284 <span class="sr-only">${d40.getLabel("successivo")}</span>
285 <i class="fas fa-chevron-right text-dark w-6 h-6"></i>
286 </div>
287 </section>
288
289 <div id="lightbox-modal" tabindex="-1" role="dialog" class="modal fade">
290 <div class="modal-dialog modal-full-screen inset-0 border-0 shadow-none">
291 <div class="modal-content bg-transparent">
292 <div class="modal-body overflow-hidden">
293 <div class="absolute top-0 right-0 z-5">
294 <button type="button" data-dismiss="modal" class="btn btn-monospaced btn-secondary m-3">
295 <span class="sr-only">${d40.getLabel("chiudi")}</span>
296 <i class="fal fa-times fa-lg"></i>
297 </button>
298 </div>
299
300 <#-- lightbox -->
301 <div id="lightbox-swiper" class="swiper-container h-75 my-auto">
302 <div class="swiper-button-prev w-12 h-12">
303 <span class="sticker sticker-circle bg-green size-full">
304 <span class="sticker-overlay">
305 <i class="fas fa-chevron-left fa-2x text-white"></i>
306 </span>
307 </span>
308 </div>
309
310 <div class="swiper-button-next 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-right fa-2x text-white"></i>
314 </span>
315 </span>
316 </div>
317
318 <div class="swiper-wrapper h-full">
319 <#if doc.details.cover != "[]">
320 <#list doc.details.cover.iterator() as pic>
321 <div class="swiper-slide h-full">
322 <img data-src="${d40.getKitPrefix(pic[langId], 'n-full_hd')}" loading="lazy" class="lazyload flex h-full object-contain mx-auto" alt="">
323 </div>
324 <#break>
325 </#list>
326 </#if>
327
328 <#list doc.details.images.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 </#list>
333 </div>
334 </div>
335
336 <#-- thumbnails -->
337 <div id="thumbnail-swiper" class="swiper-container" thumbsSlider="">
338 <div class="swiper-wrapper">
339 <#if doc.details.cover != "[]">
340 <#list doc.details.cover.iterator() as pic>
341 <div class="swiper-slide">
342 <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload object-cover cursor-pointer size-full" alt="">
343 </div>
344 <#break>
345 </#list>
346 </#if>
347
348 <#list doc.details.images.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 </#list>
353 </div>
354 </div>
355 </div>
356 </div>
357 </div>
358 </div>
359 </#if>
360
361 <#-- <#if doc.details.categories?has_content>
362 <section class="mt-20">
363 <div class="container">
364 <div class="border-t-2 border-b-2 border-light py-10">
365 <div class="row">
366 <#list doc.details.categories.iterator() as cat>
367 <div class="col-12 col-md-6 col-lg-4 mb-7">
368 <div class="card-row space-x-4">
369 <div class="autofit-col">
370 <div class="autofit-section">
371 <div class="flex items-center justify-center w-18 h-18 rounded-full border-1 border-dark">
372 <i class="fas fa-user fa-lg"></i>
373 </div>
374 </div>
375 </div>
376 <div class="autofit-col autofit-col-expand">
377 <div class="autofit-section">
378 <p class="text-dark font-bold uppercase mb-1">
379 ${cat}
380 </p>
381
382 </div>
383 </div>
384 </div>
385 </div>
386 </#list>
387 </div>
388 </div>
389 </div>
390 </section>
391 </#if> -->
392
393 <#if hasCoords>
394 <section class="mt-20">
395 <div class="bg-light py-10">
396 <div class="container">
397 <div class="flex justify-between items-center">
398 <div>
399 <p class="text-dark uppercase text-lg font-bold mb-0">
400 ${d40.getLabel("posizione")}
401 </p>
402 </div>
403
404 <div>
405 <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">
406 <span class="font-bold text-dark uppercase">
407 ${d40.getLabel("indicazioni_stradali")}
408 </span>
409 <img src="${d40.icons_folder}/arrow_circle-dark.svg" class="w-20" />
410 </a>
411 </div>
412 </div>
413
414 <div class="mt-5">
415 <div id="suggesto-map" class="monochrome-map h-500px"></div>
416 </div>
417 </div>
418 </div>
419 </section>
420 </#if>
421
422
423 <#else>
424 <div class="text-center mt-35">
425 <p class="text-dark">Errore durante il caricamento del contenuto.</p>
426 </div>
427 </#if>
428</div>
429
430<script type="module">
431 import { createApp } from "https://cdnjs.cloudflare.com/ajax/libs/petite-vue/0.4.1/petite-vue.es.min.js";
432
433 createApp({
434 isMobile: window.innerWidth < 768,
435 favorites: [],
436 getFavorites() {
437 if(localStorage.getItem("favorites") !== null) {
438 this.favorites = JSON.parse(localStorage.getItem("favorites"));
439 }
440 },
441 setFavorite(e, item) {
442 e.preventDefault();
443 this.getFavorites();
444
445 var newFavorite = {
446 id: item.id,
447 contentJSON: {
448 title: item.contentJSON.title,
449 previewDescription: item.contentJSON.previewDescription,
450 description: item.contentJSON.description,
451 geoRef: item.contentJSON.geoRef,
452 previewPicture: item.contentJSON.previewPicture,
453 viewUrl: item.contentJSON.viewUrl,
454 type: "lfr",
455 }
456 };
457
458 this.favorites.push(newFavorite);
459 this.saveFavorites();
460 },
461 removeFavorite(e, itemId) {
462 e.preventDefault();
463 this.favorites = this.favorites.filter((obj) => obj.id !== itemId);
464 this.saveFavorites();
465 },
466 saveFavorites() {
467 localStorage.setItem("favorites", JSON.stringify(this.favorites));
468 },
469 isFavorite(itemId) {
470 if (this.favorites.some((e) => e.id == itemId)) {
471 return true;
472 }
473
474 return false;
475 },
476 buildMap(lat, lng) {
477 var map = new SuggestoMap("suggesto-map"),
478 location = [parseFloat(lat), parseFloat(lng)];
479
480 var svgIcon = L.divIcon({
481 html: `
482 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44.537 64.343">
483 <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"/>
484 <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"/>
485 <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"/>
486 <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"/>
487 </svg>`,
488 className: "",
489 iconSize: [44.537, 64.343],
490 iconAnchor: [22.287, 64.343],
491 });
492
493 var mapData = {
494 tilelayer: "osm",
495 gestureHandling: true,
496 fitBounds: false,
497 mapcenter: location,
498 zoom: 15,
499 markersFilter: "*",
500 markers: [],
501 layers: []
502 };
503
504 map.sm.createMap(mapData);
505
506 L.circleMarker(location, {
507 radius: 0,
508 color: "#000",
509 fillOpacity: 0,
510 weight: 0
511 }).addTo(map.sm.lmap);
512
513 L.marker(location, {
514 icon: svgIcon
515 }).addTo(map.sm.lmap);
516 },
517 share(title, desc, mode = "legacy") {
518 if (this.isMobile) {
519 var shareData = {
520 title: title,
521 text: desc,
522 url: window.location.href.replaceAll("{", "%7B").replaceAll("}", "%7D")
523 };
524
525 try {
526 navigator.share(shareData);
527 } catch (err) {
528 console.error("Error sharing: " + err);
529
530 if (mode == "legacy") {
531 this.legacyShare();
532 } else if (mode == "social") {
533 this.socialShare(title, desc);
534 }
535 }
536 } else {
537 if (mode == "legacy") {
538 this.legacyShare();
539 } else if (mode == "social") {
540 this.socialShare(title, desc);
541 }
542 }
543 },
544 legacyShare() {
545 var clip = document.createElement("input"),
546 toCopy = window.location.href.replaceAll("{", "%7B").replaceAll("}", "%7D");
547
548 document.body.appendChild(clip);
549 clip.value = toCopy;
550 clip.select();
551 clip.setSelectionRange(0, 999999);
552
553 navigator.clipboard.writeText(clip.value);
554 document.body.removeChild(clip);
555
556 alert("Link copiato");
557 },
558 socialShare(title, desc, image = "") {
559 var link = "#",
560 winHeight = 450,
561 winWidth = 600,
562 winTop = window.screen.height / 2 - winHeight / 2,
563 winLeft = window.screen.width / 2 - winWidth / 2,
564 params = "scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=" + winWidth + ",height=" + winHeight + ",left=" + winLeft + ",top=" + winTop;
565
566 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;
567
568 window.open(link, "Facebook", params);
569 }
570 }).mount("#${d40.portletNamespace}");
571</script>
572
573<#if doc?has_content>
574 <script>
575 document.addEventListener("DOMContentLoaded", function(){
576 if(${(doc.details.images?has_content)?c}){
577 new Swiper("#gallery .swiper-container", {
578 slidesPerView: 1,
579 spaceBetween: 50,
580 centerSlides: true,
581 centerInsufficientSlides: true,
582 breakpoints: {
583 768: {
584 slidesPerView: 2,
585 spaceBetween: 25
586 },
587 992: {
588 slidesPerView: 3,
589 spaceBetween: 25
590 }
591 },
592 navigation: {
593 prevEl: "#gallery .btn-prev",
594 nextEl: "#gallery .btn-next"
595 }
596 });
597
598 var thumbnails = new Swiper("#thumbnail-swiper", {
599 spaceBetween: 10,
600 slidesPerView: 2,
601 centerInsufficientSlides: true,
602 freeMode: true,
603 watchSlidesVisibility: true,
604 watchSlidesProgress: true,
605 breakpoints: {
606 768: {
607 slidesPerView: 3
608 },
609 992: {
610 slidesPerView: 4
611 },
612 1200: {
613 slidesPerView: 5
614 }
615 },
616 });
617
618 var lightbox = new Swiper("#lightbox-swiper", {
619 spaceBetween: 10,
620 autoHeight: true,
621 observer: true,
622 observeSlideChildren: true,
623 keyboard: {
624 enabled: true
625 },
626 navigation: {
627 nextEl: ".swiper-button-next",
628 prevEl: ".swiper-button-prev"
629 },
630 thumbs: {
631 swiper: thumbnails
632 }
633 });
634
635 $("#lightbox-modal").on("shown.bs.modal", function(e){
636 lightbox.update();
637 thumbnails.update();
638 lightbox.slideTo($(e.relatedTarget).data("slider"));
639 lightbox.update();
640 });
641
642 $("#lightbox-modal .swiper-wrapper").on("click", function(e){
643 if($(e.target).attr("class").includes("swiper-slide")){
644 $("#lightbox-modal").modal("hide");
645 }
646 });
647
648 if ($(window).width() > 991) {
649 var left_col_h = $(".relative.mt-20 > .container > .row > .col-lg-7").outerHeight();
650 var right_col_h = $(".relative.mt-20 > .container > .row > .col-lg-5").outerHeight();
651 var marg_h = right_col_h - left_col_h + 40;
652
653 if(right_col_h > left_col_h)
654 {
655 $('#gallery').removeClass('lg:mt-40 mt-20');
656 $('#gallery').css({'margin-top':marg_h+'px'});
657 }
658 }
659 }
660 });
661 </script>
662</#if>