(Deberás registrarte para poder obtener sugerencias y propuestas personalizadas para tu perfil e intereses)
Buscar Restaurar
Se ha producido un error al procesar la plantilla.
The following has evaluated to null or missing:
==> destacado  [in template "20101#20127#5147673" at line 261, column 37]

----
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: ${destacado}  [in template "20101#20127#5147673" at line 261, column 35]
----
1<head> 
2<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' /> 
3 
4</head> 
5 
6<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"></script>  
7<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.3/mapbox.js'></script> 
8<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.3/mapbox.css' rel='stylesheet' /> 
9<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/leaflet.markercluster.js'></script> 
10<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.css' rel='stylesheet' /> 
11<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.Default.css' rel='stylesheet' /> 
12<script src="/o/jaen-theme/js/moment.min.js"></script> 
13<script src="/o/jaen-theme/js/daterangepicker.min.js"></script> 
14<link rel="stylesheet" href="/o/jaen-theme/css/daterangepicker.css" /> 
15<link rel="stylesheet" href="/o/jaen-theme/css/starrangepicker.css" /> 
16 
17 
18 
19<script> 
20 var arrayMunicipios = []; 
21</script> 
22 
23<div id="hidden-ratings" style="display:none;"> 
24<#list entries as curEntry> 
25	<div id="ratings-${curEntry.getEntryId()}"> 
26		<@liferay_ui.ratings className="com.liferay.asset.kernel.model.AssetEntry" classPK=curEntry.getClassPK() type="stars" /> 
27	</div> 
28</#list> 
29</div> 
30 
31 
32 
33<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()> 
34<#assign favouriteResourceLocalService = serviceLocator.findService("com.jaen.favourite.resource.service.FavouriteResourceLocalService")> 
35 
36<#assign themeDisplay = serviceContext.getThemeDisplay() /> 
37<#assign currentUrl = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() /> 
38 
39<#if entries?has_content> 
40<#assign municipioArray = []> 
41 
42 <#list entries as curEntry> 
43    <#assign categories = curEntry.getCategories() /> 
44    <#list categories as category> 
45        <#if category?has_content> 
46        <#if (category.vocabularyId = 340465 )>  
47            <#if category?counter gt 1> 
48                <#assign municipio = category.categoryId /> 
49                <#assign municipioArray = municipioArray + [municipio]>  
50                <#assign municipioName = category.name/> 
51                <#assign UrlClean = category.name?lower_case?replace(" ", "-")?replace("á", "a")?replace("é", "e")?replace("í", "i")?replace("ó", "o")?replace("ú", "u")?replace("ñ", "n")?replace("ü", "u")>    
52                <#break> 
53            </#if> 
54        </#if> 
55        </#if> 
56         
57    </#list> 
58</#list> 
59 
60 
61<#if municipioArray?has_content> 
62<#assign primerMuni = municipioArray[0]> 
63<#assign isEqual = 1> 
64<#list municipioArray as muni> 
65    <#if (primerMuni == muni)> 
66        <#assign isEqual = 1> 
67    <#else> 
68        <#assign isEqual = 0> 
69    </#if> 
70</#list>  
71</#if> 
72<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()> 
73<#assign themeDisplay = serviceContext.getThemeDisplay() /> 
74<#assign currentUrl = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() /> 
75 
76<div class="container-listado view-list -on container"> 
77    <div class="slide-box -viewPublicador"> 
78        <span  hidden class="btn-subir" ></span > 
79    </div> 
80</div> 
81<div class="container-mapa view-map container -on"> 
82    <div id="map"></div> 
83     <div class="nav-sitios" hidden> 
84        <ul> 
85        <span class="close"></span> 
86        <#if entries?has_content> 
87            <#list entries as curEntry> 
88                <#assign categories = curEntry.getCategories() /> 
89                <#list categories as category> 
90                <#if category?has_content> 
91                    <#if (category.vocabularyId = 340465 )>  
92                       <#assign municipioName = category.name/> 
93                        <#--  ${municipioName}  --> 
94                        <#assign UrlClean = category.name?lower_case?replace(" ", "-")?replace("á", "a")?replace("é", "e")?replace("í", "i")?replace("ó", "o")?replace("ú", "u")?replace("ñ", "n")?replace("ü", "u")> 
95                        <#assign 
96                        assetRenderer = curEntry.getAssetRenderer() 
97                        journalArticle = assetRenderer.getAssetObject()     
98                        /> 
99                        <#assign renderer=curEntry.getAssetRenderer() /> 
100                        <#assign className=renderer.getClassName() /> 
101                        <#assign link=renderer.getURLViewInContext(renderRequest, renderResponse, '' ) /> 
102 
103                        <#assign infoStructure = "circle"/> 
104                        <#assign colorIcon = "#ff9234"/> 
105                         
106                        <#if (curEntry.classTypeId == 340453)> 
107                            <#assign infoStructure = "shop"/> 
108                            <#assign colorIcon = "#fe8a71"/> 
109                        </#if> 
110                        <#if (curEntry.classTypeId == 439167)> 
111                                <#assign infoStructure = "village"/> 
112                                <#assign colorIcon = "#ff9234"/> 
113                        </#if> 
114                        <#if (curEntry.classTypeId == 114247) || (curEntry.classTypeId == 1211193)> 
115                            <#assign infoStructure = "commercial"/> 
116                            <#assign colorIcon = "#35d0ba"/> 
117                        </#if> 
118                        <#if (curEntry.classTypeId == 369409)> 
119                            <#assign infoStructure = "restaurant"/> 
120                            <#assign colorIcon = "#0e9aa7"/> 
121                        </#if>  
122 
123                       <span data-url="${link}"  data-structure="${infoStructure}" data-color="${colorIcon}">             
124                        <@liferay_journal["journal-article"] 
125                            articleId=journalArticle.getArticleId() 
126                            ddmTemplateKey="1641310" 
127                            groupId=journalArticle.getGroupId() 
128                            /> 
129                        </span> 
130                    </#if> 
131                </#if> 
132                </#list>         
133            </#list> 
134        </#if> 
135        </ul> 
136    </div> 
137</div> 
138 
139<script> 
140 
141	<#list entries as curEntry> 
142 
143             
144        <#assign assetRenderer = curEntry.getAssetRenderer() journalArticle = assetRenderer.getAssetObject()    /> 
145        <#assign renderer=curEntry.getAssetRenderer() /> 
146        <#assign className=renderer.getClassName() /> 
147        <#assign assetRenderer = curEntry.getAssetRenderer() journalArticle = assetRenderer.getAssetObject()/> 
148        <#assign docXml = saxReaderUtil.read(curEntry.getAssetRenderer().getArticle().getContent()) /> 
149        <#assign artImagen = docXml.valueOf("//dynamic-element[@name='ImagenDestacada']/dynamic-content/text()") /> 
150         
151		<#attempt> 
152			<#if (artImagen?? && artImagen != "") >   
153				<#assign jsonObject = jsonFactoryUtil.createJSONObject(artImagen) /> 
154				<#assign dlAppServiceUtil = staticUtil["com.liferay.document.library.kernel.service.DLAppServiceUtil"] /> 
155					<#assign dlUtil = staticUtil["com.liferay.document.library.kernel.util.DLUtil"] /> 
156					<#assign fileEntry = dlAppServiceUtil.getFileEntryByUuidAndGroupId(jsonObject.getString("uuid"), jsonObject.getLong("groupId")) /> 
157					<#assign urlImage = dlUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, '') /> 
158				 
159				<#else> 
160				<#assign artImagen2 = docXml.valueOf("//dynamic-element[@name='ImagenPrincipal1']/dynamic-content/text()") /> 
161				<#assign jsonObject = jsonFactoryUtil.createJSONObject(artImagen2) /> 
162				<#assign dlAppServiceUtil = staticUtil["com.liferay.document.library.kernel.service.DLAppServiceUtil"] /> 
163					<#assign dlUtil = staticUtil["com.liferay.document.library.kernel.util.DLUtil"] /> 
164					<#assign fileEntry = dlAppServiceUtil.getFileEntryByUuidAndGroupId(jsonObject.getString("uuid"), jsonObject.getLong("groupId")) /> 
165					<#assign urlImage = dlUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, '') /> 
166			</#if>	 
167		<#recover> 
168			<#assign urlImage ="" /> 
169		</#attempt> 
170 
171       
172        <#attempt>     
173		<#assign favouriteResource = favouriteResourceLocalService.fetchByAssetEntryIdAndUserId(curEntry.getEntryId(),themeDisplay.getUserId())!""> 
174		<#if (favouriteResource?? && favouriteResource != "") > 
175			<#assign isFavourite = "true" /> 
176			<#assign favouriteResourceId = favouriteResource.getFavouriteResourceId() /> 
177		<#else> 
178			<#assign isFavourite = "false" /> 
179			<#assign favouriteResourceId = 0 /> 
180		</#if> 
181		<#recover> 
182			<#assign isFavourite = "false" /> 
183			<#assign favouriteResourceId = 0 /> 
184		</#attempt> 
185		 
186        <#assign link=renderer.getURLViewInContext(renderRequest, renderResponse, '' ) /> 
187  
188        <#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")> 
189        
190 
191        
192        <#if curEntry.classTypeId = 439167 > 
193            <#assign link = link?remove_ending('1')?remove_ending('2')?remove_ending('3') /> 
194        </#if> 
195 
196        var municipios = []; 
197        var municipiosID = []; 
198        var tipoContenido = []; 
199        var categorias = []; 
200 
201         
202        
203        <#assign minititle= '${curEntry.getTitle(locale)}'> 
204        <#if minititle?length &lt; 30> 
205             <#assign minititle= minititle /> 
206        <#else> 
207            <#assign minititle= minititle?substring(0,30) + '...' /> 
208        </#if> 
209 
210        <#assign countContent = curEntry?index/> 
211 
212     
213        <#assign categories = curEntry.getCategories() /> 
214        <#list categories as category> 
215 
216         <#assign destacado = '${category.categoryId}' /> 
217  
218         <#if (category.vocabularyId = 5147398 )>  
219                tipoContenido.push({ 
220                    'name': '${category.name}', 
221                    'idCat': '${category.categoryId}', 
222                }) 
223        </#if> 
224        <#if (category.vocabularyId != 340465)> 
225            <#assign categoryID =  category.categoryId/> 
226            categorias.push('${categoryID}') 
227         </#if> 
228         <#if (category.vocabularyId == 340465)> 
229             <#assign link = link + "?filterCategoryIds="+ category.categoryId +"&operationType=AND" > 
230             municipiosID.push('${category.categoryId}'); 
231             municipios.push('${category.name}'); 
232        </#if> 
233 
234 
235 
236       </#list> 
237   
238 
239            <#if (urlImage?has_content)> 
240                arrayMunicipios.push({ 
241                    'titulo': '${minititle}', 
242                    'urlImg': '${urlImage}', 
243                    'linkUrl': '${link}', 
244                    'destacado': '${destacado}', 
245                    'municipioID' : municipiosID, 
246                    'municipio': municipios, 
247                    'categorias': categorias, 
248                    'tipoContenido' : tipoContenido, 
249                    'typeStructure' : '', 
250					'isFavourite' : '${isFavourite}', 
251					'favouriteResourceId' : '${favouriteResourceId}', 
252					'currentAssetEntryId' : '${curEntry.getEntryId()}', 
253					'currentAssetEntryCount' : '${curEntry.getViewCount()}', 
254					'currentAssetEntryClassPK' : '${curEntry.getClassPK()}' 
255                }); 
256            <#else>  
257                arrayMunicipios.push({ 
258                    'titulo': '${minititle}', 
259                    'urlImg': '${urlImage}', 
260                    'linkUrl': '${link}', 
261                    'destacado': '${destacado}', 
262                    'municipioID' : municipiosID, 
263                    'municipio': municipios, 
264                    'categorias': categorias, 
265                    'tipoContenido' : tipoContenido, 
266                    'typeStructure' : '${curEntry.classTypeId}', 
267					'isFavourite' : '${isFavourite}', 
268					'favouriteResourceId' : '${favouriteResourceId}', 
269					'currentAssetEntryId' : '${curEntry.getEntryId()}', 
270					'currentAssetEntryCount' : '${curEntry.getViewCount()}', 
271					'currentAssetEntryClassPK' : '${curEntry.getClassPK()}' 
272                }) 
273            </#if> 
274    
275         
276		 
277	</#list> 
278</script>	 
279<#else> 
280<#assign countContent = 0/> 
281<div class="align-items-center d-flex justify-content-center mt-6"> 
282    <h3 class="text-center"><@liferay.language key='ningun-resultado'/></h3> 
283</div> 
284</#if> 
285 
286<div id="popupAdd"> 
287	<div class="containerPopUp"> 
288		<span id="close">?</span> 
289		<div class="sign-out text-center"> 
290			<strong class="text-center mb-0"> 
291				<@liferay.language key="must-login-label"/><br> 
292			</strong> 
293			<p class="text-center mb-0"> 
294				<@liferay.language key="must-login-label-2" /> 
295			</p> 
296			<a class="btn btn-default btn-primary mt-4 mx-auto p-3 " href="/web/jaen-paraiso-interior/inicio_jaen?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> 
297		</div> 
298		<div class="sign-in"> 
299				<div class="d-flex flex-wrap justify-content-between"> 
300					<div class="calendar-info"> 
301						<div class="calendar"> 
302							<label class="control-label" for="tripDate"><@liferay.language key='trip-planing-date' /></label> 
303							<input class="field form-control success-field" type="text" id="tripDate" name="tripDate" /> 
304							<input type="hidden" id="currentAssetEntryId" name="currentAssetEntryId" /> 
305						</div> 
306					</div> 
307					<div class="info-visit"> 
308						<div class="form-group input-select-wrapper has-success"> 
309							<label class="control-label" for="timeVisit"><@liferay.language key='label-last-visit-duration' /></label> 
310							<select name="timeVisit" id="timeVisit" class="form-control success-field"> 
311								<option value="one-hour"><@liferay.language key="one-hour" /></option> 
312								<option value="two-hour"><@liferay.language key="two-hour" /></option> 
313								<option value="three-hour"><@liferay.language key="three-hour" /></option> 
314								<option value="five-hour"><@liferay.language key="five-hour" /></option> 
315								<option value="eight-hour"><@liferay.language key="eight-hour" /></option> 
316								<option value="one-day"><@liferay.language key="one-day" /></option> 
317								<option value="two-day"><@liferay.language key="two-day" /></option> 
318								<option value="three-day"><@liferay.language key="three-day" /></option> 
319								<option value="five-day"><@liferay.language key="five-day" /></option> 
320							</select> 
321						</div> 
322					</div> 
323				</div> 
324				<div class="add-note mt-3"> 
325					<label class="control-label" for="addNote"><@liferay.language key='label-add-note' /></label> 
326					<textarea class="field form-control" type="textarea" id="addNote" name="addNote" ></textarea> 
327				</div> 
328				<div class="align-items-baseline d-flex flex-wrap justify-content-between mt-1"> 
329					<div class="button-holder"> 
330						<button class="btn  btn-primary btn-default" id="saveFavourite" onClick="addFavorite()"><span class="lfr-btn-label"><@liferay.language key="save" /></span></button> 
331						<button class="btn  btn-cancel btn-default btn-link" id="closePopupButton"><span class="lfr-btn-label"><@liferay.language key="cancel" /></span></button> 
332						<a href="/web/jaen-paraiso-interior/mi-viaje" class="link-enlace">VER MI VIAJE</a> 
333					</div> 
334				</div> 
335		</div> 
336	</div> 
337</div> 
338 
339 
340<style> 
341.slide-box.-viewPublicador{ 
342    margin-bottom:0; 
343
344.hide { 
345  display: none; 
346
347   
348.more:hover + .hide { 
349 display: block!important; 
350 padding-top: 16px; 
351 position: absolute; 
352  
353   
354
355.card-slide { 
356    position: unset!important; 
357
358 
359#favourites{ 
360	position: absolute; 
361    bottom: 2%; 
362    right: 2%; 
363	background-image: url(/o/jaen-theme/images/iconos/corazon-linea.svg); 
364    background-size: 35px; 
365    background-repeat: no-repeat; 
366    display: block; 
367    width: 44px; 
368    height: 44px; 
369    background-position: center center; 
370    cursor: pointer; 
371
372 
373#favourites.fill { 
374    background-image: url(/o/jaen-theme/images/iconos/corazon-fill.svg); 
375    background-size: 100%; 
376    background-repeat: no-repeat; 
377
378 
379span#like { 
380	max-width: 68%; 
381	width: max-content; 
382
383</style> 
384 
385<script> 
386$(document).ready(function (){ 
387 
388	var structureAlojamiento = { 
389		id: 114246, 
390		name: 'alojamientos' 
391	}; 
392	var structureAlojamientoCongresos = { 
393		id: 1211192, 
394		name: 'alojamientos' 
395	}; 
396	var structureRestaurantes = { 
397		id: 369408, 
398		name: 'restaurantes' 
399	}; 
400	var structureEmpresas = { 
401		id: 340452, 
402		name: 'empresas' 
403	}; 
404	var classTypeIdAlojamiento = { 
405		id: 114247, 
406		name: 'alojamientos' 
407	}; 
408	var classTypeIdCongresos = { 
409		id: 1211193, 
410		name: 'alojamientos' 
411	}; 
412	var classTypeIdRestaurantes = { 
413		id: 369409, 
414		name: 'restaurantes' 
415	}; 
416	var classTypeIdEmpresas = { 
417		id: 340453, 
418		name: 'empresas' 
419	}; 
420	 
421	function imgFichaRandom(id, name) { 
422	console.log("imgFichaRandom2"); 
423		$(".box-img").each(function (element) { 
424			if ($(this).attr('data-id-estructure') == id) { 
425				var randomPick = name + Math.floor(Math.random() * (10 - 1)); 
426				var url = "/o/jaen-theme/images/img-fichas/" + randomPick + ".jpg"; 
427				$(this).css("background-image", 'url(' + url + ')'); 
428
429		}); 
430
431	 
432	//let hash = {}; 
433	//arrayMunicipios = arrayMunicipios.filter(o => hash[o.titulo] ? false : hash[o.titulo] = true); 
434 
435	function ordenar(array, searchCategory) { 
436		return array.sort(function (a, b) { 
437			if (a.categorias.includes(searchCategory)) { 
438				return -1; 
439			} else { 
440				return 0; 
441
442			return 1; 
443		}); 
444
445	 
446	//arrayMunicipiosOrdenados = ordenar(arrayMunicipios, '1122644'); 
447	//arrayMunicipiosOrdenados = ordenar(arrayMunicipios, '6034376'); 
448	arrayMunicipiosOrdenados = arrayMunicipios; 
449	 
450	function paintCard(element, index) { 
451		var favoriteClass = ""; 
452		let numberTypeCurrentAssetEntryId = Number(element.currentAssetEntryId); 
453		var ratingContent = $('#ratings-'+element.currentAssetEntryId).clone().html(); 
454		$('#ratings-'+element.currentAssetEntryId).html(""); 
455		if (element.isFavourite == "true") { 
456			favoriteClass = "fill"; 
457
458 
459		if (element.municipio.length > 1) { 
460			var muni = element.municipio; 
461			var first = muni.shift(); 
462			$('.slide-box.-viewPublicador').append('<input type="hidden" id="favouriteResourceId' + element.currentAssetEntryId + '" value="' + element.favouriteResourceId + '" /><a  href="' + element.linkUrl + '" class="card-el" onClick="incrementViewCounter('+element.currentAssetEntryClassPK+')"><div class="card-slide ' + element.currentAssetEntryId + '"><div class="box-img lazyload" data-id-estructure="' + element.typeStructure + '" data-bg="' + element.urlImg + '"></div><div class="card-text '+ element.currentAssetEntryId +'" style=" height: 200px; max-width: 513px; "><p id="title' + element.currentAssetEntryId + '" class="title">' + element.titulo + '</p><span id="like">' + first + ' <span class="more"> ...</span><span class="hide">' + muni.toString() + '</span></span><span id="favourites" onClick="manageFavorite(event,this,' + element.favouriteResourceId + ',' + element.currentAssetEntryId + ');" class="' + favoriteClass + ' ' + element.currentAssetEntryId + '"></span></div></div></a>'); 
463			$('.card-text.'+ element.currentAssetEntryId).append(ratingContent); 
464			if (element.currentAssetEntryCount <=1) { 
465				$('.card-text.'+ element.currentAssetEntryId).append('<span class="view-count-info">'+element.currentAssetEntryCount+' <@liferay.language key='view'/></span>'); 
466			} else { 
467				$('.card-text.'+ element.currentAssetEntryId).append('<span class="view-count-info">'+element.currentAssetEntryCount+' <@liferay.language key='views'/></span>'); 
468
469			for (var i = 0; i < element.tipoContenido.length; i++) { 
470				nameCont = element.tipoContenido[i].name; 
471				idCat = element.tipoContenido[i].idCat; 
472				$('.card-text.'+ element.currentAssetEntryId).append('<div class="tipo-ficha" data-id="' + idCat + '"><span>' + nameCont + '</span></div>'); 
473
474			if( element.urlImg == ""){ 
475 
476			imgFichaRandom(structureAlojamiento.id, structureAlojamiento.name); 
477			imgFichaRandom(structureAlojamientoCongresos.id, structureAlojamientoCongresos.name); 
478			imgFichaRandom(structureRestaurantes.id, structureRestaurantes.name); 
479			imgFichaRandom(structureEmpresas.id, structureEmpresas.name); 
480			imgFichaRandom(classTypeIdAlojamiento.id, classTypeIdAlojamiento.name); 
481			imgFichaRandom(classTypeIdCongresos.id, classTypeIdCongresos.name); 
482			imgFichaRandom(classTypeIdRestaurantes.id, classTypeIdRestaurantes.name); 
483			imgFichaRandom(classTypeIdEmpresas.id, classTypeIdEmpresas.name); 
484
485		} else { 
486			$('.slide-box.-viewPublicador').append('<input type="hidden" id="favouriteResourceId' + element.currentAssetEntryId + '" value="' + element.favouriteResourceId + '" /><a  href="' + element.linkUrl + '" class="card-el" onClick="incrementViewCounter('+element.currentAssetEntryClassPK+')"><div class="card-slide"><div class="box-img lazyload" data-id-estructure="' + element.typeStructure + '" data-bg="' + element.urlImg + '"></div><div class="card-text o '+element.currentAssetEntryId+'" style=" height: 200px; max-width: 513px; "><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>'); 
487			$('.card-text.'+ element.currentAssetEntryId).append(ratingContent); 
488			if (element.currentAssetEntryCount <=1) { 
489				$('.card-text.'+ element.currentAssetEntryId).append('<span class="view-count-info">'+element.currentAssetEntryCount+' <@liferay.language key='view'/></span>'); 
490			} else { 
491				$('.card-text.'+ element.currentAssetEntryId).append('<span class="view-count-info">'+element.currentAssetEntryCount+' <@liferay.language key='views'/></span>'); 
492
493			for (var i = 0; i < element.tipoContenido.length; i++) { 
494				nameCont = element.tipoContenido[i].name; 
495				idCat = element.tipoContenido[i].idCat; 
496				$('.card-text.'+ element.currentAssetEntryId).append('<div class="tipo-ficha" data-id="' + idCat + '"><span>' + nameCont + '</span></div>'); 
497
498			if( element.urlImg == ""){ 
499			imgFichaRandom(structureAlojamiento.id, structureAlojamiento.name); 
500			imgFichaRandom(structureAlojamientoCongresos.id, structureAlojamientoCongresos.name); 
501			imgFichaRandom(structureRestaurantes.id, structureRestaurantes.name); 
502			imgFichaRandom(structureEmpresas.id, structureEmpresas.name); 
503			imgFichaRandom(classTypeIdAlojamiento.id, classTypeIdAlojamiento.name); 
504			imgFichaRandom(classTypeIdCongresos.id, classTypeIdCongresos.name); 
505			imgFichaRandom(classTypeIdRestaurantes.id, classTypeIdRestaurantes.name); 
506			imgFichaRandom(classTypeIdEmpresas.id, classTypeIdEmpresas.name); 
507
508
509
510 
511 
512	function myFunction() { 
513		var dots = document.getElementById("dots"); 
514		var moreText = document.getElementById("more"); 
515		var btnText = document.getElementById("myBtn"); 
516 
517		if (dots.style.display === "none") { 
518			dots.style.display = "inline"; 
519			btnText.innerHTML = "Más"; 
520			moreText.style.display = "none"; 
521		} else { 
522			dots.style.display = "none"; 
523			btnText.innerHTML = "Menos"; 
524			moreText.style.display = "inline"; 
525
526
527	 
528	arrayMunicipiosOrdenados.forEach((element, index) => { 
529		paintCard(element, index); 
530	}); 
531 
532}); 
533</script> 
534 
535<script> 
536	function incrementViewCounter(classPK) { 
537		Liferay.Service( 
538		  '/assetentry/increment-view-counter', 
539
540			companyId: Liferay.ThemeDisplay.getCompanyId(), 
541			className: 'com.liferay.journal.model.JournalArticle', 
542			classPK: classPK 
543		  }, 
544		  function(obj) { 
545			//no need to do anything 
546
547		); 
548
549	$('#tripDate').daterangepicker({ 
550		"minDate": new Date(), 
551		"autoApply" : true, 
552		"locale": { 
553			"format": "MM/DD/YYYY", 
554			"separator": " - ", 
555			"applyLabel": "Aplicar", 
556			"cancelLabel": "Cancelar", 
557			"fromLabel": "Desde", 
558			"toLabel": "A", 
559			"customRangeLabel": "Personalizada", 
560			"weekLabel": "W", 
561			"daysOfWeek": [ 
562				"DO", 
563				"LUN", 
564				"MAR", 
565				"MIE", 
566				"JUE", 
567				"VI", 
568				"SA" 
569			], 
570			"monthNames": [ 
571				"Enero", 
572				"Febrero", 
573				"Marzo", 
574				"Abril", 
575				"Mayo", 
576				"Junio", 
577				"Julio", 
578				"Agosto", 
579				"Septiembre", 
580				"Octubre", 
581				"Noviembre", 
582				"Diciembre" 
583			], 
584			"firstDay": 1 
585
586	}); 
587		 
588	$( "#close,#closePopupButton" ).click(function() { 
589		$('#popupAdd').removeClass('on'); 
590		$('#timeVisit').prop('selectedIndex',0); 
591		$('#addNote').val(''); 
592		var today = new Date(); 
593		var dd = String(today.getDate()).padStart(2, '0'); 
594		var mm = String(today.getMonth() + 1).padStart(2, '0'); 
595		var yyyy = today.getFullYear(); 
596		today = mm + '/' + dd + '/' + yyyy; 
597		var tripDate = today + " - " + today; 
598		$('#tripDate').val(tripDate); 
599		$("#select2-timeVisit-container").text(""); 
600	}); 
601 
602	function addFavorite() { 
603		if (Liferay.ThemeDisplay.isSignedIn()) { 
604			var currentSelectedEntryId = $('#currentAssetEntryId').val(); 
605			Liferay.Service('/jaen.favouriteresource/add-favourite-resource', 
606
607			   pageArticleId: currentSelectedEntryId, 
608			   lastVisitTime: $('#timeVisit').val(), 
609			   tripDate: $('#tripDate').val(), 
610			   note: $('#addNote').val(), 
611			   scopeGroupId: Liferay.ThemeDisplay.getScopeGroupId(), 
612			   userId: Liferay.ThemeDisplay.getUserId(), 
613			   companyId: Liferay.ThemeDisplay.getCompanyId()  
614			 }, 
615			 function(obj) { 
616				$('#popupAdd').removeClass('on'); 
617				$('.'+currentSelectedEntryId).addClass("fill"); 
618				$("#favouriteResourceId"+currentSelectedEntryId).val(obj); 
619				$('#timeVisit').prop('selectedIndex',0); 
620				$('#addNote').val(''); 
621				var today = new Date(); 
622				var dd = String(today.getDate()).padStart(2, '0'); 
623				var mm = String(today.getMonth() + 1).padStart(2, '0'); 
624				var yyyy = today.getFullYear(); 
625				today = mm + '/' + dd + '/' + yyyy; 
626				var tripDate = today + " - " + today; 
627				$('#tripDate').val(tripDate); 
628				$("#select2-timeVisit-container").text(""); 
629			 }); 
630
631
632	function manageFavorite (event, element, favouriteResourceId, currentAssetEntryId) { 
633		if (element.classList.contains("fill")) { 
634			favouriteResourceId = $("#favouriteResourceId"+currentAssetEntryId).val(); 
635			Liferay.Service('/jaen.favouriteresource/delete-favourite-resource', 
636
637				'favouriteResourceId' : favouriteResourceId 
638			  }, 
639			  function(obj) { 
640				element.classList.remove("fill"); 
641				$("#favouriteResourceId"+currentAssetEntryId).val(''); 
642
643			); 
644		} else { 
645			$('#popupAdd').addClass('on'); 
646			if ($("#timeVisit").next().hasClass("select2")) { 
647				$("#timeVisit").removeClass("select2-hidden-accessible"); 
648				$("#timeVisit").next().remove(); 
649
650			$('#currentAssetEntryId').val(currentAssetEntryId); 
651			$('#popupAdd').find('.sign-in').prepend('<h2 id="page-article-title"></h2>'); 
652			$('#page-article-title').text($("#title"+currentAssetEntryId).text()); 
653
654		event.preventDefault(); 
655
656</script> 
657<style> 
658.tipo-ficha { 
659    position: absolute; 
660    bottom: 13px; 
661    right: 50px; 
662
663 
664 
665span#like { 
666    max-width: 62%; 
667    width: max-content; 
668    white-space: nowrap; 
669    overflow: hidden; 
670
671#popupAdd { 
672	 display: none; 
673
674 #popupAdd.on { 
675	 display: block; 
676	 position: fixed; 
677	 z-index: 20; 
678	 background: rgba(0, 0, 0, 0.4); 
679	 width: 100%; 
680	 height: 100%; 
681	 right: 0; 
682	 left: 0; 
683	 top: 0; 
684	 bottom: 0; 
685	 display: flex; 
686	 justify-content: center; 
687	 align-items: center; 
688
689 #popupAdd .containerPopUp { 
690	 background: white; 
691	 width: 100%; 
692	 max-width: 730px; 
693	 padding: 40px; 
694	 position: relative; 
695	 top: 6vh; 
696
697 #popupAdd .containerPopUp label { 
698	 text-transform: uppercase; 
699
700 #popupAdd .containerPopUp #close { 
701	 position: absolute; 
702	 right: 28px; 
703	 top: 17px; 
704	 font-size: 24px; 
705	 cursor: pointer; 
706	 width: 44px; 
707	 text-align: right; 
708	 height: 36px; 
709
710 #popupAdd .containerPopUp h2 { 
711	 text-align: center; 
712	 margin-bottom: 30px; 
713	 font-size: 42px; 
714
715 #popupAdd .containerPopUp .calendar-info { 
716	 width: 45%; 
717
718 #popupAdd .containerPopUp .calendar-info p { 
719	 font-size: 17px; 
720	 text-align: center; 
721	 margin-bottom: 10px; 
722
723 #popupAdd .containerPopUp .info-visit { 
724	 width: 48%; 
725
726 #popupAdd .containerPopUp .info-visit p { 
727	 margin-bottom: 10px; 
728	 font-size: 17px; 
729
730 #popupAdd .containerPopUp .info-visit select { 
731	 border: 1px solid #4a4a4a; 
732	 padding: 5px 15px; 
733	 width: 100%; 
734	 border-radius: 0; 
735
736 #popupAdd .containerPopUp .info-visit select:focus { 
737	 outline: none; 
738	 box-shadow: none; 
739
740 #popupAdd .containerPopUp .calendar .form-control { 
741	 border: 1px solid #4a4a4a; 
742	 padding: 5px 15px; 
743	 width: 100%; 
744	 border-radius: 0; 
745
746 #popupAdd .containerPopUp .calendar .form-control:focus { 
747	 outline: none; 
748	 box-shadow: none; 
749
750 #popupAdd .containerPopUp .add-note p { 
751	 font-size: 17px; 
752	 margin-bottom: 5px; 
753	 margin-left: 3px; 
754
755 #popupAdd .containerPopUp .add-note textarea { 
756	 border: 1px solid #4a4a4a; 
757	 padding: 5px 15px; 
758	 width: 100%; 
759	 border-radius: 0; 
760
761 #popupAdd .containerPopUp .add-note textarea:focus { 
762	 outline: none; 
763	 box-shadow: none; 
764
765 #popupAdd .containerPopUp button { 
766	 cursor: pointer; 
767	 border-radius: 0; 
768	 text-transform: uppercase; 
769	 padding: 15px 25px; 
770	 background-color: #12b75d; 
771	 border: 0; 
772	 color: white; 
773	 font-weight: normal; 
774	 margin-right: 15px; 
775
776 #popupAdd .containerPopUp button:focus { 
777	 outline: none; 
778	 border: 0; 
779	 box-shadow: none; 
780
781 #popupAdd .btn.btn-default.btn-primary:focus { 
782	 background: #12b75d; 
783	 border-color: #12b75d; 
784	 outline: none; 
785	 box-shadow: none; 
786
787 body.signed-out .sign-out, body.signed-in .sign-in { 
788	 display: block; 
789
790 body.signed-out .sign-in, body.signed-in .sign-out { 
791	 display: none; 
792
793.taglib-ratings.stars .liferay-rating-score { 
794  padding-left: 0px; 
795
796.taglib-ratings.stars .liferay-rating-vote { 
797  display: none !important; 
798
799.taglib-ratings.stars { 
800  position: absolute; 
801  margin-top: 65PX; 
802
803.card-text .view-count-info{ 
804	position: fixed;top: 65%;left: 6%; 
805
806 
807</style>