Se ha producido un error al procesar la plantilla.
The following has evaluated to null or missing: ==> destacado [in template "20101#20127#246120" at line 174, column 37] ---- Tip: If the failing expression is known to 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: ${destacado} [in template "20101#20127#246120" at line 174, column 35] ----
1<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"></script>
2<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.3/mapbox.js'></script>
3<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.3/mapbox.css' rel='stylesheet' />
4<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/leaflet.markercluster.js'></script>
5<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.css' rel='stylesheet' />
6<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.Default.css' rel='stylesheet' />
7<script src="/o/jaen-theme/js/moment.min.js"></script>
8<script src="/o/jaen-theme/js/daterangepicker.min.js"></script>
9<link rel="stylesheet" href="/o/jaen-theme/css/daterangepicker.css" />
10
11<#assign favouriteResourceLocalService = serviceLocator.findService("com.jaen.favourite.resource.service.FavouriteResourceLocalService")>
12<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()>
13<#assign themeDisplay = serviceContext.getThemeDisplay() />
14<#assign currentUrl = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() />
15
16<#if entries?has_content>
17<#assign municipioArray = []>
18<script>
19 var municipiosGroup = [];
20
21</script>
22 <#list entries as curEntry>
23 <#assign categories = curEntry.getCategories() />
24 <#list categories as category>
25 <#if category?has_content>
26 <#if (category.vocabularyId = 340465 )>
27 <#assign municipio = category.name/>
28 <script>
29 municipiosGroup.push('${municipio}');
30 </script>
31 <#if category?counter gt 1>
32 <#assign municipio = category.categoryId />
33 <#assign municipioArray = municipioArray + [municipio]>
34 <#assign municipioName = category.name/>
35 <#assign UrlClean = category.name?lower_case?replace(" ", "-")?replace("á", "a")?replace("é", "e")?replace("í", "i")?replace("ó", "o")?replace("ú", "u")?replace("ñ", "n")?replace("ü", "u")>
36 <#break>
37 </#if>
38 </#if>
39 </#if>
40
41 </#list>
42</#list>
43
44
45<#if municipioArray?has_content>
46<#assign primerMuni = municipioArray[0]>
47<#assign isEqual = 1>
48<#list municipioArray as muni>
49 <#if (primerMuni == muni)>
50 <#assign isEqual = 1>
51 <#else>
52 <#assign isEqual = 0>
53 </#if>
54</#list>
55</#if>
56<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()>
57<#assign themeDisplay = serviceContext.getThemeDisplay() />
58<#assign currentUrl = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() />
59
60
61<div class="btn-change-view container pb-4 m-auto align-items-center">
62 <#if (currentUrl?contains("/-/categories/") || (currentUrl?contains("?filterCategoryIds")))>
63 <#if (municipio?exists) && (isEqual == 1)>
64 <div class="-vistaSitio -hotel">
65 <div class="tags d-flex order-0" data-ingrediente="municipio">
66 <a href="/web/jaen-paraiso-interior/${UrlClean}"><p>${municipioName}</p></a>
67 </div>
68 </div>
69 </#if>
70 </#if>
71</div>
72
73<div class="container-listado view-list -on container">
74 <div class="slide-box -viewPublicador">
75
76 </div>
77</div>
78
79
80<script>
81 var arrayMunicipios = [];
82 var municipiosID = [];
83
84 <#list entries as curEntry>
85
86
87
88 <#assign assetRenderer = curEntry.getAssetRenderer() journalArticle = assetRenderer.getAssetObject() />
89 <#assign renderer=curEntry.getAssetRenderer() />
90 <#assign className=renderer.getClassName() />
91 <#assign assetRenderer = curEntry.getAssetRenderer() journalArticle = assetRenderer.getAssetObject()/>
92 <#assign docXml = saxReaderUtil.read(curEntry.getAssetRenderer().getArticle().getContent()) />
93 <#assign artImagen = docXml.valueOf("//dynamic-element[@name='ImagenDestacada']/dynamic-content/text()") />
94 <#if (artImagen?? && artImagen != "") >
95 <#assign jsonObject = jsonFactoryUtil.createJSONObject(artImagen) />
96 <#assign dlAppServiceUtil = staticUtil["com.liferay.document.library.kernel.service.DLAppServiceUtil"] />
97 <#assign dlUtil = staticUtil["com.liferay.document.library.kernel.util.DLUtil"] />
98 <#attempt>
99 <#assign fileEntry = dlAppServiceUtil.getFileEntryByUuidAndGroupId(jsonObject.getString("uuid"), jsonObject.getLong("groupId")) />
100 <#assign urlImage = dlUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, '') />
101 <#recover>
102 <#assign urlImage ="" />
103 </#attempt>
104 <#else>
105 <#assign urlImage ="" />
106 </#if>
107
108 <#assign favouriteResource = favouriteResourceLocalService.fetchByAssetEntryIdAndUserId(curEntry.getEntryId(),themeDisplay.getUserId())!"">
109 <#if (favouriteResource?? && favouriteResource != "") >
110 <#assign isFavourite = "true" />
111 <#assign favouriteResourceId = favouriteResource.getFavouriteResourceId() />
112 <#else>
113 <#assign isFavourite = "false" />
114 <#assign favouriteResourceId = 0 />
115 </#if>
116
117 <#assign link=renderer.getURLViewInContext(renderRequest, renderResponse, '' ) />
118
119 <#assign link = link?remove_ending('1')?remove_ending('2')?remove_ending('3')>
120 <#if contentDisplayPageURL??>
121
122 <#assign link=contentDisplayPageURL + journalArticle.getUrlTitle(themeDisplay.getLocale()) />
123
124 <#assign link=link + "?redirect=" + portalUtil.getCurrentURL(renderRequest) />
125 </#if>
126 <#assign link = link?replace(" ", "-")?replace("%C3%A1","a")?replace("%C3%A9","e")?replace("%C3%AD","i")?replace("%C3%B3","o")?replace("%C3%BA","u")?replace("%C3%B1","n")?replace("%C3%9A","u")>
127 <#assign categories = curEntry.getCategories() />
128 <#assign minititle= '${curEntry.getTitle(locale)}'>
129 <#if minititle?length < 30>
130 <#assign minititle= minititle />
131 <#else>
132 <#assign minititle= minititle?substring(0,30) + '...' />
133 <#assign minititle= minititle?replace("'", "") />
134 </#if>
135 var municipios = [];
136 var municipiosID =[];
137 <#list categories as category>
138 <#assign countContent = curEntry?index/>
139 <#if (category.vocabularyId == 340465 || category.categoryId == 1122644)>
140
141 <#assign destacado = '${category.categoryId}' />
142
143
144
145 <#if (category.vocabularyId == 340465)>
146 <#assign link = link + "?filterCategoryIds="+ category.categoryId +"&operationType=AND"/>
147 <#assign municipio = category.name/>
148 municipios.push('${municipio}');
149 <#assign municipioId = category.categoryId/>
150 municipiosID.push('${municipioId}');
151 </#if>
152 </#if>
153 </#list>
154
155 <#if (urlImage?has_content)>
156 var testFavorite = "${isFavourite}";
157 arrayMunicipios.push({
158 'titulo': '${minititle}',
159 'urlImg': '${urlImage}',
160 'linkUrl': '${link}',
161 'destacado': '${destacado}',
162 'municipio': municipios,
163 'municipioID' : municipiosID,
164 'typeStructure' : '',
165 'isFavourite' : '${isFavourite}',
166 'favouriteResourceId' : '${favouriteResourceId}',
167 'currentAssetEntryId' : '${curEntry.getEntryId()}'
168 });
169 <#else>
170 arrayMunicipios.push({
171 'titulo': '${minititle}',
172 'urlImg': '${urlImage}',
173 'linkUrl': '${link}',
174 'destacado': '${destacado}',
175 'municipio': municipios,
176 'municipioID' : municipiosID,
177 'typeStructure' : '${curEntry.classTypeId}',
178 'isFavourite' : '${isFavourite}',
179 'favouriteResourceId' : '${favouriteResourceId}',
180 'currentAssetEntryId' : '${curEntry.getEntryId()}'
181 });
182 </#if>
183
184 </#list>
185 console.log(arrayMunicipios);
186</script>
187<#else>
188<#assign countContent = 0/>
189<div class="align-items-center d-flex justify-content-center mt-6">
190 <h3 class="text-center"><@liferay.language key='ningun-resultado'/></h3>
191</div>
192</#if>
193
194<div id="popupAdd">
195 <div class="containerPopUp">
196 <span id="close">?</span>
197 <div class="sign-out text-center">
198 <strong class="text-center mb-0">
199 <@liferay.language key="must-login-label"/><br>
200 </strong>
201 <p class="text-center mb-0">
202 <@liferay.language key="must-login-label-2" />
203 </p>
204 <a class="btn btn-default btn-primary mt-4 mx-auto p-3 " href="/web/jaen-paraiso-interior/login?p_p_id=com_liferay_login_web_portlet_LoginPortlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&saveLastPath=false&_com_liferay_login_web_portlet_LoginPortlet_mvcRenderCommandName=%2Flogin%2Flogin">ACCEDER</a>
205 </div>
206 <div class="sign-in">
207 <div class="d-flex flex-wrap justify-content-between">
208 <div class="calendar-info">
209 <div class="calendar">
210 <label class="control-label" for="tripDate"><@liferay.language key='trip-planing-date' /></label>
211 <input class="field form-control success-field" type="text" id="tripDate" name="tripDate" />
212 <input type="hidden" id="currentAssetEntryId" name="currentAssetEntryId" />
213 </div>
214 </div>
215 <div class="info-visit">
216 <div class="form-group input-select-wrapper has-success">
217 <label class="control-label" for="timeVisit"><@liferay.language key='label-last-visit-duration' /></label>
218 <select name="timeVisit" id="timeVisit" class="form-control success-field">
219 <option value="one-hour"><@liferay.language key="one-hour" /></option>
220 <option value="two-hour"><@liferay.language key="two-hour" /></option>
221 <option value="three-hour"><@liferay.language key="three-hour" /></option>
222 <option value="five-hour"><@liferay.language key="five-hour" /></option>
223 <option value="eight-hour"><@liferay.language key="eight-hour" /></option>
224 <option value="one-day"><@liferay.language key="one-day" /></option>
225 <option value="two-day"><@liferay.language key="two-day" /></option>
226 <option value="three-day"><@liferay.language key="three-day" /></option>
227 <option value="five-day"><@liferay.language key="five-day" /></option>
228 </select>
229 </div>
230 </div>
231 </div>
232 <div class="add-note mt-3">
233 <label class="control-label" for="addNote"><@liferay.language key='label-add-note' /></label>
234 <textarea class="field form-control" type="textarea" id="addNote" name="addNote" ></textarea>
235 </div>
236 <div class="align-items-baseline d-flex flex-wrap justify-content-between mt-1">
237 <div class="button-holder">
238 <button class="btn btn-primary btn-default" id="saveFavourite" onClick="addFavorite()"><span class="lfr-btn-label"><@liferay.language key="save" /></span></button>
239 <button class="btn btn-cancel btn-default btn-link" id="closePopupButton"><span class="lfr-btn-label"><@liferay.language key="cancel" /></span></button>
240 <a href="/web/jaen-paraiso-interior/mi-viaje" class="link-enlace">VER MI VIAJE</a>
241 </div>
242 </div>
243 </div>
244 </div>
245</div>
246
247<script>
248$(document).ready(function() {
249
250
251
252let Tam = municipiosGroup.length;
253var igual = false;
254function bantrue() {
255 for ( let i = 0; i < Tam-1; i++){
256 if (municipiosGroup[i] == municipiosGroup[i+1]) {
257 igual = true
258 }else{
259 igual = false
260 break
261 }
262 }
263 return igual
264}
265
266if (bantrue() === true){
267
268}else{
269 $('.tags[data-ingrediente="municipio"]').remove();
270}
271
272//IMÃ?GENES FICHAS RANDOM
273var structureAlojamiento = {
274 id: 114246,
275 name: 'alojamientos'
276}
277var structureAlojamientoCongresos = {
278 id: 1211192,
279 name: 'alojamientos'
280}
281var structureRestaurantes = {
282 id: 369408,
283 name: 'restaurantes'
284}
285var structureEmpresas = {
286 id: 340452,
287 name: 'empresas'
288}
289var classTypeIdAlojamiento = {
290 id: 114247,
291 name: 'alojamientos'
292}
293var classTypeIdCongresos = {
294 id: 1211193,
295 name: 'alojamientos'
296}
297var classTypeIdRestaurantes = {
298 id: 369409,
299 name: 'restaurantes'
300}
301var classTypeIdEmpresas = {
302 id: 340453,
303 name: 'empresas'
304}
305function imgFichaRandom(id, name) {
306 $(".box-img").each(function (element) {
307 if ($(this).attr('data-id-estructure') == id) {
308 var randomPick = name + Math.floor(Math.random() * (10 - 1))
309 var url = "/o/jaen-theme/images/img-fichas/" + randomPick + ".jpg";
310 //console.log($(this).attr('data-id-estructure'))
311 $(this).css("background-image", 'url(' + url + ')');
312 }
313 });
314}
315
316
317 arrayMunicipios.forEach((element,index) =>{
318 var favoriteClass = "";
319 if (element.isFavourite == "true") {
320 favoriteClass = "fill";
321 }
322 if(element.municipio.length == 1){
323 element.municipio = element.municipio;
324 }
325 else{
326 element.municipio = '<@liferay.language key='varias-poblaciones'/></span>';
327 }
328 if(index < 12){
329
330 $('.slide-box.-viewPublicador').append('<input type="hidden" id="favouriteResourceId'+element.currentAssetEntryId+'" value="'+element.favouriteResourceId+'" /><a href="'+element.linkUrl+'" class="card-el"><div class="card-slide"><div class="box-img" data-id-estructure="'+element.typeStructure+'" style="background-image: url('+element.urlImg+')"></div><div class="card-text o"><p id="title'+ element.currentAssetEntryId +'" class="title">'+element.titulo+'</p><span id="like">'+element.municipio+'</span><span id="favourites" onClick="manageFavorite(event,this,'+element.favouriteResourceId+','+element.currentAssetEntryId+');" class="'+favoriteClass+' '+ element.currentAssetEntryId +'"></span></div></div></a>');
331
332 imgFichaRandom(structureAlojamiento.id, structureAlojamiento.name);
333 imgFichaRandom(structureAlojamientoCongresos.id, structureAlojamientoCongresos.name);
334 imgFichaRandom(structureRestaurantes.id, structureRestaurantes.name);
335 imgFichaRandom(structureEmpresas.id, structureEmpresas.name);
336 imgFichaRandom(classTypeIdAlojamiento.id, classTypeIdAlojamiento.name);
337 imgFichaRandom(classTypeIdCongresos.id, classTypeIdCongresos.name);
338 imgFichaRandom(classTypeIdRestaurantes.id, classTypeIdRestaurantes.name);
339 imgFichaRandom(classTypeIdEmpresas.id, classTypeIdEmpresas.name);
340
341 }
342
343
344 })
345
346
347})
348</script>
349<style>
350.slide-box.-viewPublicador{
351 margin-bottom:0;
352}
353
354#favourites{
355 position: absolute;
356 bottom: 2%;
357 right: 2%;
358 background-image: url(/o/jaen-theme/images/iconos/corazon-linea.svg);
359 background-size: 35px;
360 background-repeat: no-repeat;
361 display: block;
362 width: 44px;
363 height: 44px;
364 background-position: center center;
365 cursor: pointer;
366}
367
368#favourites.fill {
369 background-image: url(/o/jaen-theme/images/iconos/corazon-fill.svg);
370 background-size: 100%;
371 background-repeat: no-repeat;
372}
373
374span#like {
375 max-width: 68%;
376 width: max-content;
377 color: #525252;
378}
379</style>
380<script>
381 $('#tripDate').daterangepicker({
382 "minDate": new Date(),
383 "autoApply" : true,
384 "locale": {
385 "format": "MM/DD/YYYY",
386 "separator": " - ",
387 "applyLabel": "Aplicar",
388 "cancelLabel": "Cancelar",
389 "fromLabel": "Desde",
390 "toLabel": "A",
391 "customRangeLabel": "Personalizada",
392 "weekLabel": "W",
393 "daysOfWeek": [
394 "DO",
395 "LUN",
396 "MAR",
397 "MIE",
398 "JUE",
399 "VI",
400 "SA"
401 ],
402 "monthNames": [
403 "Enero",
404 "Febrero",
405 "Marzo",
406 "Abril",
407 "Mayo",
408 "Junio",
409 "Julio",
410 "Agosto",
411 "Septiembre",
412 "Octubre",
413 "Noviembre",
414 "Diciembre"
415 ],
416 "firstDay": 1
417 }
418 });
419
420 $( "#close,#closePopupButton" ).click(function() {
421 $('#popupAdd').removeClass('on');
422 $('#timeVisit').prop('selectedIndex',0);
423 $('#addNote').val('');
424 var today = new Date();
425 var dd = String(today.getDate()).padStart(2, '0');
426 var mm = String(today.getMonth() + 1).padStart(2, '0');
427 var yyyy = today.getFullYear();
428 today = mm + '/' + dd + '/' + yyyy;
429 var tripDate = today + " - " + today;
430 $('#tripDate').val(tripDate);
431 $("#select2-timeVisit-container").text("");
432 });
433
434 function addFavorite() {
435 if (Liferay.ThemeDisplay.isSignedIn()) {
436 var currentSelectedEntryId = $('#currentAssetEntryId').val();
437 Liferay.Service('/jaen.favouriteresource/add-favourite-resource',
438 {
439 pageArticleId: currentSelectedEntryId,
440 lastVisitTime: $('#timeVisit').val(),
441 tripDate: $('#tripDate').val(),
442 note: $('#addNote').val(),
443 scopeGroupId: Liferay.ThemeDisplay.getScopeGroupId(),
444 userId: Liferay.ThemeDisplay.getUserId(),
445 companyId: Liferay.ThemeDisplay.getCompanyId()
446 },
447 function(obj) {
448 $('#popupAdd').removeClass('on');
449 $('.'+currentSelectedEntryId).addClass("fill");
450 $("#favouriteResourceId"+currentSelectedEntryId).val(obj);
451 $('#timeVisit').prop('selectedIndex',0);
452 $('#addNote').val('');
453 var today = new Date();
454 var dd = String(today.getDate()).padStart(2, '0');
455 var mm = String(today.getMonth() + 1).padStart(2, '0');
456 var yyyy = today.getFullYear();
457 today = mm + '/' + dd + '/' + yyyy;
458 var tripDate = today + " - " + today;
459 $('#tripDate').val(tripDate);
460 $("#select2-timeVisit-container").text("");
461 });
462 }
463 }
464 function manageFavorite (event, element, favouriteResourceId, currentAssetEntryId) {
465 if (element.classList.contains("fill")) {
466 favouriteResourceId = $("#favouriteResourceId"+currentAssetEntryId).val();
467 Liferay.Service('/jaen.favouriteresource/delete-favourite-resource',
468 {
469 'favouriteResourceId' : favouriteResourceId
470 },
471 function(obj) {
472 element.classList.remove("fill");
473 $("#favouriteResourceId"+currentAssetEntryId).val('');
474 }
475 );
476 } else {
477 $('#popupAdd').addClass('on');
478 if ($("#timeVisit").next().hasClass("select2")) {
479 $("#timeVisit").removeClass("select2-hidden-accessible");
480 $("#timeVisit").next().remove();
481 }
482 $('#currentAssetEntryId').val(currentAssetEntryId);
483 $('#popupAdd').find('.sign-in').prepend('<h2 id="page-article-title"></h2>');
484 $('#page-article-title').text($("#title"+currentAssetEntryId).text());
485 }
486 event.preventDefault();
487 }
488</script>
489
490<style>
491#popupAdd {
492 display: none;
493}
494 #popupAdd.on {
495 display: block;
496 position: fixed;
497 z-index: 20;
498 background: rgba(0, 0, 0, 0.4);
499 width: 100%;
500 height: 100%;
501 right: 0;
502 left: 0;
503 top: 0;
504 bottom: 0;
505 display: flex;
506 justify-content: center;
507 align-items: center;
508}
509 #popupAdd .containerPopUp {
510 background: white;
511 width: 100%;
512 max-width: 730px;
513 padding: 40px;
514 position: relative;
515 top: 6vh;
516}
517 #popupAdd .containerPopUp label {
518 text-transform: uppercase;
519}
520 #popupAdd .containerPopUp #close {
521 position: absolute;
522 right: -30px;
523 top: 0;
524 font-size: 24px;
525 cursor: pointer;
526 width: 44px;
527 text-align: right;
528 height: 36px;
529 color: white;
530 background: #12b75d;
531 text-align: center;
532}
533 #popupAdd .containerPopUp h2 {
534 text-align: center;
535 margin-bottom: 30px;
536 font-size: 42px;
537}
538 #popupAdd .containerPopUp .calendar-info {
539 width: 45%;
540}
541 #popupAdd .containerPopUp .calendar-info p {
542 font-size: 17px;
543 text-align: center;
544 margin-bottom: 10px;
545}
546 #popupAdd .containerPopUp .info-visit {
547 width: 48%;
548}
549 #popupAdd .containerPopUp .info-visit p {
550 margin-bottom: 10px;
551 font-size: 17px;
552}
553 #popupAdd .containerPopUp .info-visit select {
554 border: 1px solid #4a4a4a;
555 padding: 5px 15px;
556 width: 100%;
557 border-radius: 0;
558}
559 #popupAdd .containerPopUp .info-visit select:focus {
560 outline: none;
561 box-shadow: none;
562}
563 #popupAdd .containerPopUp .calendar .form-control {
564 border: 1px solid #4a4a4a;
565 padding: 5px 15px;
566 width: 100%;
567 border-radius: 0;
568}
569 #popupAdd .containerPopUp .calendar .form-control:focus {
570 outline: none;
571 box-shadow: none;
572}
573 #popupAdd .containerPopUp .add-note p {
574 font-size: 17px;
575 margin-bottom: 5px;
576 margin-left: 3px;
577}
578 #popupAdd .containerPopUp .add-note textarea {
579 border: 1px solid #4a4a4a;
580 padding: 5px 15px;
581 width: 100%;
582 border-radius: 0;
583}
584 #popupAdd .containerPopUp .add-note textarea:focus {
585 outline: none;
586 box-shadow: none;
587}
588 #popupAdd .containerPopUp button {
589 line-height: 0.5;
590 cursor: pointer;
591 border-radius: 0;
592 text-transform: uppercase;
593 padding: 15px 25px;
594 background-color: #12b75d;
595 border: 0;
596 color: white;
597 font-weight: normal;
598 margin-right: 15px;
599}
600 #popupAdd .containerPopUp button:focus {
601 outline: none;
602 border: 0;
603 box-shadow: none;
604}
605 #popupAdd .btn.btn-default.btn-primary:focus {
606 background: #12b75d;
607 border-color: #12b75d;
608 outline: none;
609 box-shadow: none;
610}
611 body.signed-out .sign-out, body.signed-in .sign-in {
612 display: block;
613}
614 body.signed-out .sign-in, body.signed-in .sign-out {
615 display: none;
616}
617</style>