Sarrià-Sant Gervasi

Sarrià-Sant Gervasi
Descubre el distrito de Sarrià-Sant Gervasi a través de su agua

La proximidad de Sarrià-Sant Gervasi a Collserola y la carretera de Les Aigües hace que las más de 147.909 personas que viven en el distrito puedan disfrutar de la naturaleza muy cerca de casa, a pesar de vivir en Barcelona.

La primera Vuelta Ciclista a Cataluña salió de la avenida Reina Elisenda, justo a la altura de la plaza de Sarrià, el día de Reyes de 1911.


El agua en cifras Cifras correspondientes a 2022
Consumo medio doméstico por cápita
124,9 l/h/día
Número de clientes servidos
85.135 clientes
Número de controles de agua diarios
96 controles
Número de familias con Tarifa Social
836 familias

Tu oficina más cercana Si deseas más información sobre el agua de tu municipio, ven a nuestras oficinas.
Dirección

C/ Consell de Cent, 396
08009 Barcelona

Horario

Lunes - viernes 09.00 h - 14.00 h
Sábado y domingo Cerrado

Teléfono

935 219 777


Sarrià-Sant Gervasi en directo
El tiempo
Temperatura
Pluviómetro
Precipitación acumulada
Fuentes públicas
Fuentes en servicio
Se ha producido un error al procesar la plantilla.
Java method "static com.liferay.portal.kernel.portletfilerepository.PortletFileRepositoryUtil.getPortletFileEntry(long)" threw an exception; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: fileEntrySliderImg = portletFileRepos...  [in template "20099#20135#2451330" at line 422, column 17]
	- Reached through: #assign-container  [in template "20099#20135#2451330" at line 421, column 13]
----
1<#assign 
2    targetEnv = "PRO" 
3    articlesStatus = 0 
4    articlesGroupId = 20126 
5/> 
6 
7<#switch targetEnv> 
8    <#case "PRO"> 
9        <#assign 
10            articlesStructureKey = "1892944" 
11            agendaInstanceId = "cdpH0rc7P06U" 
12            agendaLayout = "1892927" 
13        /> 
14    <#break> 
15    <#case "INT"> 
16        <#assign 
17            articlesStructureKey = "1892944" 
18            agendaInstanceId = "CNuoJ5Qv27eN" 
19            agendaLayout = "1892927" 
20        /> 
21    <#break> 
22    <#case "DEV"> 
23        <#assign 
24            articlesStructureKey = "1234194" 
25            agendaInstanceId = "0vzUl3On2HAW" 
26            agendaLayout = "1234215" 
27        /> 
28</#switch> 
29 
30<style> 
31    .ag-hr { 
32        width: 100%!important; 
33        height: unset!important; 
34        margin-top: unset!important; 
35        margin-bottom: unset!important; 
36        border-bottom: .75px solid #757575!important; 
37
38 
39    .ag-bab-events-title { 
40        font-family: "Raleway Bold"; 
41        font-size: 22px; 
42        color: #194F6D; 
43
44 
45    .ag-bab-events-subtitle { 
46        font-family: Raleway; 
47        font-size: 20px; 
48        color: #194F6D; 
49
50 
51    .ag-content-container-event-image { 
52        background-size: cover; 
53        padding-bottom: 56.25%; 
54
55 
56    .ag-content-container-event-image-overflow { 
57        width: 50%; 
58        height: 37%; 
59        float: left; 
60        z-index: 10; 
61        background-color: #FFF; 
62        padding: 5px; 
63        color: #000; 
64        font-weight: bold; 
65
66 
67    .ag-content-container-event-image-overflow { 
68        width: 265px!important; 
69        height: 85px!important; 
70
71 
72    div.ag-city-container, 
73    div.ag-address-container { 
74        height: 20px; 
75
76 
77    div.ag-content-container-event-image-overflow span.ag-city, 
78    div.ag-content-container-event-image-overflow span.ag-address, 
79    div.ag-content-container-event-image-overflow span.ag-date { 
80        font-size: 0.7rem; 
81        color: #00205a; 
82 
83        /* truncate */ 
84        white-space: nowrap; 
85        overflow: hidden; 
86        text-overflow: ellipsis; 
87
88 
89    .ag-content-container-event-image-overflow span.ag-city { 
90        font-family: "Raleway Light"!important; 
91        font-size: 14px!important; 
92        color: #00205A!important; 
93        text-decoration: none!important; 
94
95 
96    .ag-content-container-event-image-overflow span.ag-address, 
97    .ag-content-container-event-image-overflow span.ag-date { 
98        font-family: "Raleway Medium"!important; 
99        font-style: italic!important; 
100        font-size: 16px!important; 
101        color: #00205A!important; 
102        text-decoration: none!important; 
103
104 
105    .ag-content-container-event-image-overflow span.ag-address { 
106        padding-right: 5px!important; 
107        max-width: 230px!important; 
108        width: unset!important; 
109
110 
111    div.ag-content-container-event-image-overflow span.ag-city, div.ag-content-container-event-image-overflow span.ag-date { 
112        max-width: 230px!important; 
113        width: unset!important; 
114        padding-right: 3px; 
115
116 
117    .ag-list-event-title-container { 
118        margin-top: 15px; 
119
120 
121    .ag-list-event-moreinfo-container { 
122        margin-top: 10px; 
123
124 
125    .ag-list-event-title { 
126        font-family: "Raleway Bold"; 
127        font-size: 18px; 
128        color: #194F6D; 
129
130 
131    a.ag-list-event-moreinfo { 
132        font-family: "Raleway bold"; 
133        font-size: 14px; 
134        color: #0076A8; 
135
136 
137    .ag-icon-pin { 
138        width: 12px; 
139        margin-top: -18px; 
140
141 
142    .ag-list-icon-share, 
143    .ag-list-icon-share-fullwidth { 
144        width: 15px; 
145
146 
147    .ag-list-event-share-container { 
148        text-align:right; 
149
150 
151    .ag-social-share-options, 
152    .ag-social-share-options-fullwidth { 
153        border: 1px solid #e7e7ed; 
154        font-size: 0.875rem; 
155        position: absolute; 
156        width: 240px; 
157        right: 0; 
158        background-color: #FFF; 
159        border-radius: 0.25rem; 
160        box-shadow: 0 1px 10px -3px rgba(0, 0, 0, 0.3); 
161        z-index: 999; 
162
163 
164    .ag-social-share-options-fullwidth { 
165        bottom: -115px; 
166
167 
168    .ag-social-share-options ul { 
169        padding-left: 0; 
170        list-style: none; 
171        margin-top: 0; 
172        margin-bottom: 0; 
173
174 
175    .journal-content-article li:before { 
176        background-image: none!important; 
177
178 
179    .ag-social-share-options ul li a { 
180        font-family: "Raleway Medium"; 
181        text-align: center; 
182        overflow: hidden; 
183        position: relative; 
184        white-space: normal; 
185        display: block; 
186        width: 100%; 
187        padding: 0.5rem 1.25rem; 
188        clear: both; 
189        font-weight: 400; 
190        color: #6B6C7E; 
191        background-color: transparent; 
192        border: 0; 
193
194 
195    .slick-slide img { 
196        display: unset; 
197
198 
199    div#ag-bab-slider .slick-list { 
200        overflow: unset!important; 
201        overflow-y: initial!important; 
202        overflow-x: clip!important; 
203
204 
205    div#ag-bab-slider ul.slick-dots { 
206        position: relative; 
207        bottom: 0; 
208
209 
210    @media screen and (max-width: 667px) { 
211        div.container { 
212            max-width: 100%; 
213            overflow-x: clip; 
214
215
216 
217    .ag-truncate-multiline-2 { 
218        display: -webkit-box; 
219        -webkit-line-clamp: 2; 
220        -webkit-box-orient: vertical; 
221        overflow: hidden; 
222
223</style> 
224 
225 
226 
227<#if serviceLocator?? > 
228    <#assign 
229        selectedLanguageId = themeDisplay.getLanguageId() 
230 
231        journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") 
232        articles = journalArticleLocalService.getStructureArticles(articlesGroupId, articlesStructureKey) 
233 
234        jsonFactoryUtil = serviceLocator.findService("com.liferay.portal.kernel.json.JSONFactoryUtil") 
235        portletFileRepositoryUtil = serviceLocator.findService("com.liferay.portal.kernel.portletfilerepository.PortletFileRepositoryUtil") 
236 
237        articlesIds = [] 
238        articlesBarcelona = [] 
239    /> 
240 
241    <#list articles as article > 
242        <#if !article.isInTrash() && !article.isDraft() > 
243            <#assign 
244                articleId = article.getArticleId() 
245            /> 
246 
247            <#if articleId != "" && !article.isInTrash() && !article.isDraft() && !articlesIds?seq_contains(articleId) > 
248                <#assign articlesIds = articlesIds + [ articleId ] /> 
249            </#if> 
250 
251            <#assign 
252                articleLastVersionNum = journalArticleLocalService.getLatestVersion(articlesGroupId, articleId, articlesStatus) 
253                articleLastVersion = journalArticleLocalService.getArticle(articlesGroupId, articleId, articleLastVersionNum) 
254                document = saxReaderUtil.read(articleLastVersion.getContent()) 
255                eventCity = document.valueOf("//dynamic-element[@name='city']/dynamic-content/text()") 
256                eventDistrict = document.valueOf("//dynamic-element[@name='district']/dynamic-content/text()") 
257            /> 
258 
259            <#if eventCity?? && eventCity == "2" > 
260                <#if articleId != "" && !article.isInTrash() && !article.isDraft() && !articlesBarcelona?seq_contains(articleId) > 
261                    <#assign articlesBarcelona = articlesBarcelona + [ articleId ] /> 
262                </#if> 
263            </#if> 
264        </#if> 
265    </#list> 
266 
267    <#-- We get the Json for all the articles --> 
268    <#assign 
269        eventsJson = "[" 
270        eventsBarcelonaJson = "[" 
271    /> 
272 
273    <#list articlesIds as articleId > 
274        <#assign 
275            lastVersion = journalArticleLocalService.getLatestVersion(articlesGroupId, articleId, articlesStatus) 
276            article = journalArticleLocalService.getArticle(articlesGroupId, articleId, lastVersion) 
277            articleLastVersionNum = journalArticleLocalService.getLatestVersion(articlesGroupId, articleId, articlesStatus) 
278            articleLastVersion = journalArticleLocalService.getArticle(articlesGroupId, articleId, articleLastVersionNum) 
279 
280            document = saxReaderUtil.read(articleLastVersion.getContent()) 
281            eventTitleCat = document.valueOf("//dynamic-element[@name='title']/dynamic-content[@language-id='ca_ES']/text()") 
282            eventTitleEsp = document.valueOf("//dynamic-element[@name='title']/dynamic-content[@language-id='es_ES']/text()") 
283            eventTitleCatSanitized = eventTitleCat?replace("(\n)+", " ",'r') 
284            eventTitleCatSanitized = eventTitleCatSanitized?replace('<[^>]+>','','r') 
285            eventTitleCatSanitized = eventTitleCatSanitized?js_string 
286            eventTitleEspSanitized = eventTitleEsp?replace("(\n)+", " ",'r') 
287            eventTitleEspSanitized = eventTitleEspSanitized?replace('<[^>]+>','','r') 
288            eventTitleEspSanitized = eventTitleEspSanitized?js_string 
289            eventContent = document.valueOf("//dynamic-element[@name='content']/dynamic-content[@language-id='${selectedLanguageId}']/text()") 
290            eventContentSanitized = eventContent?replace("(\n)+", " ",'r') 
291            eventContentSanitized = eventContentSanitized?replace('<[^>]+>','','r') 
292            eventContentSanitized = eventContentSanitized?js_string 
293            eventDates = document.selectNodes( "//dynamic-element[@name='date_begin']") 
294            eventDateBegin = document.valueOf("//dynamic-element[@name='date_begin']/dynamic-content/text()") 
295            eventDateEnd = document.valueOf("//dynamic-element[@name='date_end']/dynamic-content/text()") 
296            eventAddressCat = document.valueOf("//dynamic-element[@name='address']/dynamic-content[@language-id='ca_ES']/text()") 
297            eventAddressEsp = document.valueOf("//dynamic-element[@name='address']/dynamic-content[@language-id='es_ES']/text()") 
298            eventAddressCatSanitized = eventAddressCat?replace("(\n)+", " ",'r') 
299            eventAddressCatSanitized = eventAddressCatSanitized?replace('<[^>]+>','','r') 
300            eventAddressCatSanitized = eventAddressCatSanitized?js_string 
301            eventAddressEspSanitized = eventAddressEsp?replace("(\n)+", " ",'r') 
302            eventAddressEspSanitized = eventAddressEspSanitized?replace('<[^>]+>','','r') 
303            eventAddressEspSanitized = eventAddressEspSanitized?js_string 
304            eventCityFinal = 0 
305            eventCities = document.selectNodes( "//dynamic-element[@name='city']") 
306            eventCity = document.valueOf("//dynamic-element[@name='city']/dynamic-content/text()") 
307            eventDistrictFinal = 0 
308            eventDistricts = document.selectNodes( "//dynamic-element[@name='district']") 
309            eventDistrict = document.valueOf("//dynamic-element[@name='district']/dynamic-content/text()") 
310 
311            eventSliderImgs = document.valueOf("//dynamic-element[@name='slider_image']") 
312            eventSliderImgsCount = eventSliderImgs?split("fileEntryId")?size - 1 
313 
314            eventListImgs = document.valueOf("//dynamic-element[@name='list_image']") 
315            eventListImgsCount = eventListImgs?split("fileEntryId")?size - 1 
316 
317            eventDatesJson = "[" 
318            eventCitiesJson = "[" 
319            eventDistrictsJson = "[" 
320        /> 
321 
322        <#list eventDates as eventDate> 
323            <#if eventDate.valueOf( "dynamic-content")??> 
324                <#assign 
325                    eventDateBegin = eventDate.valueOf( "dynamic-content")?trim 
326                    eventDateEnd = eventDate.valueOf("dynamic-element[@name='date_end']/dynamic-content/text()")?trim 
327                    eventDateJson = '{ 
328                                        "dateBegin": "${eventDateBegin}", 
329                                        "dateEnd": "${eventDateEnd}" 
330                                      }' 
331                /> 
332 
333                <#if eventDate?has_next > 
334                    <#assign eventDateJson = eventDateJson + ',' > 
335                </#if> 
336 
337                <#assign eventDatesJson = eventDatesJson + eventDateJson > 
338            </#if> 
339        </#list> 
340 
341        <#list eventCities as eventCity> 
342            <#if eventCity.valueOf("dynamic-content")??> 
343 
344                <#assign 
345                    eventCityValue = eventCity.valueOf("dynamic-content")?trim 
346                /> 
347 
348                <#assign eventCitiesJson = eventCitiesJson + eventCityValue > 
349 
350                <#if eventCity?has_next > 
351                    <#assign eventCitiesJson = eventCitiesJson + ',' > 
352                </#if> 
353            </#if> 
354        </#list> 
355 
356        <#list eventDistricts as eventDistrict> 
357            <#if eventDistrict.valueOf("dynamic-content")??> 
358 
359                <#assign 
360                    eventDistrictValue = eventDistrict.valueOf("dynamic-content")?trim 
361                /> 
362 
363                <#assign eventDistrictsJson = eventDistrictsJson + eventDistrictValue > 
364 
365                <#if eventDistrict?has_next > 
366                    <#assign eventDistrictsJson = eventDistrictsJson + ',' > 
367                </#if> 
368            </#if> 
369        </#list> 
370 
371        <#assign 
372            eventDatesJson = eventDatesJson + "]" 
373            eventCitiesJson = eventCitiesJson + "]" 
374            eventDistrictsJson = eventDistrictsJson + "]" 
375        /> 
376 
377        <#if eventSliderImgsCount == 2 > <#-- We get the image in the right language --> 
378            <#assign 
379                eventSliderImg = document.valueOf("//dynamic-element[@name='slider_image']/dynamic-content[@language-id='${selectedLanguageId}']/text()") 
380            /> 
381        <#elseif eventSliderImgsCount == 1> <#-- We get the unlocalized image --> 
382            <#assign 
383                eventSliderImg = document.valueOf("//dynamic-element[@name='slider_image']/dynamic-content/text()") 
384            /> 
385        </#if> 
386 
387        <#assign 
388            jsonObjectSliderImg = jsonFactoryUtil.createJSONObject(eventSliderImg) 
389            fileEntryIdSliderImg = jsonObjectSliderImg.getLong("fileEntryId") 
390            fileEntrySliderImg = "" 
391            eventSliderImgPath = "" 
392            eventListImg = "" 
393        /> 
394 
395        <#if eventListImgsCount == 2 > <#-- We get the image in the right language --> 
396            <#assign 
397                eventListImg = document.valueOf("//dynamic-element[@name='list_image']/dynamic-content[@language-id='${selectedLanguageId}']/text()") 
398            /> 
399        <#elseif eventListImgsCount == 1> <#-- We get the unlocalized image --> 
400            <#assign 
401                eventListImg = document.valueOf("//dynamic-element[@name='list_image']/dynamic-content/text()") 
402            /> 
403        </#if> 
404 
405        <#assign 
406            jsonObjectListImg = jsonFactoryUtil.createJSONObject(eventListImg) 
407            fileEntryIdListImg = jsonObjectListImg.getLong("fileEntryId") 
408            fileEntryListImg = "" 
409            eventListImgPath = "" 
410        /> 
411 
412        <#if eventCity != "" > 
413            <#assign eventCityFinal = eventCity > 
414        </#if> 
415 
416        <#if eventDistrict != "" > 
417            <#assign eventDistrictFinal = eventDistrict > 
418        </#if> 
419 
420        <#if fileEntryIdSliderImg != 0 > 
421            <#assign 
422                fileEntrySliderImg = portletFileRepositoryUtil.getPortletFileEntry(fileEntryIdSliderImg) 
423                eventSliderImgPath = portletFileRepositoryUtil.getPortletFileEntryURL(themeDisplay, fileEntrySliderImg.getLatestFileVersion(true).getFileEntry(), "", true) 
424
425        </#if> 
426 
427        <#if fileEntryIdListImg != 0 > 
428            <#attempt> 
429                <#assign 
430                    fileEntryListImg = portletFileRepositoryUtil.getPortletFileEntry(fileEntryIdListImg) 
431                    eventListImgPath = portletFileRepositoryUtil.getPortletFileEntryURL(themeDisplay, fileEntryListImg.getLatestFileVersion(true).getFileEntry(), "", true) 
432
433                <#recover> 
434                    Ha ocurrido un error recuperando la imagen: ${fileEntryIdListImg} 
435            </#attempt> 
436        </#if> 
437 
438        <#assign 
439            eventTitle = '{ 
440                            "ca_ES": "${eventTitleCatSanitized}", 
441                            "es_ES": "${eventTitleEspSanitized}" 
442                          }' 
443 
444            eventAddress = '{ 
445                            "ca_ES": "${eventAddressCatSanitized}", 
446                            "es_ES": "${eventAddressEspSanitized}" 
447                          }' 
448        /> 
449 
450        <#assign eventJson = '{ 
451                                "id": ${articleId}, 
452                                "title": ${eventTitle}, 
453                                "content": "${eventContentSanitized}", 
454                                "dateBegin": "${eventDateBegin}", 
455                                "dateEnd": "${eventDateEnd}", 
456                                "dates": ${eventDatesJson}, 
457                                "address": ${eventAddress}, 
458                                "city": ${eventCityFinal}, 
459                                "cities": ${eventCitiesJson}, 
460                                "district": ${eventDistrictFinal}, 
461                                "districts": ${eventDistrictsJson}, 
462                                "sliderImgPath": "${eventSliderImgPath}", 
463                                "listImgPath": "${eventListImgPath}" 
464                              }' > 
465 
466        <#assign eventsJson = eventsJson + eventJson > 
467 
468        <#if eventCity == "2" > 
469            <#assign eventsBarcelonaJson = eventsBarcelonaJson + eventJson > 
470            <#assign eventsBarcelonaJson = eventsBarcelonaJson + ',' > 
471        </#if> 
472 
473        <#if articleId?has_next > 
474            <#assign eventsJson = eventsJson + ',' > 
475        </#if> 
476 
477    </#list> 
478 
479    <#assign 
480        eventsJson = eventsJson + "]" 
481        eventsBarcelonaJson = eventsBarcelonaJson + "]" 
482    /> 
483</#if> 
484 
485 
486<div class="container" id="ag-bab-slider-info"> 
487    <div class="row mb-4"> 
488        <div class="col-12"> 
489            <hr class="bab-hr"> 
490        </div> 
491    </div> 
492    <div class="row"> 
493        <div class="col-12"> 
494            <span class="ag-bab-events-title" id="ag-bab-events-title"> 
495            </span> 
496            <span class="ag-bab-events-subtitle" id="ag-bab-events-subtitle"> 
497            </span> 
498        </div> 
499    </div> 
500</div> 
501 
502<div class="ag-bab-slider mt-4" id="ag-bab-slider"> 
503</div> 
504 
505<div style="margin-bottom: 100px"> 
506</div> 
507 
508<script> 
509    function getCityNameByID(cityID) { 
510        var cityName = ""; 
511 
512        switch (cityID) { 
513            case 1: 
514                cityName = "Badalona"; 
515                break; 
516 
517            case 2: 
518                cityName = "Barcelona"; 
519                break; 
520 
521            case 3: 
522                cityName = "Begues"; 
523                break; 
524 
525            case 4: 
526                cityName = "Castelldefels"; 
527                break; 
528 
529            case 5: 
530                cityName = "Cerdanyola del Vallès"; 
531                break; 
532 
533            case 6: 
534                cityName = "Cornellà de Llobregat"; 
535                break; 
536 
537            case 7: 
538                cityName = "El Papiol"; 
539                break; 
540 
541            case 8: 
542                cityName = "Esplugues de Llobregat"; 
543                break; 
544 
545            case 9: 
546                cityName = "Gavà"; 
547                break; 
548 
549            case 10: 
550                cityName = "L’Hospitalet de Llobregat"; 
551                break; 
552 
553            case 11: 
554                cityName = "Montcada i Reixac"; 
555                break; 
556 
557            case 12: 
558                cityName = "Montgat"; 
559                break; 
560 
561            case 13: 
562                cityName = "Pallejà"; 
563                break; 
564 
565            case 14: 
566                cityName = "Sant Adrià de Besòs"; 
567                break; 
568 
569            case 15: 
570                cityName = "Sant Boi de Llobregat"; 
571                break; 
572 
573            case 16: 
574                cityName = "Sant Climent de Llobregat"; 
575                break; 
576 
577            case 17: 
578                cityName = "Sant Feliu de Llobregat"; 
579                break; 
580 
581            case 18: 
582                cityName = "Sant Joan Despí"; 
583                break; 
584 
585            case 19: 
586                cityName = "Sant Just Desvern"; 
587                break; 
588 
589            case 20: 
590                cityName = "Santa Coloma de Cervelló"; 
591                break; 
592 
593            case 21: 
594                cityName = "Santa Coloma de Gramenet"; 
595                break; 
596 
597            case 22: 
598                cityName = "Torrelles de Llobregat"; 
599                break; 
600 
601            case 23: 
602                cityName = "Viladecans"; 
603                break; 
604
605 
606        return cityName; 
607
608 
609    function getDistrictNameByID(districtID) { 
610        var districtName = ""; 
611 
612        switch (districtID) { 
613            case 1: 
614                districtName = "Ciutat Vella"; 
615                break; 
616 
617            case 2: 
618                districtName = "Eixample"; 
619                break; 
620 
621            case 3: 
622                districtName = "Gràcia"; 
623                break; 
624 
625            case 4: 
626                districtName = "Horta - Guinardó"; 
627                break; 
628 
629            case 5: 
630                districtName = "Les Corts"; 
631                break; 
632 
633            case 6: 
634                districtName = "Nou Barris"; 
635                break; 
636 
637            case 7: 
638                districtName = "Sant Andreu"; 
639                break; 
640 
641            case 8: 
642                districtName = "Sant Martí"; 
643                break; 
644 
645            case 9: 
646                districtName = "Sants - Montjuïc"; 
647                break; 
648 
649            case 10: 
650                districtName = "Sarrià - Sant Gervasi"; 
651                break; 
652
653 
654        return districtName; 
655
656 
657    function initSlider(events, showDots) { 
658        $(function () { 
659            $("#ag-bab-slider").slick({ 
660                dots: showDots, 
661                arrows: false, 
662                focusOnSelect: true, 
663                autoplay: true, 
664                autoplaySpeed: 5000, 
665                adaptiveHeight: true 
666            }); 
667        }); 
668
669 
670    function getSliderEvents() { 
671        var sliderEvents = []; 
672 
673        if (eventsByPlace.length > 0) { // If there are events for the current place 
674            sliderEvents = eventsByPlace; 
675        } else if (eventsBarcelona.length > 0) { // If there aren't events for the current place but there are for Barcelona 
676            sliderEvents = eventsBarcelona; 
677
678 
679        return sliderEvents; 
680
681 
682    function getSliderEventsHTML() { 
683        var sliderEventsHTML = ""; 
684 
685        for (var counter = 0; counter < sliderEvents.length; counter++) { 
686            sliderEventsHTML += getSliderEventHTML(sliderEvents[counter]); 
687
688 
689        return sliderEventsHTML; 
690
691 
692    function getEventsByPlace(placeType, placeID) { 
693        var eventsByPlace = []; 
694 
695        for (var counter = 0; counter < allEvents.length; counter++) { 
696            var event = allEvents[counter]; 
697 
698            if (showOnlyFutureEvents && eventIsOver(event)) { 
699                continue; 
700
701 
702            if (placeType === "city" && event.hasOwnProperty("cities") && Array.isArray(event.cities) && event.cities.includes(placeID)) { 
703                eventsByPlace.push(event); 
704            } else if (placeType === "district" && event.hasOwnProperty("districts") && Array.isArray(event.districts) && event.districts.includes(placeID)) { 
705                eventsByPlace.push(event); 
706
707
708 
709        return eventsByPlace; 
710
711 
712    function getEventsBarcelona() { 
713        var eventsBarcelona = []; 
714 
715        for (var counter = 0; counter < allEvents.length; counter++) { 
716            var event = allEvents[counter]; 
717 
718            if (showOnlyFutureEvents && eventIsOver(event)) { 
719                continue; 
720
721 
722            if ((event.hasOwnProperty("cities") && Array.isArray(event.cities) && event.cities.includes(2)) || 
723                (event.hasOwnProperty("districts") && Array.isArray(event.districts) && event.districts.length > 0) ) { 
724                eventsBarcelona.push(event); 
725
726
727 
728        return eventsBarcelona; 
729
730 
731    function eventIsOver(event) { 
732        var eventIsOver = false; 
733        var currentDate = new Date(); 
734 
735        if (!event.hasOwnProperty("dates") || event.dates.length === 0) { 
736            return eventIsOver; 
737
738 
739        // If event has only one date 
740        if (event.dates.length === 1) { 
741            if (dateHasEnd(event.dates[0])) { 
742                var dateBegin = Date.parse(event.dates[0].dateBegin); 
743                var dateEnd = Date.parse(event.dates[0].dateEnd); 
744 
745                var dateToCompare = dateBegin; 
746                if (dateBegin < dateEnd) { 
747                    dateToCompare = dateEnd; 
748
749 
750                if (dateToCompare < currentDate) { 
751                    eventIsOver = true; 
752
753
754
755 
756        // If event has more than one date 
757        if (event.dates.length > 1) { 
758            if (!eventHasAtLeastOneCurrentOrFutureDate(event)) { 
759                eventIsOver = true; 
760
761
762 
763        return eventIsOver; 
764
765 
766    function eventHasAtLeastOneCurrentOrFutureDate(event) { 
767        var eventHasAtLeastOneCurrentOrFutureDate = false; 
768        var currentDate = getCurrentDateParsed(); 
769 
770        for (var counter = 0; counter < event.dates.length; counter++) { 
771            var dateBegin = Date.parse(event.dates[counter].dateBegin); 
772            var dateToCompare = dateBegin; 
773 
774            // If current date has only a date begin 
775            if (!dateHasEnd(event.dates[counter])) { 
776                // If the date begin is equals or greather than the current date 
777                if (dateToCompare >= currentDate) { 
778                    eventHasAtLeastOneCurrentOrFutureDate = true; 
779                    return eventHasAtLeastOneCurrentOrFutureDate; 
780
781
782 
783            if (dateHasEnd(event.dates[counter])) { // If current date has a date end 
784                var dateEnd = Date.parse(event.dates[counter].dateEnd); 
785 
786                if (dateBegin < dateEnd) { 
787                    dateToCompare = dateEnd; 
788
789 
790                if (dateToCompare >= currentDate) { 
791                    eventHasAtLeastOneCurrentOrFutureDate = true; 
792                    return eventHasAtLeastOneCurrentOrFutureDate; 
793
794
795
796 
797        return eventHasAtLeastOneCurrentOrFutureDate; 
798
799 
800    function getCurrentDateParsed() { 
801        var currentDate = new Date(); 
802        var currentDateYear = currentDate.getFullYear(); 
803        var currentDateMonth = "" + (currentDate.getMonth() + 1); 
804        var currentDateDay = "" + currentDate.getDate(); 
805        var currentDateString = currentDateYear + "-" + currentDateMonth + "-" + currentDateDay; 
806        var currentDateParsed = Date.parse(currentDateString); 
807 
808        return currentDateParsed; 
809
810 
811    function dateHasEnd(date) { 
812        var dateHasEnd = false; 
813 
814        if (date.hasOwnProperty("dateEnd") && date.dateEnd.length === 10) { 
815            dateHasEnd = true; 
816
817 
818        return dateHasEnd; 
819
820 
821    function setSliderEventsHTML(sliderEventsHTML) { 
822        $("#ag-bab-slider").html(sliderEventsHTML); 
823
824 
825    function getSliderEventHTML(article) { 
826        var sliderEventHTML = sliderComponent; 
827 
828        sliderEventHTML = sliderEventHTML.replace(/{{id}}/gi, article.id); 
829 
830        var articleTitle = getSliderEventTitle(article); 
831 
832        sliderEventHTML = sliderEventHTML.replace(/{{title}}/gi, articleTitle); 
833 
834        var articleAddress = ""; 
835        var articleAddressContainer = ""; 
836 
837        if (article.hasOwnProperty("address") && article.address.hasOwnProperty("ca_ES") && article.address.hasOwnProperty("es_ES")) { 
838            if (article.address.es_ES !== "" && currentLang === "es_ES") { 
839                articleAddress = article.address.es_ES; 
840            } else if (article.address.ca_ES !== "" && currentLang === "ca_ES") { 
841                articleAddress = article.address.ca_ES; 
842            } else if (article.address.ca_ES === "" && article.address.es_ES === "") { 
843                articleAddressContainer = "style='display: none'"; 
844
845
846 
847        var articleListImgPath = getListImgPathByEvent(article); 
848        sliderEventHTML = sliderEventHTML.replace(/{{address}}/gi, articleAddress); 
849        sliderEventHTML = sliderEventHTML.replace(/{{addressContainer}}/gi, articleAddressContainer); 
850        //sliderEventHTML = sliderEventHTML.replace(/{{cityName}}/gi, article.cityName); 
851        sliderEventHTML = sliderEventHTML.replace(/{{cityName}}/gi, getCityNameByID(article.city)); 
852        var date = getDateByEvent(article); 
853        sliderEventHTML = sliderEventHTML.replace(/{{date}}/gi, date); 
854        sliderEventHTML = sliderEventHTML.replace(/{{image}}/gi, "'" + articleListImgPath + "'"); 
855        var moreInfoText = getTranslatedString("Més informació"); 
856        sliderEventHTML = sliderEventHTML.replace(/{{moreInfoText}}/gi, moreInfoText); 
857 
858        return sliderEventHTML; 
859
860 
861    function getSliderEventTitle(article) { 
862        var articleTitle = ""; 
863        var articleTitleCat = ""; 
864        var articleTitleEsp = ""; 
865        if (article.hasOwnProperty("title") && article.title.hasOwnProperty("ca_ES") && article.title.hasOwnProperty("es_ES")) { 
866            if (article.title.ca_ES !== "") { 
867                articleTitleCat = article.title.ca_ES; 
868
869 
870            if (article.title.es_ES !== "") { 
871                articleTitleEsp = article.title.es_ES; 
872
873 
874            if (articleTitleCat !== "" && currentLang === "ca_ES") { 
875                articleTitle = articleTitleCat; 
876            } else if (articleTitleEsp !== "") { 
877                articleTitle = articleTitleEsp; 
878
879 
880            if (articleTitleEsp !== "" && currentLang === "es_ES") { 
881                articleTitle = articleTitleEsp; 
882            } else if (articleTitleCat !== "") { 
883                articleTitle = articleTitleCat; 
884
885
886 
887        return articleTitle; 
888
889 
890 
891    function setInfoMessage() { 
892        var eventsInfoContainerSelector = "#ag-bab-slider-info"; 
893        var eventsInfoTitleSelector = "#ag-bab-events-title"; 
894        var eventsInfoSubtitleSelector = "#ag-bab-events-subtitle"; 
895 
896        var eventsInfoTitle = ""; 
897        var eventsInfoSubtitle = ""; 
898 
899        if (currentPlaceType === "city") { 
900            eventsInfoTitle = getTranslatedString("Pròxims esdeveniments prop del teu municipi"); 
901        } else if (currentPlaceType === "district") { 
902            eventsInfoTitle = getTranslatedString("Pròxims esdeveniments prop del teu barri"); 
903
904 
905        var showInfoMessage = false; 
906        if (eventsByPlace.length === 0 && eventsBarcelona.length === 0) { // If there aren't events for the place nor Barcelona 
907            if (currentPlaceType === "city") { 
908                eventsInfoSubtitle = getTranslatedString("Actualment, en aquest municipi no hi ha esdeveniments programats."); 
909            } else if (currentPlaceType === "district") { 
910                eventsInfoSubtitle = getTranslatedString("Actualment, en aquest barri no hi ha esdeveniments programats."); 
911
912 
913            showInfoMessage = true; 
914        } else if (eventsByPlace.length === 0 && eventsBarcelona.length > 0) { // If there aren't events for the place but there are for Barcelona 
915            eventsInfoSubtitle = getTranslatedString("No hi ha esdeveniments propers. A continuació t’indiquem els pròxims esdeveniments de Barcelona per si et poden interessar."); 
916            showInfoMessage = true; 
917
918 
919        $(eventsInfoTitleSelector).html(eventsInfoTitle); 
920        $(eventsInfoSubtitleSelector).html(eventsInfoSubtitle); 
921 
922        if (showInfoMessage) { 
923            $(eventsInfoContainerSelector).show(); 
924
925
926 
927    function getDateByEvent(event) { 
928        var dateByEvent = ""; 
929 
930        if (event.hasOwnProperty("dates") && Array.isArray(event.dates) && event.dates.length > 0) { 
931            if (event.dates[0].hasOwnProperty("dateBegin") && event.dates[0].dateBegin.length === 10) { 
932                dateByEvent = getFormattedDate(event.dates[0].dateBegin); 
933
934 
935            if (event.dates.length > 1) { 
936                dateByEvent = getTranslatedString("Diverses dates"); 
937
938 
939            if (event.dates.length === 1 && event.dates[0].hasOwnProperty("dateBegin") && event.dates[0].dateBegin.length === 10 && event.dates[0].hasOwnProperty("dateEnd") && event.dates[0].dateEnd.length === 10) { 
940                var dateBegin = Date.parse(event.dates[0].dateBegin); 
941                var dateEnd = Date.parse(event.dates[0].dateEnd); 
942 
943                if (dateBegin < dateEnd) { 
944                    dateByEvent = getFormattedDate(event.dates[0].dateBegin) + " - " + getFormattedDate(event.dates[0].dateEnd); 
945
946
947
948 
949        return dateByEvent; 
950
951 
952    function getListImgPathByEvent(event) { 
953        var listImgPath = ""; 
954 
955        var listImagePath = ""; 
956        var sliderFirstImagePath = ""; 
957 
958        if (event.hasOwnProperty("listImgPath") && event.listImgPath !== "") { 
959            listImagePath = event.listImgPath; 
960
961 
962        if (event.hasOwnProperty("sliderImgPath") && event.sliderImgPath !== "") { 
963            sliderFirstImagePath = event.sliderImgPath; 
964
965 
966        if (sliderFirstImagePath !== "") { 
967            listImgPath = sliderFirstImagePath; 
968
969 
970        if (listImagePath !== "") { 
971            listImgPath = listImagePath; 
972
973 
974        return listImgPath; 
975
976 
977    function getTranslatedString(str) { 
978        var translatedString = str; 
979 
980        if (currentLang === "es_ES") { 
981            switch(str.toLowerCase()) { 
982                case "més informació": 
983                    translatedString = "Más información"; 
984                    break; 
985 
986                case "pròxims esdeveniments prop del teu municipi": 
987                    translatedString = "Próximos eventos cerca de tu municipio"; 
988                    break; 
989 
990                case "pròxims esdeveniments prop del teu barri": 
991                    translatedString = "Próximos eventos cerca de tu barrio"; 
992                    break; 
993 
994                case "actualment, en aquest barri no hi ha esdeveniments programats.": 
995                    translatedString = "Actualmente, en este barrio no hay eventos programados."; 
996                    break; 
997 
998                case "no hi ha esdeveniments propers. a continuació t’indiquem els pròxims esdeveniments de barcelona per si et poden interessar.": 
999                    translatedString = "No hay eventos próximos. A continuación te indicamos los próximos eventos de Barcelona por si te pueden interesar."; 
1000                    break; 
1001 
1002                case "actualment, en aquest municipi no hi ha esdeveniments programats.": 
1003                    translatedString = "Actualmente, en este municipio no hay eventos programados."; 
1004                    break; 
1005 
1006                case "diverses dates": 
1007                    translatedString = "Varias fechas"; 
1008                    break; 
1009 
1010
1011
1012 
1013        return translatedString; 
1014
1015 
1016    function getPlaceIDFromURL() { 
1017        var placeIDFromURL = 0; 
1018 
1019        var currentURL = getCurrentURL(); 
1020 
1021        if (currentURL.includes("badalona")) { // Cities 
1022            placeIDFromURL = 1; 
1023        } else if (currentURL.includes("begues")) { 
1024            placeIDFromURL = 3; 
1025        } else if (currentURL.includes("castelldefels")) { 
1026            placeIDFromURL = 4; 
1027        } else if (currentURL.includes("cerdanyola")) { 
1028            placeIDFromURL = 5; 
1029        } else if (currentURL.includes("cornella")) { 
1030            placeIDFromURL = 6; 
1031        } else if (currentURL.includes("papiol")) { 
1032            placeIDFromURL = 7; 
1033        } else if (currentURL.includes("esplugues")) { 
1034            placeIDFromURL = 8; 
1035        } else if (currentURL.includes("gava")) { 
1036            placeIDFromURL = 9; 
1037        } else if (currentURL.includes("hospitalet")) { 
1038            placeIDFromURL = 10; 
1039        } else if (currentURL.includes("montcada")) { 
1040            placeIDFromURL = 11; 
1041        } else if (currentURL.includes("montgat")) { 
1042            placeIDFromURL = 12; 
1043        } else if (currentURL.includes("palleja")) { 
1044            placeIDFromURL = 13; 
1045        } else if (currentURL.includes("besos")) { 
1046            placeIDFromURL = 14; 
1047        } else if (currentURL.includes("sant-boi")) { 
1048            placeIDFromURL = 15; 
1049        } else if (currentURL.includes("climent")) { 
1050            placeIDFromURL = 16; 
1051        } else if (currentURL.includes("sant-feliu-de-llobregat")) { 
1052            placeIDFromURL = 17; 
1053        } else if (currentURL.includes("despi")) { 
1054            placeIDFromURL = 18; 
1055        } else if (currentURL.includes("desvern")) { 
1056            placeIDFromURL = 19; 
1057        } else if (currentURL.includes("cervello")) { 
1058            placeIDFromURL = 20; 
1059        } else if (currentURL.includes("gramenet")) { 
1060            placeIDFromURL = 21; 
1061        } else if (currentURL.includes("torrelles")) { 
1062            placeIDFromURL = 22; 
1063        } else if (currentURL.includes("viladecans")) { 
1064            placeIDFromURL = 23; 
1065        } else if (currentURL.includes("ciutat-vella")) { // Districts 
1066            placeIDFromURL = 1; 
1067        } else if (currentURL.includes("eixample")) { 
1068            placeIDFromURL = 2; 
1069        } else if (currentURL.includes("gracia")) { 
1070            placeIDFromURL = 3; 
1071        } else if (currentURL.includes("guinardo")) { 
1072            placeIDFromURL = 4; 
1073        } else if (currentURL.includes("corts")) { 
1074            placeIDFromURL = 5; 
1075        } else if (currentURL.includes("barris")) { 
1076            placeIDFromURL = 6; 
1077        } else if (currentURL.includes("andreu")) { 
1078            placeIDFromURL = 7; 
1079        } else if (currentURL.includes("marti")) { 
1080            placeIDFromURL = 8; 
1081        } else if (currentURL.includes("montjuic")) { 
1082            placeIDFromURL = 9; 
1083        } else if (currentURL.includes("gervasi")) { 
1084            placeIDFromURL = 10; 
1085
1086 
1087        return placeIDFromURL; 
1088
1089 
1090    function getCurrentURL() { 
1091        var currentURL = window.location.pathname; 
1092        currentURL = currentURL.toString().toLowerCase(); 
1093 
1094        return currentURL; 
1095
1096 
1097    function getCurrentPlaceType() { 
1098        var currentPlaceType = ""; 
1099 
1100        if (isCurrentPlaceACity()) { 
1101            currentPlaceType = "city"; 
1102        } else if (isCurrentPlaceADistrict()) { 
1103            currentPlaceType = "district"; 
1104
1105 
1106        return currentPlaceType; 
1107
1108 
1109    function isCurrentPlaceACity() { 
1110        var isCurrentPlaceACity = false; 
1111 
1112        var currentURL = getCurrentURL(); 
1113 
1114        if ( 
1115            currentURL.includes("badalona") || 
1116            currentURL.includes("begues") || 
1117            currentURL.includes("castelldefels") || 
1118            currentURL.includes("cerdanyola") || 
1119            currentURL.includes("cornella") || 
1120            currentURL.includes("papiol") || 
1121            currentURL.includes("esplugues") || 
1122            currentURL.includes("gava") || 
1123            currentURL.includes("hospitalet") || 
1124            currentURL.includes("montcada") || 
1125            currentURL.includes("montgat") || 
1126            currentURL.includes("palleja") || 
1127            currentURL.includes("besos") || 
1128            currentURL.includes("sant-boi") || 
1129            currentURL.includes("climent") || 
1130            currentURL.includes("sant-feliu-de-llobregat") || 
1131            currentURL.includes("despi") || 
1132            currentURL.includes("desvern") || 
1133            currentURL.includes("cervello") || 
1134            currentURL.includes("gramenet") || 
1135            currentURL.includes("torrelles") || 
1136            currentURL.includes("viladecans") 
1137           ) { 
1138            isCurrentPlaceACity = true; 
1139
1140 
1141        return isCurrentPlaceACity; 
1142
1143 
1144    function isCurrentPlaceADistrict() { 
1145        var isCurrentPlaceADistrict = false; 
1146 
1147        var currentURL = getCurrentURL(); 
1148 
1149        if ( 
1150            currentURL.includes("ciutat-vella") || 
1151            currentURL.includes("eixample") || 
1152            currentURL.includes("gracia") || 
1153            currentURL.includes("guinardo") || 
1154            currentURL.includes("corts") || 
1155            currentURL.includes("barris") || 
1156            currentURL.includes("andreu") || 
1157            currentURL.includes("marti") || 
1158            currentURL.includes("montjuic") || 
1159            currentURL.includes("gervasi") 
1160           ) { 
1161            isCurrentPlaceADistrict = true; 
1162
1163 
1164        return isCurrentPlaceADistrict; 
1165
1166 
1167    function getFormattedDate(date) { 
1168    	var formattedDate = date; 
1169    	var dateSeparator = "/"; 
1170 
1171    	var dateArray = date.split("-"); 
1172 
1173    	if ( dateArray.length !== 3 || 
1174   			(dateArray[0].length !== 4 || dateArray[1].length !== 2 || dateArray[2].length !== 2) ) { 
1175    		return date; 
1176
1177 
1178    	var year = dateArray[0].toString(); 
1179    	var month = dateArray[1].toString(); 
1180    	var day = dateArray[2].toString(); 
1181 
1182    	if (year.length === 4 && month.length === 2 && month.length === 2) { 
1183    		formattedDate = day + dateSeparator + month + dateSeparator + year; 
1184
1185 
1186    	return formattedDate; 
1187
1188 
1189    function toggleShareVisibility(elementID) { 
1190        var elementSelector = "#" + elementID; 
1191        var sliderContainerSelector = "div.slick-list"; 
1192        var sliderDotsContainerSelector = "ul.slick-dots"; 
1193        $("div.ag-social-share-options").not(elementSelector).hide(); 
1194 
1195        if( $(elementSelector).is(":visible") ) { 
1196            $(elementSelector).hide(); 
1197            $(sliderDotsContainerSelector).show(); 
1198        } else { 
1199            $(elementSelector).show(); 
1200            $(sliderDotsContainerSelector).hide(); 
1201
1202
1203 
1204    function shareLink(socialNetwork, articleId, linkElement) { 
1205        var shareURL = ""; 
1206        var linkURL = portalURL + getEventURL(articleId); 
1207        var articleTitle = ""; 
1208 
1209        if (linkURL === "") { 
1210            return; 
1211
1212 
1213        if ($(linkElement).attr("data-event-title") !== "") { 
1214            articleTitle = encodeURIComponent( $(linkElement).attr("data-event-title") ); 
1215
1216 
1217        switch (socialNetwork) { 
1218            case "twitter": 
1219                shareURL = "https://twitter.com/intent/tweet?text=" + articleTitle + "&tw_p=tweetbutton&url=" + linkURL; 
1220                break; 
1221 
1222            case "facebook": 
1223                shareURL = "https://www.facebook.com/sharer/sharer.php?u=" + linkURL; 
1224                break; 
1225 
1226            case "linkedin": 
1227                shareURL = "http://www.linkedin.com/shareArticle?&title=" + articleTitle + "&mini=true&url=" + linkURL + "&summary="; 
1228                break; 
1229
1230 
1231        var w = window.open(shareURL, "popupWindow", "width=600, height=400, scrollbars=yes"); 
1232        $("#" + "ag-social-share-" + articleId).hide(); 
1233
1234 
1235    function goToDetail(eventId) { 
1236        var eventURL = getEventURL(eventId); 
1237    	window.location.href = eventURL; 
1238
1239 
1240    function getEventURL(eventId) { 
1241        var eventURL = "/c/portal/layout?p_l_id=${agendaLayout}&p_p_id=" + portletId + "&_" + portletId + "_jspPage=%2Fdetail.jsp&_" + portletId + "_eventId=" + eventId; 
1242 
1243        if (currentLang === "/es") { 
1244            eventURL = "/es" + eventURL; 
1245
1246 
1247        eventURL = portalURL + eventURL; 
1248 
1249    	return eventURL; 
1250
1251 
1252    function getPortletURLByEventId(eventId) { 
1253    	var portletURL = new Liferay.PortletURL(); 
1254		portletURL.setPortletId(portletId); 
1255    	portletURL.setParameter("jspPage", "/detail.jsp"); 
1256    	portletURL.setParameter("eventId", eventId); 
1257 
1258    	return portletURL; 
1259
1260 
1261    var sliderComponent = `<div> 
1262                              <div class="container"> 
1263                                  <div class="row"> 
1264                                      <div class="col-12 ag-content-container-event"> 
1265                                          <div class="row"> 
1266                                              <div class="col-12"> 
1267                                                  <div class="ag-content-container-event-image" style="background-image: url({{image}});"> 
1268                                                      <div class="ag-content-container-event-image-overflow"> 
1269                                                          <div class="ag-city-container"> 
1270                                                              <span class="ag-city">{{cityName}}</span> 
1271                                                          </div> 
1272                                                          <div class="ag-address-container" {{addressContainer}}> 
1273                                                              <span class="ag-address" title="{{address}}">{{address}}</span> <img src="/o/com.aguas.barcelona.cms.agenda/img/icon_pin.png" alt="" class="ag-icon-pin" /> 
1274                                                          </div> 
1275                                                          <div class="ag-city-container"> 
1276                                                              <span class="ag-date" title="{{date}}">{{date}}</span> 
1277                                                          </div> 
1278                                                      </div> 
1279                                                  </div> 
1280                                              </div> 
1281                                          </div> 
1282                                          <div class="row"> 
1283                                              <div class="col-12"> 
1284                                                  <div class="container ag-list-event-title-container"> 
1285                                                      <div class="row"> 
1286                                                          <div class="col-10 px-0"> 
1287                                                              <a class="ag-list-event-link" href="javascript:void(0)" onclick="goToDetail({{id}})"> 
1288                                                                  <span class="ag-list-event-title ag-truncate-multiline-2" title="{{title}}">{{title}}</span> 
1289                                                              </a> 
1290                                                          </div> 
1291                                                          <div class="col-2 px-0 ag-list-event-share-container"> 
1292                                                              <a href="javascript:void(0)" onclick="toggleShareVisibility('ag-social-share-{{id}}')"> 
1293                                                                  <img src="/o/com.aguas.barcelona.cms.agenda/img/icon_share.png" name="ag-list-icon-share" class="ag-list-icon-share" alt="Compartir" /> 
1294                                                              </a> 
1295                                                              <div class="ag-social-share-options" ref="menu" name="ag-social-share-options" id="ag-social-share-{{id}}" style="display: none"> 
1296                                                                  <ul> 
1297                                                                      <li tabindex="-1"> 
1298                                                                          <a data-event-title="{{title}}" href="javascript:void(0)" onclick="shareLink('twitter', {{id}}, this)">Twitter</a> 
1299                                                                      </li> 
1300                                                                      <li tabindex="-1"> 
1301                                                                          <a data-event-title="{{title}}" href="javascript:void(0)" onclick="shareLink('facebook', {{id}}, this)">Facebook</a> 
1302                                                                      </li> 
1303                                                                      <li tabindex="-1"> 
1304                                                                          <a data-event-title="{{title}}" href="javascript:void(0)" onclick="shareLink('linkedin', {{id}}, this)">LinkedIn</a> 
1305                                                                      </li> 
1306                                                                  </ul> 
1307                                                              </div> 
1308                                                          </div> 
1309                                                      </div> 
1310                                                  </div> 
1311                                              </div> 
1312                                          </div> 
1313                                          <div class="row"> 
1314                                              <div class="col-12"> 
1315                                                  <div class="container ag-list-event-moreinfo-container"> 
1316                                                      <div class="row"> 
1317                                                          <div class="col-12 px-0"> 
1318                                                              <a class="ag-list-event-moreinfo" href="javascript:void(0)" onclick="goToDetail({{id}})"> 
1319                                                                  {{moreInfoText}}  > 
1320                                                              </a> 
1321                                                          </div> 
1322                                                      </div> 
1323                                                  </div> 
1324                                              </div> 
1325                                          </div> 
1326                                      </div> 
1327                                  </div> 
1328                              </div> 
1329                          </div>`; 
1330 
1331    var currentLang = "${themeDisplay.getLocale()}"; 
1332    var allEvents = ${eventsJson}; 
1333    var portalURL = "${themeDisplay.getPortalURL()}"; 
1334    var portletId = "Agenda_AgendaPortlet_INSTANCE_${agendaInstanceId}"; 
1335 
1336    var showOnlyFutureEvents = true; 
1337    var currentPlaceType = getCurrentPlaceType(); 
1338    var eventsByPlace = getEventsByPlace(getCurrentPlaceType(), getPlaceIDFromURL()); 
1339    var eventsBarcelona = getEventsBarcelona(); 
1340 
1341    var sliderEvents = getSliderEvents(); 
1342    var sliderEventsHTML = getSliderEventsHTML(); 
1343    setSliderEventsHTML(sliderEventsHTML); 
1344    setInfoMessage(); 
1345 
1346    var showDots = false; 
1347    if (sliderEvents.length > 1) { 
1348        showDots = true; 
1349
1350 
1351    initSlider(sliderEvents, showDots); 
1352</script>