Eventos
Eventos
AGENDA / inscrições
An error occurred while processing the template.
The following has evaluated to null or missing: ==> xPathSelector.selectSingleNode( root ) [in template "34764#34807#41107" at line 25, column 18] ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #return xPathSelector.selectSingleNod... [in template "34764#34807#41107" in function "getSingleNode" at line 25, column 9] ----
1<#-- file path: default-theme/assets/agenda-inscricoes/palestras.ftl -->
2
3<#setting locale=locale.toString()>
4
5<#assign prefix = "bioec-agenda-inscricoes" />
6<#assign image404 = "https://via.placeholder.com/300x300?text=404" />
7<#assign dlAppService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService")>
8<#assign categoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") >
9<#assign tagsLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetTagLocalService") >
10
11
12<#function getRootElement curEntry>
13 <#assign assetRenderer = curEntry.getAssetRenderer() />
14 <#assign article = assetRenderer.getArticle() />
15 <#assign document = saxReaderUtil.read(article.getContent()) />
16 <#return { "root": document.getRootElement(), "article": article } />
17</#function>
18
19<#function getSingleNode name root>
20 <#attempt>
21 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='${name}']/dynamic-content[@language-id='${locale}']") />
22 <#return xPathSelector.selectSingleNode( root ).getStringValue()?trim />
23 <#recover>
24 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='${name}']") />
25 <#return xPathSelector.selectSingleNode( root ).getStringValue()?trim />
26 </#recover>
27</#function>
28
29<#macro getUrlImage imageString article>
30 <#attempt>
31 <#assign fileJson = jsonFactoryUtil.createJSONObject(imageString) />
32 <#assign fileEntryId = getterUtil.getInteger(fileJson.get('fileEntryId')) />
33 <#assign fileEntry = dlAppService.getFileEntry(fileEntryId) />
34 <#assign adaptive = "/o/adaptive-media/image/${fileEntryId}/Thumbnail-300x300/${fileJson.get('title')}">
35 <#assign urlImage = themeDisplay.getPortalURL() + "/documents/" + fileEntry.groupId + "/" + fileEntry.uuid + "?t=" + .now?string["HHmmssSSS"]?string />
36 <#recover>
37 <#assign adaptive = image404 />
38 <#assign urlImage = image404 />
39 <#assign fileEntryId = "" />
40 </#recover>
41
42 <style>
43 .${prefix}__image{
44 width:100%;
45 background: url(${urlImage!image404}) no-repeat;
46 background-size:cover;
47 background-position: center center;
48 //max-height: 354px;
49 //min-height: 319px;
50 aspect-ratio: 600/390;
51 }
52
53 .lfr-pagination{
54 display:none;
55 }
56 </style>
57
58 <picture data-fileentryid="${fileEntryId}">
59 <source srcset="${adaptive!image404}" />
60 <a href="/web/guest/w/${article.getUrlTitle()}">
61 <img class="${prefix}__image" data-fileentryid="${fileEntryId}" src="${urlImage!image404}" />
62 </a>
63 </picture>
64</#macro>
65
66<style>
67 .${prefix}__title{
68 font-style: normal;
69 font-weight: var(--font-weight-bold);
70 font-size: 18px;
71 line-height: 30px;
72 text-transform: uppercase;
73 font-feature-settings: 'cpsp' on;
74 color: #000000;
75 cursor:pointer;
76 }
77 .${prefix}__title:hover{
78 text-decoration:underline;
79 }
80 .${prefix}-container{
81 display: grid;
82 grid-column-gap: 50px;
83 grid-template-columns: auto;
84 }
85
86 @media(min-width:1025px){
87 .${prefix}-container{
88 grid-template-columns: repeat(3, minmax(0, 1fr));
89 }
90 }
91
92 .${prefix}-item__date{
93 position:absolute;
94 bottom:0px;
95 right:0px;
96 background-color:#000;
97 display:flex;
98 flex-direction:column;
99 align-items:center;
100 justify-content:center;
101 padding: 15px;
102 }
103
104 .${prefix}-item__date span:first-child{
105 border-bottom: 1px solid #fff;
106 width: 100%;
107 }
108
109 .${prefix}-item__date span{
110 font-style: normal;
111 font-weight: var(--font-weight-normal);
112 font-size: 16px;
113 text-align: center;
114 color: #FFFFFF;
115 }
116
117 .${prefix}-image-container {
118 position: relative;
119 cursor: pointer !important;
120 }
121
122 .${prefix}-image-container:hover {
123 filter: brightness(60%);
124 }
125</style>
126
127<div class="${prefix}">
128 <#if entries?has_content>
129 <div class="${prefix}-container">
130 <#list entries as entry>
131 <#assign element = getRootElement(entry) />
132 <#assign article = element.article />
133
134 <#assign title = getSingleNode("Text67325905", element.root) />
135 <#assign image = getSingleNode("Image46086326", element.root) />
136 <#assign date = getSingleNode("Date03245611", element.root) />
137 <#assign day = date?date("yyyy-MM-dd")?string("dd") />
138 <#assign month = date?date("yyyy-MM-dd")?string("MMM") />
139
140 <#assign categoryIds = categoryLocalService.getCategoryIds("com.liferay.journal.model.JournalArticle", article.getResourcePrimKey()?number ) >
141 <#assign tags = tagsLocalService.getTags("com.liferay.journal.model.JournalArticle", article.getResourcePrimKey()?number ) >
142
143 <div class="${prefix}-item mb-4 mt-5 d-flex flex-column">
144 <div class="${prefix}-image-container">
145 <div class="${prefix}-item__date">
146 <span>${day}</span>
147 <span>${month}</span>
148 </div>
149 <@getUrlImage image article/>
150 </div>
151
152 <div style="max-width:490px;">
153 <@renderLabelsPath categoryIds tags date />
154 <h1 onclick="javascript:window.location='/web/guest/w/${article.getUrlTitle()}'" class="${prefix}__title mb-3 mt-3">${title}</h1>
155 </div>
156 </div>
157 </#list>
158 </div>
159
160 <div class="d-flex justify-content-center mb-5 mt-5">
161 <@makePagination />
162 </div>
163 </#if>
164</div>
165
166
167<#macro makePagination>
168 <#assign searchContainer = renderRequest.getAttribute("ASSET_PUBLISHER_DISPLAY_CONTEXT").getSearchContainer()/>
169 <#assign total = searchContainer.getTotal() />
170 <#assign start = searchContainer.getStart() />
171 <#assign delta = searchContainer.getDelta() />
172 <#assign totalPages = (total/delta)?ceiling />
173 <#assign currentPage = ((start+1)/delta)?ceiling />
174
175
176 <style>
177 .custom-pagination--page{
178 border: 2px solid #99a9b5;
179 margin: 0 8px;
180 width: 30px;
181 height: 30px;
182 line-height: 26px;
183 text-align: center;
184 display: inline-block;
185 color: #99a9b5;
186 background-color: #ffffff;
187 text-decoration: none;
188 }
189 .custom-pagination--page:hover{
190 border-color: #00bcd4;
191 background-color: #00bcd4;
192 text-decoration:none;
193 color: #ffffff;
194 }
195 .custom-pagination--active{
196 border-color: #3c3950 !important;
197 background-color: #3c3950 !important;
198 color: #ffffff !important;
199 }
200 </style>
201
202 <#if totalPages gt 1 >
203 <div class="pagination-container">
204 <#list 1..totalPages as page>
205 <#assign iteratorURL = searchContainer.getIteratorURL() />
206 ${iteratorURL.setParameter("cur", "${page}")}
207 <#assign URL = iteratorURL.toString() />
208
209 <a href="${URL}" class="custom-pagination--page ${ (page == currentPage)?string('custom-pagination--active', '') }">${page}</a>
210 </#list>
211 </div>
212 </#if>
213</#macro>
214
215
216
217<#macro renderLabelsPath categoryIds tags createDate>
218 <style>
219 .custom-breadcrumb-highlights__date{
220 font-style: normal;
221 font-weight: var(--font-weight-light);
222 font-size: 11px;
223 line-height: 30px;
224 color: #4F4E4E;
225 }
226 .custom-breadcrumb-highlights__category{
227 font-style: normal;
228 font-weight: var(--font-weight-bold);
229 font-size: 11px;
230 line-height: 30px;
231 color: #000;
232 text-transform: uppercase;
233 }
234 .custom-breadcrumb-highlights__date:after{
235 content:"/";
236 font-weight: var(--font-weight-light);
237 font-size: 11px;
238 color: #4F4E4E;
239 margin-left:5px;
240 margin-right:5px;
241 }
242 .custom-breadcrumb-highlights__tag{
243 padding: 4px;
244 border: 1px solid #000000;
245 border-radius: 20px;
246 font-style: normal;
247 font-weight: var(--font-weight-light);
248 font-size: 11px;
249 color: #000000;
250 text-transform:uppercase;
251 vertical-align:middle;
252 }
253 .custom-breadcrumb-highlights__tag:hover{
254 text-decoration:none;
255 color: #000000;
256 }
257 </style>
258
259 <#assign category = "">
260 <#if categoryIds?has_content>
261 <#list categoryIds as categoryId>
262 <#assign category = categoryLocalService.getCategory( categoryId?number ) >
263 <#assign category = category.name >
264 </#list>
265 </#if>
266
267
268 <div class="custom-breadcrumb-highlights mb-3 mt-3">
269 <span class="custom-breadcrumb-highlights__date">${createDate?date("yyyy-MM-dd")?string("dd MMM, yyyy")}</span>
270 <span class="custom-breadcrumb-highlights__category">${category}</span>
271 </div>
272</#macro>
— 12 Items per Page