Infraestrutura
Infraestrutura
Título da Página
An error occurred while processing the template.
Can't convert this string to number: "2&delta=10&star=19" The blamed expression: ==> paginaAtual?number [in template "34764#34807#41136" at line 144, column 66] ---- FTL stack trace ("~" means nesting-related): - Failed at: paginaDaFrente = paginaAtual?number + 1 [in template "34764#34807#41136" at line 144, column 49] ----
1<#assign
2 mbMessageLocalService = serviceLocator.findService("com.liferay.message.boards.service.MBMessageLocalService")
3 JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
4 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
5 tagsLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetTagLocalService")
6>
7
8<#assign UserLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.UserLocalService") >
9<#assign
10 isSignedIn = themeDisplay.isSignedIn()
11/>
12
13<div class="my-3">
14<div class="search-total-label d-none">
15 <div style="font-size: 20px; font-weight: 700;">Resultados da busca</div>
16 ${searchContainer.getTotal()} resultados <#if searchResultsPortletDisplayContext.getKeywords() != ""> para "${searchResultsPortletDisplayContext.getKeywords()}" </#if>
17</div>
18<#if entries?has_content>
19 <#list entries as entry>
20 <#if entry.getClassName()?? && entry.getClassName() == "com.liferay.journal.model.JournalArticle">
21 <#assign journalArticle = JournalArticleLocalService.getLatestArticle(entry.getClassPK()) >
22 <#assign
23 url = themeDisplay.getURLPortal() + "/w/" + journalArticle.getUrlTitle()
24
25 articleXml = journalArticle.getDocument().getRootElement()
26
27 nome = articleXml.selectSingleNode("dynamic-element[@field-reference='Text06930927']").getStringValue()!""
28 imagem = articleXml.selectSingleNode("dynamic-element[@field-reference='CampoDeTexto02890219']").getStringValue()!""
29 modelo = articleXml.selectSingleNode("dynamic-element[@field-reference='Text57816561']").getStringValue()!""
30 marca = articleXml.selectSingleNode("dynamic-element[@field-reference='Text23707291']").getStringValue()!""
31 autorId = articleXml.selectSingleNode("dynamic-element[@field-reference='Text93109394']").getStringValue()!""
32 autorId = autorId?replace("\n\t\t", "")
33 autorId = autorId?replace("\n\t", "")
34 autorArticleId = ""
35
36 publishDate = journalArticle.getDisplayDate()?string('dd/MM/yyyy')
37
38 commentsCount = mbMessageLocalService.getDiscussionMessagesCount(entry.getClassName(), entry.getClassPK(), 0)!"0"
39 >
40 <#if autorId != "" && autorId??>
41 <#assign
42 autor = UserLocalService.fetchUser(autorId?number)!""
43 autorArticleId = autor.getExpandoBridge().getAttribute("journal-article")!"0"
44 />
45 <#if autor != "">
46 <#assign autor = autor.getFullName()!"">
47 <#else>
48 <#assign autor = "Portal de Bioeconomia" >
49 </#if>
50 <#else>
51 <#assign autor = "Portal de Bioeconomia" >
52 </#if>
53
54
55 <#assign urlWC = "">
56 <#if autorArticleId != "0">
57 <#if JournalArticleLocalService.fetchLatestArticle(themeDisplay.getLayout().getGroupId()?number, autorArticleId?string, 3)?? >
58 <#assign autorArticle = JournalArticleLocalService.fetchLatestArticle(themeDisplay.getLayout().getGroupId()?number, autorArticleId?string, 3) >
59 <#assign
60 urlWC = autorArticle.getUrlTitle()!""
61 >
62 </#if>
63 </#if>
64
65 <#assign tags = tagsLocalService.getTagNames("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()?number )
66 tagName = tags[0]!""
67 >
68
69 <#if tagName?contains("organization") && tagName != "" >
70
71 <#assign
72 orgId = tagName?keep_after("organization-")
73 organization = OrganizationLocalService.fetchOrganization(orgId?number)!""
74 >
75
76 <#if organization != "" && autor!= "Portal de Bioeconomia">
77 <#if organization.getExpandoBridge().getAttribute("journal-article")??>
78 <#assign orgArticleId = organization.getExpandoBridge().getAttribute("journal-article")
79 orgJournalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),orgArticleId?c)!""
80 urlWC = orgJournalArticle.getUrlTitle()!""
81 autor = organization.getName()!""
82 >
83 </#if>
84 </#if>
85 </#if>
86
87 <div class="bioec_infra_container">
88 <div class="bioec_infra_card_top">
89 <div class="d-md-block d-none">
90 <#if imagem?trim !="" >
91 <div class="bioec_infra_img">
92 <img src="${imagem}" alt="imagem" width="100%"/>
93 </div>
94 <#else>
95 <div class="bioec_infra_img_placeholder">
96 <i class="fa-solid fa-image"></i>
97 sem imagem
98 </div>
99 </#if>
100 </div>
101 <div class="bioec_infra_content">
102 <div class="bioec_infra_title">${nome}</div>
103 <div>Modelo: ${modelo}</div>
104 <div>Marca: ${marca}</div>
105 </div>
106 <div class="d-md-none my-4">
107 <#if imagem?trim != "" >
108 <div class="bioec_infra_img">
109 <img src="${imagem}" alt="image" width="100%"/>
110 </div>
111 <#else>
112 <div class="bioec_infra_img_placeholder">
113 <i class="fa-solid fa-image"></i>
114 sem imagem
115 </div>
116 </#if>
117 </div>
118 <#if !isSignedIn >
119 <a href="/acessar" class="bioec_secondary_button">
120 CADASTRE-SE PARA VER MAIS
121 </a>
122 <#else>
123 <a href="${url}" class="bioec_secondary_button">
124 VER MAIS
125 </a>
126 </#if>
127 </div>
128 <div class="bioec_infra_card_bottom">
129 <div class="d-md-block d-none">${publishDate} <span>| ${commentsCount} comentários</span> <#if isSignedIn && autor != "" > | Publicado por <#if urlWC != ''><a href="/w/${urlWC}"></#if>${autor}<#if urlWC != ''></a></#if></#if></div>
130 <div class="d-md-none bioec_infra_card_bottom_mob">
131 <span> ${commentsCount} comentários</span>
132 <span>${publishDate} <#if isSignedIn && autor != "" > | Publicado por <#if urlWC != ''><a href="/w/${urlWC}"></#if>${autor}<#if urlWC != ''></a></#if></#if></span>
133 </div>
134
135 </div>
136 </div>
137 </#if>
138 </#list>
139
140 <#if themeDisplay.getURLCurrent()?contains("start=") >
141 <#assign paginaAtual = themeDisplay.getURLCurrent()?keep_after("start=")
142 urlAtual = themeDisplay.getURLPortal() + themeDisplay.getURLCurrent()
143 urlAtual = urlAtual?keep_before(paginaAtual)
144 paginaDaFrente = paginaAtual?number + 1
145 paginaDeTras = paginaAtual?number - 1
146 urlFrente = urlAtual + paginaDaFrente
147 urlTras = ""
148 >
149
150 <#if paginaDeTras gt 0>
151 <#assign urlTras = urlAtual + paginaDeTras >
152 </#if>
153 <#else>
154 <#assign
155 urlTras = ""
156 urlFrente = themeDisplay.getURLCurrent() + "?delta=10&start=2"
157 >
158 </#if>
159 <div class="mobile-pagination-container">
160 <a <#if urlTras != ""> href="${urlTras}" </#if> class="page-link custom-page-arrow-button simple-left"></a>
161 <button class="active dropdown page-item" style="background-color:transparent; border:none;">
162 <a class="dropdown-toggle page-link" data-toggle="liferay-dropdown" href="javascript:;" aria-expanded="false" style="width: unset;" >
163 <span id="mobile-pagination-current-page">1</span> <i class="fa-solid fa-chevron-down"></i>
164 </a>
165 <div class="dropdown-menu dropdown-menu-top-center">
166 <ul class="inline-scroller link-list" id="mobile-pagination-dropdown">
167 </ul>
168 </div>
169 </button>
170 <div id="mobile-pagination-page-count">de 1</div>
171 <a href="${urlFrente}" id="passarAdiante" class="page-link custom-page-arrow-button simple-right"></a>
172 </div>
173
174</#if>
175</div>
176
177<style>
178.bioec_infra_container {
179 border: 1px solid #BEBEBE;
180 padding: 24px;
181 margin-top: 40px;
182}
183
184.bioec_infra_card_top {
185 display: flex;
186 flex-direction: row;
187 align-items: center;
188 justify-content: space-between;
189 margin-bottom: 24px;
190 flex-wrap: wrap;
191}
192
193.bioec_infra_title {
194 font-weight: 700;
195 font-size: 16px;
196 line-height: 150%;
197 color: #5B5C61;
198 margin-bottom: 12px;
199}
200
201.bioec_secondary_button {
202 font-style: normal;
203 font-weight: 700;
204 font-size: 16px;
205 line-height: 150%;
206 color: #333244; /* roxo escuro */
207 display: inline-flex;
208 flex-direction: row;
209 justify-content: center;
210 align-items: center;
211 padding: 8px 24px;
212 border: 1px solid #4ECD66;
213 background-color: transparent;
214 border-radius: 8px;
215 text-decoration: none;
216 white-space: nowrap;
217}
218
219.bioec_secondary_button:hover {
220 text-decoration: underline;
221 color: inherit;
222}
223
224.bioec_infra_content {
225 font-size: 16px;
226 font-weight: 400;
227 line-height: 150%;
228 color: #5B5C61;
229 flex: 1;
230 margin-left: 30px;
231 margin-right: 15px;
232}
233
234.bioec_infra_card_bottom {
235 margin-top: 24px;
236 border-top: 1px solid #E8ECEF;
237 padding-top: 12px;
238 display: flex;
239 flex-direction: row;
240 align-items: center;
241 justify-content: space-between;
242 font-weight: 300;
243 font-size: 14px;
244 line-height: 150%;
245 color: #5B5C61;
246}
247
248.bioec_infra_card_bottom a{
249 color: #5B5C61;
250 text-decoration: underline;
251}
252
253.bioec_infra_card_bottom a:hover{
254 color: #5B5C61;
255 text-decoration: underline;
256}
257
258.bioec_infra_compartilhar {
259 color: #5B5C61;
260 text-decoration: none;
261}
262
263.bioec_infra_compartilhar:hover {
264 text-decoration: underline;
265 color: inherit;
266}
267
268.bioec_infra_img {
269 max-width: 140px;
270 max-height: 140px;
271 overflow: hidden;
272 width: 100%;
273}
274
275.bioec_infra_img_placeholder {
276 width: 140px;
277 height: 140px;
278 background-color: #E8ECEF;
279 display: flex;
280 flex-direction: column;
281 align-items: center;
282 justify-content: center;
283 font-size: 14px;
284 color: #5B5C61;
285}
286
287.bioec_infra_img_placeholder i {
288 font-size: 44px;
289}
290
291@media (max-width: 767px) {
292 .bioec_infra_card_bottom {
293 flex-direction: column-reverse;
294 align-items: flex-start;
295 }
296
297 .bioec_infra_card_bottom_mobile {
298 display: flex;
299 justify-content: space-between;
300 width: 100%;
301 }
302
303 .bioec_infra_card_top {
304 flex-direction: column;
305 }
306
307 .bioec_infra_content {
308 margin: 0;
309 width: 100%;
310 }
311
312 .bioec_infra_card_bottom_mob{
313 display: flex;
314 flex-direction: column;
315 align-items: flex-start;
316 gap: 8px;
317 }
318}
319</style>
320
321<style>
322.pagination, .pagination-items-per-page, .pagination-results {
323 display: none;
324}
325
326.pagination:has(li:nth-child(6)) {
327 display: flex;
328 margin: 24px auto;
329}
330
331.page-item.active .page-link, .page-item.show .page-link {
332 border: none;
333 background-color: #E8ECEF;
334 color: #5B5C61;
335 border-radius: 4px;
336}
337
338.page-link {
339 color: #5B5C61;
340 font-size: 16px;
341 font-weight: 700;
342 line-height: 1.25;
343 text-align: center;
344 border: none;
345 width: 32px;
346 height: 32px;
347}
348
349.page-link:hover {
350 border: none;
351 background-color: #E8ECEF;
352 color: #5B5C61;
353 border-radius: 4px;
354}
355
356.page-link:focus {
357 border: none;
358 box-shadow: none;
359}
360
361.page-item:first-child .page-link, .page-link-first,
362.page-item:last-child .page-link, .page-link-last {
363 border-radius: 4px;
364}
365
366.custom-page-arrow-button {
367 background-image: url('data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16px" height="16px" viewBox="0 0 16 16" version="1.1"><g id="surface1"><path style=" stroke:none;fill-rule:nonzero;fill:rgb(35.686275%,36.078431%,38.039216%);fill-opacity:1;" d="M 5.019531 7.394531 L 12.496094 0.453125 C 12.855469 0.117188 13.441406 0.117188 13.800781 0.453125 L 14.671875 1.261719 C 15.03125 1.597656 15.03125 2.136719 14.675781 2.472656 L 8.75 8 L 14.671875 13.527344 C 15.03125 13.863281 15.03125 14.402344 14.671875 14.738281 L 13.800781 15.546875 C 13.441406 15.882812 12.855469 15.882812 12.496094 15.546875 L 5.019531 8.605469 C 4.660156 8.269531 4.660156 7.726562 5.019531 7.394531 Z M 5.019531 7.394531 "/><path style=" stroke:none;fill-rule:nonzero;fill:rgb(35.686275%,36.078431%,38.039216%);fill-opacity:1;" d="M 0.617188 0 L 2.460938 0 C 2.800781 0 3.078125 0.253906 3.078125 0.570312 L 3.078125 15.429688 C 3.078125 15.746094 2.800781 16 2.460938 16 L 0.617188 16 C 0.277344 16 0 15.746094 0 15.429688 L 0 0.570312 C 0 0.253906 0.277344 0 0.617188 0 Z M 0.617188 0 "/></g></svg>');
368 display: block;
369 width: 32px;
370 height: 32px;
371 background-position: center;
372 background-size: 16px 16px;
373 background-repeat: no-repeat;
374}
375
376.custom-page-arrow-button.right {
377 background-image: url('data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16px" height="16px" viewBox="0 0 16 16" version="1.1"><g id="surface1"><path style=" stroke:none;fill-rule:nonzero;fill:rgb(35.686275%,36.078431%,38.039216%);fill-opacity:1;" d="M 5.019531 7.394531 L 12.496094 0.453125 C 12.855469 0.117188 13.441406 0.117188 13.800781 0.453125 L 14.671875 1.261719 C 15.03125 1.597656 15.03125 2.136719 14.675781 2.472656 L 8.75 8 L 14.671875 13.527344 C 15.03125 13.863281 15.03125 14.402344 14.671875 14.738281 L 13.800781 15.546875 C 13.441406 15.882812 12.855469 15.882812 12.496094 15.546875 L 5.019531 8.605469 C 4.660156 8.269531 4.660156 7.726562 5.019531 7.394531 Z M 5.019531 7.394531 "/><path style=" stroke:none;fill-rule:nonzero;fill:rgb(35.686275%,36.078431%,38.039216%);fill-opacity:1;" d="M 0.617188 0 L 2.460938 0 C 2.800781 0 3.078125 0.253906 3.078125 0.570312 L 3.078125 15.429688 C 3.078125 15.746094 2.800781 16 2.460938 16 L 0.617188 16 C 0.277344 16 0 15.746094 0 15.429688 L 0 0.570312 C 0 0.253906 0.277344 0 0.617188 0 Z M 0.617188 0 "/></g></svg>');
378 transform: rotate(180deg);
379 /* background-image: url('data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16px" height="16px" viewBox="0 0 16 16" version="1.1"><g id="surface1"><path style=" stroke:none;fill-rule:nonzero;fill:rgb(35.686275%,36.078431%,38.039216%);fill-opacity:1;" d="M 9.921875 8.53125 L 3.847656 14.605469 C 3.554688 14.894531 3.078125 14.894531 2.789062 14.605469 L 2.078125 13.894531 C 1.785156 13.601562 1.785156 13.128906 2.078125 12.835938 L 6.890625 8 L 2.078125 3.164062 C 1.785156 2.871094 1.785156 2.398438 2.078125 2.105469 L 2.789062 1.394531 C 3.082031 1.105469 3.554688 1.105469 3.847656 1.394531 L 9.921875 7.46875 C 10.214844 7.761719 10.214844 8.238281 9.921875 8.53125 Z M 9.921875 8.53125 "/><path style=" stroke:none;fill-rule:nonzero;fill:rgb(35.686275%,36.078431%,38.039216%);fill-opacity:1;" d="M 13.5 15 L 12 15 C 11.722656 15 11.5 14.777344 11.5 14.5 L 11.5 1.5 C 11.5 1.222656 11.722656 1 12 1 L 13.5 1 C 13.777344 1 14 1.222656 14 1.5 L 14 14.5 C 14 14.777344 13.777344 15 13.5 15 Z M 13.5 15 "/></g></svg>')
380 */
381}
382
383.custom-page-arrow-button.simple-left {
384 background-image: url('data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16px" height="16px" viewBox="0 0 16 16" version="1.1"><g id="surface1"><path style=" stroke:none;fill-rule:nonzero;fill:rgb(35.686275%,36.078431%,38.039216%);fill-opacity:1;" d="M 4.078125 7.46875 L 10.152344 1.398438 C 10.445312 1.105469 10.921875 1.105469 11.210938 1.398438 L 11.921875 2.105469 C 12.214844 2.398438 12.214844 2.871094 11.921875 3.164062 L 7.109375 8 L 11.921875 12.835938 C 12.214844 13.128906 12.214844 13.601562 11.921875 13.894531 L 11.210938 14.605469 C 10.917969 14.898438 10.445312 14.898438 10.152344 14.605469 L 4.078125 8.53125 C 3.785156 8.238281 3.785156 7.761719 4.078125 7.46875 Z M 4.078125 7.46875 "/></g></svg>');
385
386
387}
388
389.custom-page-arrow-button.simple-right {
390 background-image: url('data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16px" height="16px" viewBox="0 0 16 16" version="1.1"><g id="surface1"><path style=" stroke:none;fill-rule:nonzero;fill:rgb(35.686275%,36.078431%,38.039216%);fill-opacity:1;" d="M 4.078125 7.46875 L 10.152344 1.398438 C 10.445312 1.105469 10.921875 1.105469 11.210938 1.398438 L 11.921875 2.105469 C 12.214844 2.398438 12.214844 2.871094 11.921875 3.164062 L 7.109375 8 L 11.921875 12.835938 C 12.214844 13.128906 12.214844 13.601562 11.921875 13.894531 L 11.210938 14.605469 C 10.917969 14.898438 10.445312 14.898438 10.152344 14.605469 L 4.078125 8.53125 C 3.785156 8.238281 3.785156 7.761719 4.078125 7.46875 Z M 4.078125 7.46875 "/></g></svg>');
391 transform: rotate(180deg);
392}
393
394.mobile-pagination-container {
395 display: none;
396 flex-direction: row;
397 align-items: center;
398 justify-content: center;
399 margin: 24px auto;
400}
401
402#mobile-pagination-page-count {
403 color: #5B5C61;
404 font-size: 16px;
405 font-weight: 700;
406 line-height: 1.25;
407}
408
409@media (max-width: 767px) {
410 .mobile-pagination-container {
411 display: flex;
412 }
413
414 .pagination {
415 display: none !important;
416 }
417}
418</style>
419
420<script>
421 function addArrows(){
422 console.log("addArrows");
423 const paginationContainer = document.querySelector("ul.pagination")
424
425 const firstArrow = paginationContainer.children[1].cloneNode(true)
426 const backArrow = paginationContainer.children[0]
427 const lastArrow = paginationContainer.children[paginationContainer.children.length - 2].cloneNode(true)
428 const nextArrow = paginationContainer.children[paginationContainer.children.length - 1]
429
430 firstArrow.children[0].textContent = ""
431 firstArrow.children[0].classList.add("custom-page-arrow-button");
432
433 lastArrow.children[0].textContent = ""
434 lastArrow.children[0].classList.add("custom-page-arrow-button");
435
436 lastArrow.children[0].classList.add("right");
437
438 paginationContainer.insertBefore(firstArrow, paginationContainer.firstChild);
439 paginationContainer.appendChild(lastArrow)
440
441 backArrow.children[0].innerHTML = "";
442 backArrow.children[0].classList.add("custom-page-arrow-button");
443 backArrow.children[0].classList.add("simple-left");
444 nextArrow.children[0].innerHTML = "";
445 nextArrow.children[0].classList.add("custom-page-arrow-button");
446 nextArrow.children[0].classList.add("simple-right");
447 }
448 function fixWeirdItem() {
449 try {
450 const weirdItem = document.querySelector("ul.pagination > li:not([class]) > a")
451 weirdItem.classList.add("page-link")
452 } catch {}
453 }
454
455 function getStartParam(href) {
456 const url = new URL(href);
457 const searchParams = new URLSearchParams(url.search);
458 const start = searchParams.get('start')
459 return start || 1;
460 }
461
462 function mobilePagination() {
463 try {
464 const paginationContainer = document.querySelector("ul.pagination");
465 const lastPageButton = paginationContainer.children[paginationContainer.children.length - 2];
466
467 const pageCount = getStartParam(lastPageButton.children[0].href);
468 document.getElementById("mobile-pagination-page-count").textContent = "de " + pageCount;
469
470 if(pageCount < 2) throw "no pagination"
471
472 const currentPage = getStartParam(window.location.href);
473 document.getElementById("mobile-pagination-current-page").textContent = currentPage;
474
475 const mobileDropdown = document.getElementById("mobile-pagination-dropdown");
476 const pathname = window.location.pathname
477
478 let dropdownItems = ""
479 for (let i = 1; i <= pageCount; ++i) {
480 dropdownItems += '<li> <a class="dropdown-item" href="' + pathname + '?delta=10&start='+i+'">' + i + '</a> </li> '
481 }
482
483 mobileDropdown.innerHTML = dropdownItems;
484 } catch {
485 document.getElementsByClassName("mobile-pagination-container")[0].classList.add("d-none");
486 }
487 }
488 setTimeout(() => mobilePagination(), 900)
489 setTimeout(() => fixWeirdItem(), 1000)
490 setTimeout(() => addArrows(), 1100)
491</script>