Retour

Réinscriptions en ligne

Une erreur s'est produite en traitant le calibre.
No signature of method create matches the arguments
1<#-- 
2Application display templates can be used to modify the look of a 
3specific application. 
4 
5Please use the left panel to quickly add commonly used variables. 
6Autocomplete is also available and can be invoked by typing "${". 
7--> 
8 
9<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetEntryLocalService") /> 
10<#assign classNameLocalService = serviceLocator.findService("com.liferay.portal.service.ClassNameLocalService") /> 
11<#assign assetLinkLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetLinkLocalService") /> 
12<#assign bookmarksEntryLocalService = serviceLocator.findService("com.liferay.portlet.bookmarks.service.BookmarksEntryLocalService") /> 
13<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService") /> 
14<#assign journalStructureLocalService = serviceLocator.findService("com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService") /> 
15<#assign dlFileEntryLocalService = serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService") /> 
16 
17<#assign typeJournalArticle = "com.liferay.portlet.journal.model.JournalArticle" /> 
18<#assign typeBookmarksEntry = "com.liferay.portlet.bookmarks.model.BookmarksEntry" /> 
19<#assign typeDLFileEntry = "com.liferay.portlet.documentlibrary.model.DLFileEntry" /> 
20 
21<#assign journalArticle = journalArticleLocalService.getArticle(groupId, .vars['reserved-article-id'].data) /> 
22<#assign entry = assetEntryLocalService.getEntry(typeJournalArticle, journalArticle.getResourcePrimKey()) /> 
23<#assign relatedAssetTypedLists = buildRelatedAssetTypedLists(entry, "false") /> 
24 
25<#assign jaClassNameId = classNameLocalService.getClassNameId(typeJournalArticle) /> 
26 
27<#assign pdfViewer = '/fu/js/pdfjs/web/viewer.html?zoom=page-fit&file=' /> 
28 
29<#assign serviceContextThreadLocal = staticUtil["com.liferay.portal.service.ServiceContextThreadLocal"] /> 
30<#assign themeDisplay = serviceContextThreadLocal.getServiceContext().getThemeDisplay() /> 
31 
32<#assign carouselNb = 0 /> 
33<#assign anchorNb = 0 /> 
34 
35<#-- ARTICLE CONTAINER --> 
36 
37<div class="interior-article-container"> 
38     
39    <article class="interior-article interior-article-displayed interior-article-displayed-full"> 
40         
41        <section class="interior-article-mainContent"> 
42             
43            <#if relatedAssetTypedLists[typeJournalArticle]?? && relatedAssetTypedLists[typeJournalArticle]?has_content > 
44                <@getTypedRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists type=typeJournalArticle structure="CDA_ZOOM_SUR" /> 
45            </#if> 
46             
47            <h2>${.vars['reserved-article-title'].data}</h2> 
48             
49            <#if Accroche.getData() != ""> 
50                <p class="interior-article-chapo">${Accroche.getData()}</p> 
51            </#if> 
52             
53            <#if Contenu.getSiblings()?has_content> 
54                <#list Contenu.getSiblings() as content> 
55                     
56                    <#assign isAccordion = "" /> 
57                    <#assign isZoomed = content.par_zoom.getData() /> 
58                    <#if isZoomed == "true" > 
59                        <#assign isAccordion = "accordion-paragraph" /> 
60                    </#if> 
61                     
62                    <#assign zoomedParagraph = "" /> 
63                    <#assign isZoomed = content.par_zoom.getData() /> 
64                    <#if isZoomed == "true" > 
65                        <#assign zoomedParagraph = "zoomed-paragraph" /> 
66                    </#if> 
67                     
68                    <#assign floatingMedia = "no-floating-media" /> 
69                    <#assign alignValue = "" /> 
70                    <#assign alignValue = content.Media.alignment.getData() /> 
71                    <#if alignValue == "fLeft" || alignValue == "fRight" > 
72                        <#assign floatingMedia = "floating-media" /> 
73                    <#elseif alignValue == "flexLeft" || alignValue == "flexRight"> 
74                        <#assign floatingMedia = "flex-media" /> 
75                    </#if> 
76                     
77                    <#assign contentTitle = content.content_title.getData() /> 
78                     
79                    <#assign mediaSrc = "" /> 
80                    <#assign urlIframePortlet = "" /> 
81                     
82                    <#if content.Media?? && content.Media?has_content > 
83                        <#assign mediaSrc = content.Media.getData()/> 
84                        <#assign urlIframePortlet = content.Media.url_iframe_portlet.getData() /> 
85                    </#if> 
86                     
87                     
88                    <#if contentTitle!="" || content.getData()!="" || mediaSrc!="" || urlIframePortlet !="" > 
89                         
90                        <div class="interior-article-paragraph ${zoomedParagraph} ${floatingMedia}"> 
91                             
92                            <#assign anchor = '' /> 
93                            <#if content.anchor?has_content> 
94                                <#assign anchor = content.anchor.getData() /> 
95                                <#if anchor != "" > 
96                                    <#assign anchor = 'id="'+anchor+'"' /> 
97                                </#if> 
98                            </#if> 
99                             
100                            <#if contentTitle != '' > 
101                                <#if isAccordion=="accordion-paragraph"> 
102                                    <h3 ${anchor} class="accordion-title accordion-title-expanded"><button type="button" class="accordion-title-button" id="accord-btn-${anchorNb}" aria-controls="accord-sect-${anchorNb}" aria-expanded="true">${contentTitle}</button></h3> 
103                                <#else> 
104                                    <h3 ${anchor}>${contentTitle}</h3> 
105                                </#if> 
106                            </#if> 
107                             
108                            <#if contentTitle != '' && isAccordion=="accordion-paragraph"> 
109                                <div class="accordion-content" role="region" id="accord-sect-${anchorNb}" aria-labelledby="accord-btn-${anchorNb}"> 
110                                <#assign anchorNb = anchorNb + 1 /> 
111                            </#if> 
112                             
113                            <#if floatingMedia == "no-floating-media" > 
114                             
115                                ${content.getData()?replace("<p></p>","")} 
116                                <#if content.Media?? && content.Media?has_content > 
117                                    <@getMedia media=content.Media urlIframePortlet=urlIframePortlet /> 
118                                </#if> 
119                                 
120                            <#elseif floatingMedia == "floating-media"> 
121                             
122                                <#if content.Media?? && content.Media?has_content > 
123                                    <@getMedia media=content.Media urlIframePortlet=urlIframePortlet /> 
124                                </#if> 
125                                ${content.getData()?replace("<p></p>","")} 
126                                <div class="clear-float"></div> 
127                                 
128                             <#elseif floatingMedia == "flex-media"> 
129                              
130                                <div class="flex-display flex-media-paragraph ${alignValue}"> 
131                                    <#if content.Media?? && content.Media?has_content > 
132                                        <@getMedia media=content.Media urlIframePortlet=urlIframePortlet /> 
133                                    </#if> 
134                                    <div class="flex-media-paragraph-content"> 
135                                        ${content.getData()?replace("<p></p>","")} 
136                                    </div> 
137                                </div> 
138                                 
139                            </#if> 
140                             
141                            <#if contentTitle != '' && isAccordion=="accordion-paragraph"> 
142                                </div> 
143                            </#if> 
144                             
145                        </div> 
146                         
147                    </#if> 
148 
149                </#list> 
150            </#if> 
151              
152        </section> 
153         
154        <@getCustomRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists /> 
155         
156    </article> 
157     
158    <footer class="interior-article-footer"> 
159        <ul class="interior-article-footer-items-list"> 
160            <li class="interior-article-footer-item interior-article-profile"><a class="inner-link" href="/tableau-de-bord" title="Gérer mon profil">Mon profil</a></li> 
161        <li class="interior-article-footer-item interior-article-rss"><a class="inner-link" href="/les-flux-rss-de-l-agglo">Les flux RSS de l'agglo</a></li> 
162        <li class="interior-article-footer-item interior-article-print"><button type="button" class="inner-link" title="Imprimer">Imprimer</button></li> 
163        <li class="interior-article-footer-item interior-article-mail"><button type="button" class="inner-link" title="Partager par mail">Partager par mail</button></li> 
164        <li class="interior-article-footer-item interior-article-linkedin"><button type="button" class="inner-link" title="Partager sur LinkedIn">Partager sur LinkedIn</button></li> 
165        <li class="interior-article-footer-item interior-article-twitter"><button type="button" class="inner-link" title="Partager sur Twitter">Partager sur Twitter</button></li> 
166        <li class="interior-article-footer-item interior-article-facebook"><button type="button" class="inner-link" title="Partager sur Facebook">Partager sur Facebook</button></li> 
167        </ul> 
168    </footer> 
169     
170</div> 
171 
172<#-- FOOTER CONTACT --> 
173 
174<footer class="interior-content-footer interior-content-footer-displayed"> 
175     
176    <#if relatedAssetTypedLists[typeJournalArticle]?? && relatedAssetTypedLists[typeJournalArticle]?has_content > 
177        <@getTypedRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists type=typeJournalArticle structure="CDA_CONTACT_SERVICE" /> 
178    <#else> 
179        <@getDefaultFooterContact /> 
180    </#if> 
181 
182</footer> 
183 
184 
185<#--************************************* 
186** MEDIA DISPLAY 
187*************************************--> 
188 
189<#macro getMedia media urlIframePortlet> 
190     
191    <#local mediaSrc = media.getData()/> 
192     
193    <#if mediaSrc != '' || urlIframePortlet != ''> 
194         
195        <#local mediaType = media.media_type.getData() /> 
196        <#assign carouselWrapper = "" /> 
197        <#if mediaType == "carousel"> 
198            <#assign carouselWrapper = "interior-article-media-carousel-wrapper" /> 
199        </#if> 
200        <#local width = media.width.getData() /> 
201        <#local displayWidth = '' /> 
202        <#if width == 'null'> 
203            <#local displayWidth = '' /> 
204        <#elseif width != ""> 
205            <#local displayWidth = 'style="width:'+width+'px;"' /> 
206        </#if> 
207         
208        <#local height = media.height.getData() /> 
209        <#if height == 'null'> 
210            <#local height = '' /> 
211        </#if> 
212        <#local displayMode = media.display_mode.getData() /> 
213        <#local imgMini = media.img_mini.getData() /> 
214        <#local alignment = media.alignment.getData() /> 
215        <#local legend = media.legend.getData() /> 
216        <#local altText = media.alt_text.getData() /> 
217        <#if altText == 'null'> 
218            <#local altText = '' /> 
219        </#if> 
220         
221        <figure class="interior-article-media interior-article-media-${alignment} ${carouselWrapper}" ${displayWidth}> 
222             
223            <#switch mediaType> 
224                <#case "image"> 
225                    <#if displayMode == "normal"> 
226                       <@getImageMedia mediaSrc=mediaSrc urlIframePortlet=urlIframePortlet altText=altText height=height width=width /> 
227                    <#elseif displayMode == "popup"> 
228                        <@getImageMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height width=width /> 
229                    </#if> 
230                    <#break > 
231                <#case "video"> 
232                    <#if displayMode == "normal"> 
233                       <@getVideoMedia imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height width=width /> 
234                    <#elseif displayMode == "popup"> 
235                        <@getVideoMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height width=width /> 
236                    </#if> 
237                    <#break > 
238                <#case "pdf"> 
239                    <#if displayMode == "normal"> 
240                       <@getPdfMedia mediaSrc=mediaSrc altText=altText height=height /> 
241                    <#elseif displayMode == "popup"> 
242                        <@getPdfMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height width=width /> 
243                    </#if> 
244                    <#break > 
245                <#case "iframe"> 
246                    <#if displayMode == "normal"> 
247                       <@getIframeMedia urlIframePortlet=urlIframePortlet altText=altText height=height /> 
248                    <#elseif displayMode == "popup"> 
249                        <@getIframeMediaPopup imgMini=imgMini urlIframePortlet=urlIframePortlet altText=altText height=height width=width /> 
250                    </#if> 
251                    <#break > 
252                <#case "svg"> 
253                    <#if displayMode == "normal"> 
254                       <@getSvgMedia mediaSrc=mediaSrc height=height /> 
255                    <#elseif displayMode == "popup"> 
256                        <@getSvgMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
257                    </#if> 
258                    <#break > 
259                <#case "flash"> 
260                    <#if displayMode == "normal"> 
261                       <@getFlashMedia mediaSrc=mediaSrc height=height /> 
262                    <#elseif displayMode == "popup"> 
263                        <@getFlashMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
264                    </#if> 
265                    <#break > 
266                <#case "portlet"> 
267                    <#if displayMode == "normal"> 
268                       <@getPortletMedia urlIframePortlet=urlIframePortlet height=height /> 
269                    <#elseif displayMode == "popup"> 
270                        <@getPortletMediaPopup imgMini=imgMini urlIframePortlet=urlIframePortlet altText=altText height=height width=width /> 
271                    </#if> 
272                    <#break > 
273                <#case "flickr"> 
274                    <#if displayMode == "normal"> 
275                       <@getFlickrMedia urlIframePortlet=urlIframePortlet /> 
276                    <#elseif displayMode == "popup"> 
277                        <@getFlickrMediaPopup imgMini=imgMini urlIframePortlet=urlIframePortlet altText=altText height=height /> 
278                    </#if> 
279                    <#break > 
280                <#case "gallery"> 
281                    <#if displayMode == "normal"> 
282                       <@getGalleryMedia mediaSrc=mediaSrc height=height /> 
283                    <#elseif displayMode == "popup"> 
284                        <@getGalleryMediaPopup imgMini=imgMini mediaSrc=mediaSrc altText=altText height=height /> 
285                    </#if> 
286                    <#break > 
287                <#case "carousel"> 
288                    <#if displayMode == "normal"> 
289                       <@getCarouselMedia media=media mediaSrc=mediaSrc altText=altText height=height width=width /> 
290                       <#assign carouselNb = carouselNb + 1 /> 
291                    <#elseif displayMode == "popup"> 
292                        <@getCarouselMediaPopup imgMini=imgMini media=media mediaSrc=mediaSrc altText=altText height=height width=width /> 
293                    </#if> 
294                    <#break > 
295                <#case "audio"> 
296                    <@getAudioMedia mediaSrc=mediaSrc altText=altText /> 
297                    <#break > 
298                <#default> 
299            </#switch> 
300             
301            <#local hasLegend = legend?length != 0 /> 
302            <#if hasLegend> 
303                <figcaption class="interior-article-media-legend">${legend}</figcaption> 
304            </#if> 
305             
306        </figure> 
307         
308    </#if> 
309     
310</#macro> 
311 
312 
313<#macro getImageMedia mediaSrc urlIframePortlet altText height width > 
314    <#local displayedHeight = '' /> 
315    <#if height != ""> 
316        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
317    </#if> 
318    <#if urlIframePortlet != ""> 
319        <#assign target = "href='"+ urlIframePortlet +"'" /> 
320        <#if !isInternalLink(urlIframePortlet)> 
321            <#assign target = target + " target='_blank' rel='noopener noreferrer'" /> 
322        </#if> 
323        <a ${target}> 
324    </#if> 
325    <img class="interior-article-media-image" src="${mediaSrc}" alt="${altText}" ${displayedHeight} <#if width!=""> width="${width}"</#if> <#if height!=""> height="${height}"</#if> /> 
326    <#if urlIframePortlet != ""> 
327        </a> 
328    </#if> 
329</#macro> 
330 
331 
332<#macro getImageMediaPopup imgMini mediaSrc altText height width > 
333    <#local displayedHeight = '' /> 
334    <#if height != ""> 
335        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
336    </#if> 
337    <a class="link-img" href="${mediaSrc}" title="${altText}"> 
338        <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} <#if width!=""> width="${width}"</#if> <#if height!=""> height="${height}"</#if> /> 
339    </a> 
340</#macro> 
341 
342 
343<#macro getVideoMedia imgMini mediaSrc height altText width> 
344    <#local displayedHeight = '' /> 
345    <#if height != ""> 
346        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
347    </#if> 
348    <video class="interior-article-media-video" itemprop="url" poster="${imgMini}" title="${htmlUtil.escapeAttribute(altText)}" controls="" preload="auto" ${displayedHeight} <#if width!=""> width="${width}"</#if> <#if height!=""> height="${height}"</#if> > 
349        <source itemprop="url" content="https://www2.larochelle-technopole.fr${mediaSrc}" src="${mediaSrc}" type="video/mp4"> 
350        <a href="${mediaSrc}" download="">${htmlUtil.escapeAttribute(altText)}</a> 
351    </video> 
352</#macro> 
353 
354 
355<#macro getVideoMediaPopup imgMini mediaSrc altText height width > 
356    <#local displayedHeight = '' /> 
357    <#if height != ""> 
358        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
359    </#if> 
360    <a class="link-video" href="${mediaSrc}" title="${altText}"> 
361        <img class="interior-article-media-image" src="/cdalr-new-theme/images/blank.png" data-src="${imgMini}" alt="${htmlUtil.escapeAttribute(altText)}" ${displayedHeight} <#if width!=""> width="${width}"</#if> <#if height!=""> height="${height}"</#if> /> 
362    </a> 
363</#macro> 
364 
365 
366<#macro getAudioMedia mediaSrc altText> 
367    <audio class="interior-article-media-audio" title="${htmlUtil.escapeAttribute(altText)}" alt="${htmlUtil.escapeAttribute(altText)}" controls="" > 
368        <source src="${mediaSrc}" type="audio/mpeg"> 
369        <a href="${mediaSrc}" download="">${htmlUtil.escapeAttribute(altText)}</a> 
370    </audio> 
371</#macro> 
372 
373 
374<#macro getPdfMedia mediaSrc altText height > 
375    <#local displayedHeight = '' /> 
376    <#if height != ""> 
377        <#local displayedHeight = 'style="height:'+height+'px;"' /> 
378    </#if> 
379    <iframe class="interior-article-media-iframe" src="${pdfViewer+mediaSrc}" title="${htmlUtil.escapeAttribute(altText)}" ${displayedHeight} allowfullscreen ></iframe> 
380</#macro> 
381 
382 
383<#macro getPdfMediaPopup imgMini mediaSrc altText height width > 
384    <#local displayedHeight = '' /> 
385    <#if height != ""> 
386        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
387    </#if> 
388    <a class="popup-img-opener" href="${mediaSrc}" title="${htmlUtil.escapeAttribute(altText)}" target="_blank" rel="noopener noreferrer"> 
389        <img class="interior-article-media-image" src="/cdalr-new-theme/images/blank.png" data-src="${imgMini}" alt="${htmlUtil.escapeAttribute(altText)}" ${displayedHeight} <#if width!=""> width="${width}"</#if> <#if height!=""> height="${height}"</#if> /> 
390    </a> 
391</#macro> 
392 
393 
394<#macro getIframeMedia urlIframePortlet altText height > 
395    <#local displayedHeight = '' /> 
396    <#if height != ""> 
397        <#local displayedHeight = 'style="height:'+height+'px;"' /> 
398    </#if> 
399    <#if urlIframePortlet?contains("youtube")> 
400        <#local youtubeId = urlIframePortlet?substring(urlIframePortlet?index_of("embed/")+6) /> 
401        <div class="interior-article-media-youtube-blocker" ${displayedHeight}> 
402            <div class="youtube-blocker-img-wrapper"> 
403                <img class="youtube-blocker-img" src="https://img.youtube.com/vi/${youtubeId}/0.jpg" alt="${htmlUtil.escapeAttribute(altText)}" /> 
404            </div> 
405            <p class="youtube-blocker-text">Cette vidéo est fournie par la plateforme YouTube. En la visionnant vous acceptez les conditions d'utilisation de YouTube.</p> 
406            <div class="youtube-blocker-btn-wrapper"> 
407                <button type="button" class="youtube-blocker-btn" data-src="${urlIframePortlet?replace('youtube.com','youtube-nocookie.com')}?autoplay=1" data-title="${htmlUtil.escapeAttribute(altText)}">Voir la vidéo</button> 
408                <a href="https://www.youtube.com/static?template=terms&gl=FR" class="youtube-blocker-btn" target="_blank" rel="noopener noreferrer">En savoir plus</a> 
409            </div> 
410        </div> 
411    <#else> 
412        <#local scrolling = '' /> 
413        <#if altText == "no-scrolling"> 
414            <#local scrolling = 'scrolling="no"' /> 
415        </#if> 
416        <iframe class="interior-article-media-iframe" data-src="${urlIframePortlet}" title="${htmlUtil.escapeAttribute(altText)}" ${displayedHeight} allowfullscreen ${scrolling} ></iframe> 
417    </#if> 
418</#macro> 
419 
420 
421<#macro getIframeMediaPopup imgMini urlIframePortlet altText height width > 
422    <#local displayedHeight = '' /> 
423    <#if height != ""> 
424        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
425    </#if> 
426    <a class="link-iframe" href="${urlIframePortlet}" target="_blank" rel="noopener noreferrer"> 
427        <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} <#if width!=""> width="${width}"</#if> <#if height!=""> height="${height}"</#if> /> 
428    </a> 
429</#macro> 
430 
431 
432<#macro getSvgMedia mediaSrc height > 
433 
434</#macro> 
435 
436 
437<#macro getSvgMediaPopup imgMini mediaSrc altText height > 
438 
439</#macro> 
440 
441 
442<#macro getFlashMedia mediaSrc height > 
443    <#local displayedHeight = '' /> 
444    <#if height != ""> 
445        <#local displayedHeight = 'style="height:'+height+'px;"' /> 
446    </#if> 
447    <object class="interior-article-media-object" type="application/x-shockwave-flash"  data="${mediaSrc}" ${displayedHeight}></object>  
448</#macro> 
449 
450 
451<#macro getFlashMediaPopup imgMini mediaSrc altText height > 
452    <#local displayedHeight = '' /> 
453    <#if height != ""> 
454        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
455    </#if> 
456    <a class="link-flash" href="${mediaSrc}"> 
457        <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
458    </a> 
459</#macro> 
460 
461 
462<#macro getPortletMedia urlIframePortlet height > 
463     
464    <#local displayedHeight = '' /> 
465    <#if height != ""> 
466        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
467    </#if> 
468     
469    <#local hasInstanceId = urlIframePortlet?contains('INSTANCE') /> 
470    <#local hasQueryString = urlIframePortlet?contains('?') /> 
471    <#local queryString = '' /> 
472    <#local instanceId = '' /> 
473    <#local portletName = urlIframePortlet /> 
474    <#local portletId = urlIframePortlet /> 
475    <#local fullPortletName = '' /> 
476     
477    <#if hasInstanceId> 
478        <#if hasQueryString> 
479            <#local instanceId = urlIframePortlet[(urlIframePortlet?index_of('INSTANCE')+9)..urlIframePortlet?index_of('?')-1] /> 
480        <#else> 
481            <#local instanceId = urlIframePortlet[(urlIframePortlet?index_of('INSTANCE')+9)..] /> 
482        </#if> 
483        <#local portletName = urlIframePortlet[0..(urlIframePortlet?index_of('INSTANCE'))-2] /> 
484    <#else> 
485        <#if hasQueryString> 
486            <#local portletName = urlIframePortlet[0..(urlIframePortlet?index_of('?'))-1] /> 
487        </#if> 
488    </#if> 
489     
490    <#if hasQueryString> 
491        <#local queryString = urlIframePortlet[(urlIframePortlet?index_of('?')+1)..] /> 
492    </#if> 
493     
494    <#if hasInstanceId> 
495        <#local fullPortletName = portletName+'_INSTANCE_'+instanceId /> 
496    <#else> 
497         <#local fullPortletName = portletName /> 
498    </#if> 
499 
500    <#local divId = "embedded-portlet-" + fullPortletName + randomNamespace /> 
501    <#local plid = themeDisplay.plid /> 
502     
503    <#if urlIframePortlet?contains('cdalrEService') || urlIframePortlet?contains('cdalrEservice') || urlIframePortlet?contains('cuCreate')> 
504         
505        <#local queryString = queryString +"&p_l_id="+plid+"&p_p_lifecycle=0&p_p_mode=view&p_p_state=exclusive&currentURL=" + themeDisplay.getURLCurrent() /> 
506 
507        <div id="${divId}" class="embedded-portlet" data-portlet="${fullPortletName}" data-remote-url="" data-querystring="${queryString}" ${displayedHeight}></div> 
508         
509    <#else> 
510         
511        <#local portletURL = portletURLFactory.create(renderRequest, fullPortletName, plid, "RENDER_PHASE") /> 
512        <#local windowState = windowStateFactory.getWindowState("EXCLUSIVE") /> 
513        ${portletURL.setWindowState(windowState)} 
514        <#local remoteUrl = portletURL.toString() + "&" + queryString + "&currentURL=" + themeDisplay.getURLCurrent() /> 
515         
516        <div id="${divId}" class="embedded-portlet" data-portlet="${fullPortletName}" data-remote-url="${remoteUrl}" data-querystring="${queryString}" ${displayedHeight}></div> 
517         
518    </#if> 
519     
520</#macro> 
521 
522 
523<#macro getPortletMediaPopup imgMini urlIframePortlet altText height width > 
524       
525    <#local divId = "embedded-portlet-" + urlIframePortlet /> 
526     
527    <#local displayedHeight = '' /> 
528    <#if height != ""> 
529        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
530    </#if> 
531     
532    <#local hasInstanceId = urlIframePortlet?contains('INSTANCE') /> 
533    <#local hasQueryString = urlIframePortlet?contains('?') /> 
534    <#local portletId = urlIframePortlet /> 
535    <#local queryString = '' /> 
536 
537    <#if hasInstanceId> 
538        <#local portletId = urlIframePortlet[0..(urlIframePortlet?index_of(instanceId))] /> 
539    </#if> 
540    <#if hasQueryString> 
541        <#local portletId = urlIframePortlet[0..(urlIframePortlet?index_of('?')-1)] /> 
542        <#local queryString = urlIframePortlet[(urlIframePortlet?index_of('?')+1)..] /> 
543    </#if> 
544     
545    <#if themeDisplay?? && themeDisplay.plid?? > 
546         
547        <#local plid = themeDisplay.plid /> 
548         
549        <#if urlIframePortlet?contains('cdalrEService') || urlIframePortlet?contains('cdalrEservice') > 
550            <#local queryString = queryString +"&p_l_id="+plid+"&p_p_lifecycle=0&p_p_mode=view&p_p_state=exclusive" /> 
551      
552            <#local formTitle = "" /> 
553            <#local formPictoClass = "" /> 
554            <#if urlIframePortlet?contains('FiberOpticalConnectionRequest')> 
555                <#local formTitle = "Demande d'information pour le raccordement à la fibre optique" /> 
556                <#local formPictoClass = "eservice-form-opener-picto-fiber" /> 
557            <#elseif urlIframePortlet?contains('AntContact')> 
558                <#local formTitle = "Contacter l'aménagement numérique du territoire" /> 
559                <#local formPictoClass = "eservice-form-opener-picto-contact" /> 
560            <#elseif urlIframePortlet?contains('ReinscriptionConservatoire')> 
561                <#local formTitle = "Formulaire de réinscription au conservatoire" /> 
562                <#local formPictoClass = "eservice-form-opener-picto-music" /> 
563            <#elseif urlIframePortlet?contains('ContactUs')> 
564                <#local formTitle = "Contacter l'agglo" /> 
565                <#local formPictoClass = "eservice-form-opener-picto-contact" /> 
566            <#elseif urlIframePortlet?contains('JobApplication')> 
567                <#local formTitle = "Postuler à une offre d'emploi" /> 
568                <#local formPictoClass = "eservice-form-opener-picto-job" /> 
569            <#elseif urlIframePortlet?contains('WastebinRepair')> 
570                <#local formTitle = "Demande de nouveau bac ou de réparation" /> 
571                <#local formPictoClass = "eservice-form-opener-picto-wastebin" /> 
572            <#elseif urlIframePortlet?contains('WastewaterConnection')> 
573                <#local formTitle = "Raccorder ou brancher mon installation au réseau d'eaux usées" /> 
574                <#local formPictoClass = "eservice-form-opener-picto-water" /> 
575            <#elseif urlIframePortlet?contains('WastesortingTour')> 
576                <#local formTitle = "Visiter le centre de tri" /> 
577                <#local formPictoClass = "eservice-form-opener-picto-altriane" /> 
578            </#if> 
579             
580            <div class="link-portlet eservice-form-opener" data-divId="${divId}" data-portlet="${portletId}" data-querystring="${queryString}" data-remote-url="" tabindex="0"> 
581                <div class="eservice-form-opener-picto ${formPictoClass}"></div> 
582                <p class="eservice-form-opener-text">${formTitle}</p> 
583            </div> 
584             
585        <#else> 
586             
587            <#local portletClass = "link-portlet" /> 
588            <#if urlIframePortlet?contains('19_WAR')> 
589                <#local portletClass = "link-portlet planning-cmd-opener" /> 
590            </#if> 
591            <#local remoteUrl = "/c/portal/layout?p_l_id="+plid+"&p_p_id="+portletId+"&p_p_lifecycle=0&p_p_mode=view&p_p_state=exclusive"+queryString /> 
592         
593            <div class="${portletClass}" data-divId="${divId}" data-portlet="${portletId}" data-querystring="${queryString}" data-remote-url="${remoteUrl}" tabindex="0"> 
594                <img class="interior-article-media-image" src="${imgMini}" alt="${altText}" ${displayedHeight} <#if width!=""> width="${width}"</#if> <#if height!=""> height="${height}"</#if> /> 
595            </div> 
596         
597        </#if> 
598         
599    </#if> 
600     
601</#macro> 
602 
603 
604<#macro getFlickrMedia urlIframePortlet > 
605    <div class="interior-article-media-flickr" data-embed-flickr='${urlIframePortlet}'></div> 
606</#macro> 
607 
608 
609<#macro getFlickrMediaPopup imgMini urlIframePortlet altText height > 
610    <#local displayedHeight = '' /> 
611    <#if height != ""> 
612        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
613    </#if> 
614    <div class="link-flickr" data-flickr='${urlIframePortlet}' tabindex="0"> 
615        <img class="interior-article-media-image" src="/cdalr-new-theme/images/blank.png" data-src="${imgMini}" alt="${altText}" ${displayedHeight} /> 
616    </div> 
617</#macro> 
618 
619 
620<#macro getGalleryMedia mediaSrc height > 
621 
622</#macro> 
623 
624 
625<#macro getGalleryMediaPopup imgMini mediaSrc altText height > 
626 
627</#macro> 
628 
629 
630<#macro getCarouselMedia media mediaSrc altText height width >  
631     
632    <#local ratioDisplay = "" /> 
633    <#if height != "" && width != "" > 
634        <#local ratio = height?number / width?number * 100 /> 
635        <#local ratioDisplay = 'style="padding-top:' + ratio + '%"' /> 
636    </#if> 
637     
638    <div class="carousel" id="carousel-${carouselNb}" data-carousel="carousel-${carouselNb}" ${ratioDisplay}> 
639         
640        <button type="button" id="carousel-${carouselNb}-arrow-prev" data-carousel="carousel-${carouselNb}" data-direction="prev" class="carousel-arrow carousel-arrow-prev">Image précédente</button> 
641        <button type="button" id="carousel-${carouselNb}-arrow-next" data-carousel="carousel-${carouselNb}" data-direction="next" class="carousel-arrow carousel-arrow-next">Image suivante</button> 
642 
643        <img id="carousel-${carouselNb}-img-0" data-carousel="carousel-${carouselNb}" data-img="0" class="carousel-img carousel-img-displayed" src="/cdalr-new-theme/images/blank.png" data-src="${mediaSrc}" alt="${altText}"> 
644 
645        <#if media.media_more??> 
646            <#list media.media_more.getSiblings() as node> 
647                <img id="carousel-${carouselNb}-img-${node_index+1}" data-carousel="carousel-${carouselNb}" data-img="${node_index+1}" class="carousel-img carousel-img-noDisplay" src="/cdalr-new-theme/images/blank.png" data-src="${node.getData()}" alt="${altText}"> 
648            </#list> 
649        </#if> 
650 
651    </div> 
652 
653</#macro> 
654 
655 
656<#macro getCarouselMediaPopup imgMini media mediaSrc altText height width > 
657    <#local diapos = mediaSrc /> 
658    <#if media.media_more??> 
659        <#list media.media_more.getSiblings() as node> 
660            <#if node_index != 0> 
661                <#local diapos = diapos + "," /> 
662            </#if> 
663            <#local diapos = diapos + node.getData() /> 
664        </#list> 
665    </#if> 
666    <#local displayedHeight = '' /> 
667    <#if height != ""> 
668        <#local displayedHeight = 'style="max-height:'+height+'px;"' /> 
669    </#if> 
670    <a class="link-diapo popup-img-opener" href="${mediaSrc}" title="${htmlUtil.escapeAttribute(altText)}" data-diapos="${diapos}"> 
671        <img class="interior-article-media-image" src="/cdalr-new/images/blank.png" data-src="${imgMini}" alt="${htmlUtil.escapeAttribute(altText)}" ${displayedHeight} <#if width!=""> width="${width}"</#if> <#if height!=""> height="${height}"</#if> /> 
672    </a> 
673</#macro> 
674 
675 
676<#--************************************* 
677**  RELATED CONTENT 
678*************************************--> 
679 
680<#function buildRelatedAssetTypedLists entry info > 
681    <#assign relatedAssetTypedLists = {} /> 
682    <#assign infos = "" /> 
683    <#assign assetLinks = assetLinkLocalService.getDirectLinks(entry.getEntryId()) /> 
684 
685    <#list assetLinks as assetLink> 
686        <#if assetLink.getEntryId1() == entry.getEntryId() > 
687            <#assign assetLinkEntry = assetEntryLocalService.getEntry(assetLink.getEntryId2()) /> 
688        <#else> 
689            <#assign assetLinkEntry = assetEntryLocalService.getEntry(assetLink.getEntryId1()) /> 
690        </#if> 
691         
692        <#if assetLinkEntry?? && assetLinkEntry.isVisible() > 
693            <#assign linkedAssetRenderer = assetLinkEntry.getAssetRenderer() /> 
694     
695            <#if linkedAssetRenderer.hasViewPermission(permissionChecker) > 
696             
697                <#assign type = assetLinkEntry.getClassName() /> 
698                 
699                <#assign newEntry = [{"assetEntry":assetLinkEntry,"assetLink":assetLink}] /> 
700                <#if relatedAssetTypedLists?keys?seq_contains(type)> 
701                    <#assign relatedAssetTypedList = relatedAssetTypedLists[type] + newEntry /> 
702                <#else> 
703                    <#assign relatedAssetTypedList = newEntry /> 
704                </#if> 
705                <#assign relatedAssetTypedLists = relatedAssetTypedLists + {type : relatedAssetTypedList} /> 
706                <#-- 
707                <#assign infos> 
708                    ${infos} ${type}=${relatedAssetTypedLists[type]?size}  (${newEntry?first.getClassPK()}) <br/> 
709                </#assign> 
710                --> 
711            </#if> 
712        </#if> 
713    </#list> 
714     
715    <#if info == "true"> 
716        <#return infos /> 
717    <#else> 
718        <#return relatedAssetTypedLists /> 
719    </#if> 
720    <#return {} /> 
721</#function> 
722 
723 
724<#macro getCustomRelatedAssets relatedAssetTypedLists> 
725    <#local hasRelatedAssets = "false" /> 
726    <#if relatedAssetTypedLists[typeBookmarksEntry]?? && relatedAssetTypedLists[typeBookmarksEntry]?size != 0> 
727        <#local hasRelatedAssets = "true" /> 
728    </#if> 
729    <#if relatedAssetTypedLists[typeDLFileEntry]?? && relatedAssetTypedLists[typeDLFileEntry]?size != 0> 
730        <#local hasRelatedAssets = "true" /> 
731    </#if> 
732    <#-- 
733    <#if relatedAssetTypedLists[typeJournalArticle]?? && relatedAssetTypedLists[typeJournalArticle]?has_content > 
734        <#local webContentNb = getRelatedWebContentNb(relatedAssetTypedLists[typeJournalArticle]) /> 
735        <#if webContentNb != 0> 
736            <#local hasRelatedAssets = "true" /> 
737        </#if> 
738    </#if> 
739    --> 
740    <#if hasRelatedAssets == "true" > 
741        <aside class="interior-article-moreContent-container"> 
742            <p class="interior-article-moreContent-title">En savoir plus</p> 
743            <#if relatedAssetTypedLists[typeBookmarksEntry]?? && relatedAssetTypedLists[typeBookmarksEntry]?has_content > 
744                <@getTypedRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists type=typeBookmarksEntry structure=""/> 
745            </#if> 
746            <#if relatedAssetTypedLists[typeDLFileEntry]?? && relatedAssetTypedLists[typeDLFileEntry]?has_content > 
747                <@getTypedRelatedAssets relatedAssetTypedLists=relatedAssetTypedLists type=typeDLFileEntry structure="" /> 
748            </#if> 
749        </aside> 
750    </#if> 
751</#macro> 
752 
753 
754<#macro getTypedRelatedAssets relatedAssetTypedLists type structure> 
755    <#if type == typeJournalArticle && structure == "CDA_ZOOM_SUR" > 
756        <@getRelatedZoomSur assets=relatedAssetTypedLists[type] /> 
757    <#elseif type == typeJournalArticle && structure == "CDA_CONTACT_SERVICE" > 
758        <@getRelatedFooterContact assets=relatedAssetTypedLists[type] /> 
759    <#elseif type == typeBookmarksEntry > 
760        <@getRelatedPages assets=relatedAssetTypedLists[type] /> 
761    <#elseif type == typeDLFileEntry > 
762        <@getRelatedDocuments assets=relatedAssetTypedLists[type] /> 
763    </#if> 
764</#macro> 
765 
766 
767<#macro getRelatedZoomSur assets> 
768    <#if assets?size != 0> 
769        <#list assets as assetMap> 
770            <#local asset = assetMap.assetEntry /> 
771            <#local article = journalArticleLocalService.getLatestArticle(asset.getClassPK()) /> 
772            <#assign strucName = journalStructureLocalService.getStructure(article.groupId, jaClassNameId, article.structureId?string, true).getName(locale) /> 
773            <#if strucName == 'CDA_ZOOM_SUR'> 
774                <#local img = getField(article,"back_img")/> 
775                <#local url = getField(article,"url_link")/> 
776                <#local target = "href='"+ url +"'" /> 
777                <#if !isInternalLink(url)> 
778                    <#local target = target + " target='_blank' rel='noopener noreferrer'" /> 
779                </#if> 
780                <div class="article-header-alert"> 
781                    <#if url != ""> 
782                        <a class="inner-link" ${target}> 
783                    </#if> 
784                    <img src="${img}" alt="${asset.getTitleCurrentValue()}"/> 
785                    <h3 class="article-header-alert-title">${asset.getTitleCurrentValue()}</h3> 
786                    <#if url != ""> 
787                        </a> 
788                    </#if> 
789                </div> 
790            </#if> 
791        </#list> 
792    </#if> 
793</#macro> 
794 
795<#macro getRelatedFooterContact assets> 
796    <#if assets?size == 0> 
797        <@getDefaultFooterContact /> 
798    <#else> 
799        <#local hasContactFooter = false /> 
800        <#list assets as assetMap> 
801            <#local asset = assetMap.assetEntry /> 
802            <#local article = journalArticleLocalService.getLatestArticle(asset.getClassPK()) /> 
803            <#assign strucName = journalStructureLocalService.getStructure(article.groupId, jaClassNameId, article.structureId?string, true).getName(locale) /> 
804            <#if strucName == 'CDA_CONTACT_SERVICE'> 
805                <#local contact_service = getField(article,"Contact_service")/> 
806                <#local adresse = getField(article,"Adresse")/> 
807                <#local cp = getField(article,"CP")/> 
808                <#local ville = getField(article,"Ville")/> 
809                <#local telephone = getField(article,"Telephone")/> 
810                <#if telephone==""> 
811                    <#local telephone = "05 46 30 34 00" /> 
812                </#if> 
813                <#local courriel = getField(article,"Courriel")/> 
814                <#local annuaire = getField(article,"annuaire_link")/> 
815                <#if annuaire==""> 
816                    <#local annuaire = "/annuaire-des-services"/> 
817                </#if> 
818                <a class="interior-content-footer-contact interior-content-footer-service" href="${annuaire}"> 
819                    Contact<br/> 
820                    ${asset.getTitle(locale)} 
821                </a> 
822                <p class="interior-content-footer-contact interior-content-footer-address"> 
823                    <span class="interior-content-footer-contact-inner">${adresse}<br/>${cp} ${ville}</span> 
824                </p> 
825                <p class="interior-content-footer-contact interior-content-footer-phone"> 
826                    <span class="interior-content-footer-contact-inner">${telephone}</span> 
827                </p> 
828                <a class="interior-content-footer-contact interior-content-footer-email" href="mailto:${courriel}?subject=Contact%20site%20Agglo"> 
829                    <span class="interior-content-footer-contact-inner">Envoyer un courriel</span> 
830                </a> 
831                <a class="interior-content-footer-annuaire" href="${annuaire}">Annuaire des services</a> 
832                <#local hasContactFooter = true /> 
833                <#break /> 
834            </#if> 
835        </#list> 
836        <#if hasContactFooter == false> 
837            <@getDefaultFooterContact /> 
838        </#if> 
839    </#if> 
840</#macro> 
841 
842 
843<#macro getDefaultFooterContact > 
844    <a class="interior-content-footer-contact interior-content-footer-service" href="/annuaire-des-services"> 
845        Contact<br/> 
846        Agglo La Rochelle 
847    </a> 
848    <p class="interior-content-footer-contact interior-content-footer-address"> 
849        <span class="interior-content-footer-contact-inner">6, rue Saint-Michel<br/>17000 La Rochelle</span> 
850    </p> 
851    <p class="interior-content-footer-contact interior-content-footer-phone"> 
852        <span class="interior-content-footer-contact-inner">05 46 30 34 00</span> 
853    </p> 
854    <a class="interior-content-footer-contact interior-content-footer-email" href="/contacter-l-agglo"> 
855        <span class="interior-content-footer-contact-inner">Envoyer un courriel</span> 
856    </a> 
857    <a class="interior-content-footer-annuaire" href="/annuaire-des-services">Annuaire des services</a> 
858</#macro> 
859 
860 
861<#function getRelatedWebContentNb assets> 
862    <#local nb = 0 /> 
863    <#if assets?size != 0> 
864        <#local nb = 0 /> 
865        <#list assets as assetMap> 
866            <#local asset = assetMap.assetEntry /> 
867            <#local article = journalArticleLocalService.getLatestArticle(asset.getClassPK()) /> 
868            <#assign strucName = journalStructureLocalService.getStructure(article.groupId, jaClassNameId, article.structureId?string, true).getName(locale) /> 
869            <#if strucName != 'CDA_CONTACT_SERVICE' && strucName != 'CDA_ZOOM_SUR'> 
870                <#local nb = nb + 1 /> 
871            </#if> 
872        </#list> 
873    </#if> 
874    <#return nb /> 
875</#function> 
876 
877 
878<#macro getRelatedPages assets> 
879    <ul> 
880        <#local orderedAssets = getOrderedAssets(assets) /> 
881        <#list orderedAssets?reverse as assetMap> 
882            <#local asset = assetMap.assetEntry /> 
883            <#local assetLink = assetMap.assetLink /> 
884            <#local linkedAssetRenderer = asset.getAssetRenderer() /> 
885            <#local assetLinkEntryTitle = asset.getTitle(locale) /> 
886            <#local assetLinkEntryDescription = asset.getDescription() /> 
887            <#local assetLinkBookmark = bookmarksEntryLocalService.getEntry(asset.getClassPK()) /> 
888            <#local assetURL = assetLinkBookmark.getUrl() /> 
889             
890            <#local target = "" /> 
891            <#if assetURL?contains('widget') || assetURL?contains('iframe') || assetURL?contains('embed') > 
892                <#local target = " data-iframe='true' href='"+ assetURL +"' class='link-iframe'" /> 
893            <#else> 
894                <#local target = "href='"+ assetURL +"'" /> 
895                <#if !isInternalLink(assetURL)> 
896                    <#local target = target + " target='_blank' rel='noopener noreferrer'" /> 
897                </#if> 
898            </#if> 
899 
900            <li class="interior-article-moreContent" data-entry-id="${asset.getEntryId()}"><a ${target} title="${htmlUtil.escapeAttribute(assetLinkEntryDescription)}">${assetLinkEntryTitle}</a></li> 
901       </#list> 
902   </ul> 
903</#macro> 
904 
905 
906<#macro getRelatedDocuments assets> 
907     
908    <#assign folderNb = 0 /> 
909    <#local orderedAssets = getOrderedAssets(assets) /> 
910    <#local collapsedFolders = false /> 
911     
912    <#list orderedAssets?reverse as assetMap> 
913     
914        <#local asset = assetMap.assetEntry /> 
915        <#local fileEntry = dlFileEntryLocalService.getFileEntry(asset.getClassPK()) /> 
916 
917        <#local documents = dlFileEntryLocalService.getFileEntries(fileEntry.getGroupId(),fileEntry.getFolderId()) /> 
918        <#local folder = fileEntry.getFolder() /> 
919        <#local folderDescription = folder.getDescription()/> 
920        <#if folderDescription != ""> 
921            <#if documents?size &gt; 5> 
922                <#local collapsedFolders = true /> 
923            </#if> 
924        </#if> 
925    </#list> 
926     
927    <#list orderedAssets?reverse as assetMap> 
928     
929        <#local asset = assetMap.assetEntry /> 
930        <#local fileEntry = dlFileEntryLocalService.getFileEntry(asset.getClassPK()) /> 
931 
932        <#local documents = dlFileEntryLocalService.getFileEntries(fileEntry.getGroupId(),fileEntry.getFolderId()) /> 
933        <#local folder = fileEntry.getFolder() /> 
934        <#local folderDescription = folder.getDescription()/> 
935        <#if folderDescription != ""> 
936            <#if collapsedFolders == true> 
937                <input type="checkbox" class="interior-article-moreContent-checkbox" id="interior-article-moreContent-checkbox-${folderNb}" name="interior-article-moreContent-checkbox-${folderNb}"> 
938                <p class="interior-article-moreContent-title"><label for="interior-article-moreContent-checkbox-${folderNb}">${folderDescription}</label></p> 
939                <#assign folderNb = folderNb + 1 /> 
940            <#else> 
941                <p class="interior-article-moreContent-title">${folderDescription}</p> 
942            </#if> 
943        </#if> 
944         
945        <ul class="interior-article-moreContent-list"> 
946            <#local orderedDocs = getOrderedDocs(documents) /> 
947            <#list orderedDocs?reverse as docEntry> 
948                 
949                <#if !docEntry.isInTrash()> 
950                     
951                    <#local assetDocEntry = assetEntryLocalService.getEntry(docEntry.getGroupId(),docEntry.getUuid()) /> 
952                     
953                    <#if assetDocEntry.getAssetRenderer()??> 
954                     
955                        <#local linkedAssetRenderer = assetDocEntry.getAssetRenderer() /> 
956                         
957                        <#local assetLinkEntryTitle = assetDocEntry.getTitle(locale) /> 
958                        <#local assetLinkEntryDescription = assetDocEntry.getDescription(locale) /> 
959                        <#local extension = docEntry.getLatestFileVersion(true).getExtension() /> 
960                         
961                        <#local assetURL = linkedAssetRenderer.getURLDownload(themeDisplay) /> 
962                         
963                        <#local displaySize = "" /> 
964                        <#local size = docEntry.getLatestFileVersion(true).getSize() /> 
965                        <#if size/1024 < 1024 > 
966                            <#local formatSize = size/1024 /> 
967                            <#local displaySize = formatSize?round?string + " Ko" /> 
968                        <#else> 
969                            <#local formatSize = size/10485.76 /> 
970                            <#local displaySize = (formatSize?round/100)?string + " Mo" /> 
971                        </#if> 
972                         
973                        <#local extensionType = "" /> 
974                        <#switch extension> 
975                            <#case "pdf"> 
976                                <#local extensionType = "link-pdf" /> 
977                                <#break> 
978                            <#case "jpg"> 
979                                <#local extensionType = "link-img" /> 
980                                <#break> 
981                            <#case "png"> 
982                                <#local extensionType = "link-img" /> 
983                                <#break> 
984                            <#case "mp4"> 
985                                <#local extensionType = "link-video" /> 
986                                <#break> 
987                            <#case "swf"> 
988                                <#local extensionType = "link-flash" /> 
989                                <#break> 
990                            <#default> 
991                        </#switch> 
992                        <#assign dlFileEntry = docEntry.getLatestFileVersion(true)/> 
993                         
994                        <#local toDownload = "" /> 
995                        <#if assetLinkEntryTitle?contains("- téléchargement")> 
996                            <#local toDownload = "download" /> 
997                            <#if assetURL?contains("?version")> 
998                                <#local assetURL = assetURL + "&download=true" /> 
999                            <#else> 
1000                                <#local assetURL = assetURL + "?download=true" /> 
1001                            </#if> 
1002                        </#if> 
1003                         
1004                        <#local target = " href='"+ assetURL +"'" /> 
1005                         
1006                        <li class="interior-article-moreContent" data-entry-id="${asset.entryId}"> 
1007                            <a ${target} class="extension-${extension} ${extensionType}" title="${htmlUtil.escapeAttribute(assetLinkEntryDescription)}" ${toDownload} target="_blank" > 
1008                                ${assetLinkEntryTitle} <span class="interior-article-moreContent-extension">${extension}</span> <span class="interior-article-moreContent-doc-weight">${displaySize}</span> <span class="interior-article-moreContent-aria">Ouvrir dans un nouvel onglet</span> 
1009                            </a> 
1010                        </li> 
1011                         
1012                    </#if> 
1013                     
1014                </#if> 
1015                 
1016            </#list> 
1017        </ul> 
1018         
1019    </#list> 
1020     
1021</#macro> 
1022 
1023 
1024<#function getOrderedAssets assets> 
1025    <#local orderedAssets = [] /> 
1026    <#local assetsWithDate = [] /> 
1027    <#list assets as assetMap> 
1028        <#local asset = assetMap.assetEntry /> 
1029        <#local modifiedDate = asset.getModifiedDate() /> 
1030        <#local assetsWithDate = assetsWithDate + [{'assetMap':assetMap,'modifiedDate':modifiedDate}] /> 
1031    </#list> 
1032    <#list assetsWithDate?sort_by('modifiedDate') as orderedAsset> 
1033        <#local orderedAssets = orderedAssets + [orderedAsset.assetMap] /> 
1034    </#list> 
1035    <#return orderedAssets> 
1036</#function> 
1037 
1038<#function getOrderedDocs docs> 
1039    <#local orderedDocs = [] /> 
1040    <#local docsWithDate = [] /> 
1041    <#list docs as docMap> 
1042        <#local doc = assetEntryLocalService.getEntry(docMap.getGroupId(),docMap.getUuid()) /> 
1043        <#local modifiedDate = doc.getModifiedDate() /> 
1044        <#local docsWithDate = docsWithDate + [{'docMap':docMap,'modifiedDate':modifiedDate}] /> 
1045    </#list> 
1046    <#list docsWithDate?sort_by('modifiedDate') as orderedDoc> 
1047        <#local orderedDocs = orderedDocs + [orderedDoc.docMap] /> 
1048    </#list> 
1049    <#return orderedDocs> 
1050</#function> 
1051 
1052 
1053<#function isInternalLink link> 
1054  <#local internal = link?contains(".agglo-larochelle.fr") || !link?contains("//")> 
1055  <#return internal> 
1056</#function> 
1057 
1058 
1059<#function getField journalArticle fieldName> 
1060    <#local fieldValue = ''/> 
1061     <#local document = saxReaderUtil.read(journalArticle.getContent()) /> 
1062     <#local rootElement = document.getRootElement() /> 
1063     <#if (rootElement?? && rootElement?has_content)> 
1064        <#local xPathSelector =  saxReaderUtil.createXPath("dynamic-element[@name='"+fieldName+"']/dynamic-content") /> 
1065        <#if (validator.isNotNull(xPathSelector))> 
1066        <#local nbNodes = xPathSelector.selectNodes(rootElement)?size /> 
1067        <#if (nbNodes &gt; 0)> 
1068            <#local fieldValue = xPathSelector.selectSingleNode(rootElement).getStringValue() /> 
1069        </#if> 
1070     </#if> 
1071     <#return fieldValue /> 
1072     </#if> 
1073</#function>