1<#assign HttpUtil = staticUtil["com.liferay.portal.kernel.util.HttpUtil"] />
2<#assign AssetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") />
3<#assign AssetLinkLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetLinkLocalService") />
4<#assign DLFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") />
5<#assign DlAppServiceUtil = staticUtil["com.liferay.document.library.kernel.service.DLAppServiceUtil"] />
6<#assign url = themeDisplay.getURLPortal()+themeDisplay.getURLCurrent()>
7<#assign calendarBookingId = HttpUtil.getParameter(url,"entryId")>
8<#assign instanceIndex = HttpUtil.getParameter(url,"instanceIndex")>
9<#assign parameters = HttpUtil.getParameterMap(url)>
10<#list parameters as key, parameter>
11 <#if key?contains("entryId") && parameter[0]!="">
12 <#assign calendarBookingId = parameter[0]>
13 <#elseif key?contains("instanceIndex") && parameter[0]!="">
14 <#assign instanceIndex = parameter[0]>
15 </#if>
16</#list>
17<#assign BuscadorAgendaService = serviceLocator.findService("net.izfe.gipuzkoa.agenda.buscador.api.BuscadorAgendaService") />
18<#assign CalendarBookingLocalService = serviceLocator.findService("com.liferay.calendar.service.CalendarBookingLocalService") />
19<#assign currentCompleteURL = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() />
20
21<#if themeDisplay.getLocale() == "es_ES" >
22 <#assign abrir_mapa ="Abrir mapa en otra ventana">
23 <#assign mas_informacion_es ="Más información sobre el evento ">
24 <#assign mas_informacion_eus ="">
25 <#assign add_calendario ="Añadir a calendario">
26 <#assign add_calendar ="Añadir a Google Calendar">
27<#else>
28 <#assign abrir_mapa ="Ireki mapa beste leiho batean">
29 <#assign mas_informacion_eus =" ekitaldiari buruz">
30 <#assign mas_informacion_es ="Informazio gehiago">
31 <#assign add_calendario ="Egutegira gehitu">
32 <#assign add_calendar ="Google Calendar-era gehitu">
33</#if>
34
35<#assign calendarBookingIdNumber = -1>
36<#attempt>
37 <#if calendarBookingId != "" >
38 <#assign calendarBookingIdNumber = calendarBookingId?number>
39 </#if>
40<#recover>
41 <#assign calendarBookingIdNumber = -1>
42</#attempt>
43
44<#assign instanceIndexNumber = -1>
45<#attempt>
46 <#if instanceIndex != "" >
47 <#assign instanceIndexNumber = instanceIndex?number>
48 </#if>
49<#recover>
50 <#assign instanceIndexNumber = -1>
51</#attempt>
52<#if calendarBookingIdNumber != -1 >
53 <#assign calendarBooking = CalendarBookingLocalService.getCalendarBooking(calendarBookingIdNumber) />
54 <#if instanceIndexNumber != -1 >
55 <#assign evento = BuscadorAgendaService.getEvento(calendarBookingIdNumber, instanceIndexNumber, themeDisplay.getLocale(), themeDisplay.getPortalURL()) />
56 <#else>
57 <#assign evento = BuscadorAgendaService.getEvento(calendarBookingIdNumber, themeDisplay.getLocale(), themeDisplay.getPortalURL()) />
58 </#if>
59 <#assign startDate=evento.getStartDate()>
60 <#assign endDate=evento.getEndDate()>
61 <#assign images_folder = themeDisplay.getPathThemeImages() />
62 <#assign direccion="" />
63 <#if evento.direccion?has_content >
64 <#assign direccion=direccion+evento.direccion />
65 </#if>
66 <#if evento.direccion?has_content && evento.localizacion?has_content>
67 <#assign direccion=direccion+"/" />
68 </#if>
69 <#if evento.localizacion?has_content >
70 <#assign direccion=direccion+evento.localizacion />
71 </#if>
72
73 <#assign fileEntryId = "" />
74 <#assign assetEntry = AssetEntryLocalService.fetchEntry("com.liferay.calendar.model.CalendarBooking", evento.calendarBookingId) />
75 <#assign assetLinks = AssetLinkLocalService.getLinks(assetEntry.getEntryId()) />
76 <#list assetLinks as assetLink>
77 <#if assetLink.getEntryId1() != assetEntry.getEntryId()>
78 <#assign assetLinkEntry = AssetEntryLocalService.getAssetEntry(assetLink.getEntryId1()) />
79
80 <#if assetLinkEntry.mimeType?starts_with("image/")>
81 <#assign dlFileEntry = DLFileEntryLocalService.getDLFileEntry(assetLinkEntry.getClassPK()) />
82 <#assign fileEntryId = dlFileEntry.getFileEntryId() />
83 </#if>
84 </#if>
85 </#list>
86
87 <@liferay_util["html-top"]>
88 <#if evento.title?has_content >
89 <title>${evento.title}</title>
90 <meta property="og:title" content='${evento.title}'>
91 </#if>
92 <#if evento.imagenPath?has_content >
93 <meta property="og:image" content='${evento.imagenPath}'>
94 </#if>
95 <#if evento.direccion?has_content >
96 <meta property="og:description" content='${evento.direccion}'>
97 </#if>
98 <meta property="og:url" content='${currentCompleteURL}'>
99 </@>
100
101 <div class="container mt-4 mb-4">
102 <div class="row">
103 <div class="col-12 col-md-8">
104 <h2 class="izfe-semibold mb-4">
105 ${evento.title}
106 </h2>
107
108 <!-- SEPARAR FECHAS Y HORAS-->
109 <#attempt>
110 <#assign fechaInicio =startDate />
111 <#recover>
112 <#assign fechaInicio = "" />
113 </#attempt>
114
115 <#attempt>
116 <#assign horaInicio = evento.getStartOnlyTime() />
117 <#recover>
118 <#assign horaInicio = "" />
119 </#attempt>
120
121 <#attempt>
122 <#assign fechaFin = endDate />
123 <#recover>
124 <#assign fechaFin = "" />
125 </#attempt>
126
127 <#attempt>
128 <#assign horaFin = evento.getEndOnlyTime() />
129 <#recover>
130 <#assign horaFin = "" />
131 </#attempt>
132
133 <div class="izfe-bg-blue-dark p-2">
134 <#if fechaInicio == fechaFin >
135 <div class="d-flex align-items-center ml-3">
136 <div class="izfe-icon-calendar-time-white"></div>
137 <p class="text-white izfe-semibold mb-0 ml-2 izfe-h4">
138
139 <#if fechaInicio != "" >
140 <span class="mr-1">
141 ${fechaInicio}
142 </span>
143 </#if>
144 <#if fechaFin != "" && fechaFin != fechaInicio>
145 -
146 <span class="ml-1">
147 ${fechaFin}
148 </span>
149 <#elseif !evento.isAllDay()>
150 <span class="ml-3 mr-1">
151 ${horaInicio}
152 </span>
153 -
154 <span class="ml-1">
155 ${horaFin}
156 </span>
157 </#if>
158 </p>
159 </div>
160 <#else>
161 <div class="d-flex align-items-center ml-3">
162 <div class="izfe-icon-calendar-time-white"></div>
163 <p class="text-white izfe-semibold mb-0 ml-2 izfe-h4">
164 ${fechaInicio}
165 </p>
166 <span class="text-white izfe-semibold ml-2 mr-2">-</span>
167 <p class="text-white izfe-semibold mb-0 izfe-h4">
168 ${fechaFin}
169 </p>
170 </div>
171 </#if>
172 </div>
173
174 <#if evento.localizacion?has_content || evento.direccion?has_content>
175 <div class="izfe-evento-localizacion-direccion d-flex align-items-center pl-3 pr-3 pt-2 pb-2">
176 <div class="d-flex flex-column flex-lg-row align-items-lg-center">
177 <#if evento.urlDireccion != "">
178 <a class="ml-2 d-flex align-items-center" href="${evento.urlDireccion}" target="_blank">
179 <div class="izfe-icon-ubicacion-blue"></div>
180 <p class="izfe-semibold mb-0 ml-2 izfe-h5">
181 <#if evento.direccion?has_content >
182 ${evento.direccion}
183 </#if>
184 <#if evento.direccion?has_content && evento.localizacion?has_content>
185 <span class="ml-1 mr-1">/</span>
186 </#if>
187 <#if evento.localizacion?has_content >
188 ${evento.localizacion}
189 </#if>
190 </p>
191 </a>
192 <#else>
193 <div class="ml-2 d-flex align-items-center">
194 <div class="izfe-icon-ubicacion"></div>
195 <p class="izfe-semibold mb-0 ml-2 izfe-h5">
196 <#if evento.direccion?has_content >
197 ${evento.direccion}</p>
198 </#if>
199 <#if evento.direccion?has_content && evento.localizacion?has_content>
200 <span class="ml-1 mr-1">/</span>
201 </#if>
202 <#if evento.localizacion?has_content >
203 ${evento.localizacion}
204 </#if>
205 </p>
206 </div>
207 </#if>
208 </div>
209 </div>
210 </#if>
211
212 <div class="row mt-4">
213 <div class="col-12" id="izfe-evento-descripcion">
214 <#if evento.descripcion != "">
215 ${evento.descripcion}
216 <#-- ${HtmlUtil.render(evento.descripcion)} -->
217 </#if>
218 </div>
219 </div>
220 <#assign startDateArr=startDate?split("/") />
221 <#assign endDateArr=evento.getEndDate()?split("/") />
222 <#assign startTime=evento.getStartOnlyTime()?replace(":","")+"00" />
223 <#assign endTime=evento.getEndOnlyTime()?replace(":","")+"00" />
224
225 <#assign startTimeStamp=startDateArr[2]+startDateArr[1]+startDateArr[0]+"T"+startTime+"" />
226 <#assign endTimeStamp=endDateArr[2]+endDateArr[1]+endDateArr[0]+"T"+endTime+"" />
227
228 <div class="calendar-btns">
229 <button id="add-calendar">${add_calendario}</button>
230 <a href="https://calendar.google.com/calendar/render?action=TEMPLATE&text=${evento.title?replace("\n", "")?replace("\t", "")?replace('<[^>]+>','','r')?trim?replace('\"',"'")}&dates=${startTimeStamp}/${endTimeStamp}&details=${evento.descripcion?replace("\n", "")?replace("\t", "")?replace('<[^>]+>','','r')?trim}&recur=&location=${direccion}&trp=false">${add_calendar}</a>
231 </div>
232 </div>
233
234 <div class="col-12 col-md-4">
235 <#attempt>
236
237 <#if fileEntryId?has_content>
238 <@adaptive_media_image["img"]
239 alt=""
240 fileVersion=DlAppServiceUtil.getFileEntry(fileEntryId).getFileVersion()
241 class="w-100 mb-3" />
242 <#elseif evento.imagenPath?? >
243 <img
244 alt=""
245 class="w-100 mb-3"
246 src="${evento.imagenPath}"
247 />
248 <#else>
249 <img
250 alt=""
251 title="img-not-found"
252 class="w-100"
253 src="${images_folder}/izfe/img-not-found.png"
254 />
255 </#if>
256 <#recover>
257
258 </#attempt>
259
260
261 <#assign listaCategorias = evento.listaCategorias />
262
263 <#if listaCategorias?has_content >
264 <div class="d-flex flex-wrap">
265 <#list listaCategorias as categoria >
266 <p class="text-blue-second text-uppercase mb-0 mr-2">
267 ${categoria.getName()}
268 </p>
269 </#list>
270 </div>
271
272 <hr/>
273 </#if>
274
275 <#if evento.webEvento != "" >
276 <a class="izfe-btn-blue d-block text-center" href="${evento.webEvento}" aria-label="${mas_informacion_es}${evento.title}${mas_informacion_eus}" target="_blank">
277 <@liferay.language key="DGN.mas-informacion-evento" />
278 </a>
279 </#if>
280 </div>
281 </div>
282
283
284
285 <div class="row mt-4 mb-4" id="izfe-evento-relacionados">
286 <#assign categoriasEventoActual = evento.listaCategorias />
287 <#assign categoriasIds = [] />
288
289 <#if categoriasEventoActual?has_content >
290 <#list categoriasEventoActual as categoriaEventoActual >
291 <#assign categoriasIds = categoriasIds + [categoriaEventoActual.categoryId] />
292 </#list>
293 </#if>
294
295
296 <#assign eventosRelacionados = BuscadorAgendaService.listaProximosEventos(themeDisplay.getCompanyId(), themeDisplay.getLocale(), themeDisplay.getPortalURL(), categoriasIds,
297 3, [themeDisplay.getLayout().getGroupId()]) />
298
299 <#if eventosRelacionados?has_content>
300 <#assign mostrarTituloRelacionados = true>
301 <#assign contadorRelacionados = 0 >
302
303 <#list eventosRelacionados as eventoRelacionado>
304 <#if eventoRelacionado.calendarBookingId != evento.calendarBookingId >
305
306 <#attempt>
307 <#assign fechaInicioRelacionado = eventoRelacionado.getStartDate() />
308 <#recover>
309 <#assign fechaInicioRelacionado = "" />
310 </#attempt>
311
312 <#attempt>
313 <#assign horaInicioRelacionado = eventoRelacionado.getStartOnlyTime() />
314 <#recover>
315 <#assign horaInicioRelacionado = "" />
316 </#attempt>
317
318 <#attempt>
319 <#assign fechaFinRelacionado = eventoRelacionado.getEndDate() />
320 <#recover>
321 <#assign fechaFinRelacionado = "" />
322 </#attempt>
323
324 <#attempt>
325 <#assign horaFinRelacionado = eventoRelacionado.getEndOnlyTime() />
326 <#recover>
327 <#assign horaFinRelacionado = "" />
328 </#attempt>
329
330
331 <#if mostrarTituloRelacionados >
332 <div class="col-12">
333 <h3 class="izfe-semibold mb-3">
334 <@liferay.language key="DGN.otros-eventos"/>
335 </h3>
336 </div>
337 </#if>
338
339 <#if contadorRelacionados < 3 >
340 <div class="izfe-agenda-relacionado col-12 col-lg-4 mb-3 mb-lg-0">
341 <#assign urlRelacionado="/actualidad/agenda/evento?entryId="+eventoRelacionado.calendarBookingId />
342 <#if eventoRelacionado.isRecurring() >
343 <#assign urlRelacionado=urlRelacionado+"&instanceIndex=" + eventoRelacionado.getInstanceIndex() />
344 </#if>
345 <a href="${urlRelacionado}" aria-label="${mas_informacion_es}${eventoRelacionado.title}${mas_informacion_eus}">
346 <div class="izfe-bg-blue-dark-second eventoRelacionado p-2 ">
347 <div class="text-white d-flex align-items-center">
348 <span class="d-none">
349 ${fechaInicioRelacionado} - ${fechaFinRelacionado}
350
351 </span>
352 <#if fechaInicioRelacionado != "" >
353 <p class="small text-white mr-1">
354 ${fechaInicioRelacionado}
355 </p>
356 </#if>
357 <#if fechaFinRelacionado != "" && fechaFinRelacionado != fechaInicioRelacionado >
358 <p>-</p>
359 <p class="small text-white ml-1">
360 ${fechaFinRelacionado}
361 </p>
362 <#else>
363 <p class="small text-white ml-2 mr-1">
364 ${horaInicioRelacionado}
365 </p>
366 <p>-</p>
367 <p class="small text-white ml-1">
368 ${horaFinRelacionado}
369 </p>
370 </#if>
371 </div>
372 <h3 class="text-white izfe-h4">${eventoRelacionado.title}</h3>
373 <p class="small text-white">${eventoRelacionado.localizacion}</p>
374 </div>
375 </a>
376 </div>
377 </#if>
378 <#assign contadorRelacionados++ />
379 <#assign mostrarTituloRelacionados = false />
380 </#if>
381 </#list>
382 </#if>
383 </div>
384 </div>
385
386
387 <style>
388 #izfe-evento-descripcion *{
389 font-family: 'Poppins', Helvetica, Arial, sans-serif !important;
390 font-size: 15px !important;
391 line-height: 20px;
392 }
393 #izfe-evento-relacionados a{
394 text-decoration: none !important;
395 }
396 #izfe-evento-relacionados a:hover *{
397 opacity: .7;
398 }
399
400 #izfe-evento-relacionados .eventoRelacionado {
401 min-height: 175px;
402 }
403 .izfe-evento-localizacion-direccion{
404 border: 1.5px solid #004996;
405 }
406
407 .izfe-float-left{
408 float: left;
409 }
410 .izfe-float-right{
411 float: left;
412 }
413
414 .calendar-btns {
415 display: flex;
416 flex-direction: column;
417 align-items: flex-start;
418 gap: 1rem;
419 margin-top: 1.5rem;
420 }
421
422 .calendar-btns > * {
423 background-color: transparent;
424 border: 3px solid #004996;
425 padding: 0.5rem 1rem;
426 border-radius: 100px;
427 color: #004996 !important;
428 font-weight: bold;
429 transition: all ease 0.25s;
430 }
431
432 .calendar-btns > *:hover {
433 background-color: #004996;
434 color: #fff !important;
435 text-decoration: none;
436 border: 3px solid #004996;
437 }
438
439 .calendar-btns > a {
440 border: 3px solid #004996;
441 }
442
443 .calendar-btns > *:before {
444 content: "";
445 background-image: url(/documents/20933/51832620/googlecalendar-add.svg/9d6629ee-f3d4-d19d-16f0-8fb2b8d782fb?t=1684320223063);
446 width: 1.4rem;
447 height: 1.4rem;
448 display: inline-block;
449 background-size: cover;
450 margin-right: 0.5rem;
451 vertical-align: middle;
452 }
453
454 .calendar-btns > :hover::before {
455 background-image: url(/documents/20933/51832620/googlecalendar-add-hover.svg/3189e2b7-d616-3830-8357-50009c09bfc0?t=1684320223414);
456 }
457
458 .calendar-btns > #add-calendar::before {
459 background-image: url(/documents/20933/51832620/calendar-add.svg/877c3465-d510-6131-03f5-101fbab05f15?t=1684320223745);
460 }
461
462 .calendar-btns > #add-calendar:hover::before {
463 background-image: url(/documents/20933/51832620/calendar-add-hover.svg/c6fcebd6-4560-0d3f-47bf-64e909351f73?t=1684320224069);
464 }
465
466 </style>
467 <script type="text/javascript">
468var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&i)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define("FileSaver.js",function(){return saveAs})}
469
470var ics=function(e,t){"use strict";{if(!(navigator.userAgent.indexOf("MSIE")>-1&&-1==navigator.userAgent.indexOf("MSIE 10"))){void 0===e&&(e="default"),void 0===t&&(t="Calendar");var r=-1!==navigator.appVersion.indexOf("Win")?"\r\n":"\n",n=[],i=["BEGIN:VCALENDAR","PRODID:"+t,"VERSION:2.0"].join(r),o=r+"END:VCALENDAR",a=["SU","MO","TU","WE","TH","FR","SA"];return{events:function(){return n},calendar:function(){return i+r+n.join(r)+o},addEvent:function(t,i,o,l,u,s){if(void 0===t||void 0===i||void 0===o||void 0===l||void 0===u)return!1;if(s&&!s.rrule){if("YEARLY"!==s.freq&&"MONTHLY"!==s.freq&&"WEEKLY"!==s.freq&&"DAILY"!==s.freq)throw"Recurrence rrule frequency must be provided and be one of the following: 'YEARLY', 'MONTHLY', 'WEEKLY', or 'DAILY'";if(s.until&&isNaN(Date.parse(s.until)))throw"Recurrence rrule 'until' must be a valid date string";if(s.interval&&isNaN(parseInt(s.interval)))throw"Recurrence rrule 'interval' must be an integer";if(s.count&&isNaN(parseInt(s.count)))throw"Recurrence rrule 'count' must be an integer";if(void 0!==s.byday){if("[object Array]"!==Object.prototype.toString.call(s.byday))throw"Recurrence rrule 'byday' must be an array";if(s.byday.length>7)throw"Recurrence rrule 'byday' array must not be longer than the 7 days in a week";s.byday=s.byday.filter(function(e,t){return s.byday.indexOf(e)==t});for(var c in s.byday)if(a.indexOf(s.byday[c])<0)throw"Recurrence rrule 'byday' values must include only the following: 'SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'"}}var g=new Date(l),d=new Date(u),f=new Date,S=("0000"+g.getFullYear().toString()).slice(-4),E=("00"+(g.getMonth()+1).toString()).slice(-2),v=("00"+g.getDate().toString()).slice(-2),y=("00"+g.getHours().toString()).slice(-2),A=("00"+g.getMinutes().toString()).slice(-2),T=("00"+g.getSeconds().toString()).slice(-2),b=("0000"+d.getFullYear().toString()).slice(-4),D=("00"+(d.getMonth()+1).toString()).slice(-2),N=("00"+d.getDate().toString()).slice(-2),h=("00"+d.getHours().toString()).slice(-2),I=("00"+d.getMinutes().toString()).slice(-2),R=("00"+d.getMinutes().toString()).slice(-2),M=("0000"+f.getFullYear().toString()).slice(-4),w=("00"+(f.getMonth()+1).toString()).slice(-2),L=("00"+f.getDate().toString()).slice(-2),O=("00"+f.getHours().toString()).slice(-2),p=("00"+f.getMinutes().toString()).slice(-2),Y=("00"+f.getMinutes().toString()).slice(-2),U="",V="";y+A+T+h+I+R!=0&&(U="T"+y+A+T,V="T"+h+I+R);var B,C=S+E+v+U,j=b+D+N+V,m=M+w+L+("T"+O+p+Y);if(s)if(s.rrule)B=s.rrule;else{if(B="rrule:FREQ="+s.freq,s.until){var x=new Date(Date.parse(s.until)).toISOString();B+=";UNTIL="+x.substring(0,x.length-13).replace(/[-]/g,"")+"000000Z"}s.interval&&(B+=";INTERVAL="+s.interval),s.count&&(B+=";COUNT="+s.count),s.byday&&s.byday.length>0&&(B+=";BYDAY="+s.byday.join(","))}(new Date).toISOString();var H=["BEGIN:VEVENT","UID:"+n.length+"@"+e,"CLASS:PUBLIC","DESCRIPTION:"+i,"DTSTAMP;VALUE=DATE-TIME:"+m,"DTSTART;VALUE=DATE-TIME:"+C,"DTEND;VALUE=DATE-TIME:"+j,"LOCATION:"+o,"SUMMARY;LANGUAGE=en-us:"+t,"TRANSP:TRANSPARENT","END:VEVENT"];return B&&H.splice(4,0,B),H=H.join(r),n.push(H),H},download:function(e,t){if(n.length<1)return!1;t=void 0!==t?t:".ics",e=void 0!==e?e:"calendar";var a,l=i+r+n.join(r)+o;if(-1===navigator.userAgent.indexOf("MSIE 10"))a=new Blob([l]);else{var u=new BlobBuilder;u.append(l),a=u.getBlob("text/x-vCalendar;charset="+document.characterSet)}return saveAs(a,e+t),l},build:function(){return!(n.length<1)&&i+r+n.join(r)+o}}}console.log("Unsupported Browser")}};
471 </script>
472
473 <script type="text/javascript">
474 cal_event = ics();
475 var descripcion=`${evento.descripcion?replace("\n", "")?replace("\t", "")?replace('<[^>]+>','','r')?trim}`;
476 <#assign startDateArr=startDate?split("/") />
477 <#assign endDateArr=evento.getEndDate()?split("/") />
478 var startDate="${startDateArr[1]}/${startDateArr[0]}/${startDateArr[2]}";
479 var endDate="${endDateArr[1]}/${endDateArr[0]}/${endDateArr[2]}";
480 <#assign direccion="" />
481 <#if evento.direccion?has_content >
482 <#assign direccion=direccion+evento.direccion />
483 </#if>
484 <#if evento.direccion?has_content && evento.localizacion?has_content>
485 <#assign direccion=direccion+"/" />
486 </#if>
487 <#if evento.localizacion?has_content >
488 <#assign direccion=direccion+evento.localizacion />
489 </#if>
490
491 cal_event.addEvent(
492 '${evento.title?replace('<[^>]+>','','r')?replace('\'','"')}',
493 descripcion,
494 '${direccion}',
495 startDate+' ${evento.getStartOnlyTime()}',
496 endDate+' ${evento.getEndOnlyTime()}');
497
498 document.getElementById("add-calendar").addEventListener("click", function() {
499 cal_event.download('${evento.title?replace('<[^>]+>','','r')?replace('\'','"')}');
500 });
501
502 </script>
503 <script>
504 $(document).ready(function() {
505 var canonicalUrlParameters = "";
506 var currentUrl = window.location.href;
507 var urlParams = new URLSearchParams(window.location.search);
508 urlParams.forEach(function(value, key) {
509 if (""==canonicalUrlParameters) {
510 canonicalUrlParameters = "?";
511 } else {
512 canonicalUrlParameters += "&";
513 }
514 canonicalUrlParameters += key + "=" + value;
515 });
516
517 // Obtener el <link rel="canonical">
518 var canonicalLink = $('link[rel="canonical"]');
519 canonicalLink.attr('href',canonicalLink.attr('href') + canonicalUrlParameters);
520
521 // Obtener todos los <link rel="alternate">
522 $('link[rel="alternate"]').each(function() {
523 $(this).attr('href',$(this).attr('href') + canonicalUrlParameters);
524 });
525 });
526 </script>
527</#if>