Se ha producido un error al procesar la plantilla.
Denied access to method or field theme-display of class org.apache.catalina.core.ApplicationHttpRequest
----
FTL stack trace ("~" means nesting-related):
- Failed at: #if request["theme-display"]?? [in template "44605645827934#20120#37795" at line 9, column 5]
----
1<#if !entries?has_content>
2 <div class="alert alert-info">
3 <@liferay_ui["message"] key="there-are-no-results" />
4 </div>
5</#if>
6
7<#if entries?has_content>
8
9 <#if request['theme-display']??>
10 <#assign timeZone = timeZoneUtil.getTimeZone(request['theme-display']['time-zone'])/>
11 <#else>
12 <#assign timeZone = timeZoneUtil.getDefault()/>
13 </#if>
14
15 <#assign
16 dateFormatOffset = "yyyy-MM-dd"
17 portletId = themeDisplay.getPortletDisplay().getId()
18 />
19
20 <#function getDDMFieldValue content fieldName>
21 <#if content?has_content>
22 <#attempt>
23 <#assign document = staticUtil["com.liferay.portal.kernel.xml.SAXReaderUtil"].read(content) />
24 <#assign node = document.selectSingleNode("//dynamic-element[@name='${fieldName}']/dynamic-content") />
25 <#if node??>
26 <#return node.getText()!>
27 <#else>
28 <#return "">
29 </#if>
30 <#recover>
31 <#return "">
32 </#attempt>
33 <#else>
34 <#return "">
35 </#if>
36 </#function>
37
38 <div id="${portletId}-title-desc-date-paginated-list" class="bip-page-main-content-container ">
39 <ul class="bip-asset-list" style="margin: 0;padding: 0;">
40 <#list entries as curEntry>
41 <#assign
42 entry = curEntry
43 asset_renderer = entry.getAssetRenderer()
44 entry_title = htmlUtil.escape(asset_renderer.getTitle(locale))
45 entry_desc = htmlUtil.escape(asset_renderer.getSummary())
46 view_url = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, asset_renderer, entry, !stringUtil.equals(assetLinkBehavior, "showFullContent"))
47 journal_article = asset_renderer.getAssetObject()
48 article_content = journal_article.getContentByLocale(locale)?default("")
49 field_tresc = getDDMFieldValue(article_content, "Tresc")
50 field_content = getDDMFieldValue(article_content, "content")
51 field_section_title = getDDMFieldValue(article_content, "TytulSekcji")
52 field_panel_text = getDDMFieldValue(article_content, "TrescPanelu")
53 field_data_ogloszenia = getDDMFieldValue(article_content, "DataOgloszenia")
54 />
55 <#assign entry_summary = entry_desc?trim />
56 <#if !entry_summary?has_content>
57 <#assign entry_summary = field_tresc />
58 </#if>
59 <#if !entry_summary?has_content>
60 <#assign entry_summary = field_content />
61 </#if>
62 <#if !entry_summary?has_content>
63 <#assign entry_summary = field_panel_text />
64 </#if>
65 <#if !entry_summary?has_content>
66 <#assign entry_summary = field_section_title />
67 </#if>
68 <li class="bip-asset-list-item bip-card card-effect-hover">
69 <a href="${view_url}" style="width: 100%;height: 100%;">
70 <div class="bip-card-title-bar chevron-adorned">
71 <h2 class="h3-style">
72 ${entry_title}
73 </h2>
74 </div>
75
76 <#if entry_summary?has_content>
77 <p>
78 ${entry_summary?replace("<[^>]+>", "", "r")?trim?truncate_w(250, '...')}
79 </p>
80 </#if>
81
82 <p class="bip-asset-list-item-date">
83 <span class="bip-asset-list-item-date-label">
84 Data udostępnienia:
85 </span>
86 <span>
87 <#-- field_data_ogloszenia output disabled:
88 <#if field_data_ogloszenia?? && field_data_ogloszenia != "">
89 ${field_data_ogloszenia}
90 <#else> -->
91 ${journal_article.getStatusDate()?string[dateFormatOffset]}
92 <#-- </#if> -->
93 </span>
94 </p>
95 <p class="bip-asset-list-item-date">
96 <span class="bip-asset-list-item-date-label">
97 Liczba wyświetleń:
98 </span>
99 ${entry.getViewCount()}
100 </span>
101 </p>
102 </a>
103 </li>
104 </#list>
105 </ul>
106
107 <style>
108 #${portletId}-title-desc-date-paginated-list .bip-pagination {
109 align-items: center;
110 box-sizing: border-box;
111 display: flex !important;
112 flex-wrap: wrap;
113 gap: 8px;
114 justify-content: center;
115 max-width: 100%;
116 overflow: visible;
117 width: 100%;
118 }
119
120 #${portletId}-title-desc-date-paginated-list .bip-pagination .webcontent-search-pagination-page-input {
121 background-color: #fff;
122 border: 1px solid var(--grey-900);
123 box-sizing: border-box;
124 color: var(--grey-950);
125 max-width: 100%;
126 width: 140px;
127 }
128
129 #${portletId}-title-desc-date-paginated-list .bip-pagination .webcontent-search-pagination-page-input::placeholder {
130 color: var(--grey-900);
131 opacity: 1;
132 }
133
134 #${portletId}-title-desc-date-paginated-list .bip-pagination .webcontent-search-pagination-go-to-page-btn {
135 background-color: var(--primary-blue-700);
136 border: 1px solid var(--primary-blue-700);
137 border-radius: 8px;
138 color: #fff;
139 min-height: 40px;
140 padding: 8px 16px;
141 }
142
143 #${portletId}-title-desc-date-paginated-list .bip-pagination .webcontent-search-pagination-btn[aria-disabled="true"] {
144 cursor: not-allowed;
145 display: flex !important;
146 }
147
148 #${portletId}-title-desc-date-paginated-list .bip-pagination :is(button, input):focus-visible {
149 outline: 3px solid currentColor;
150 outline-offset: 3px;
151 }
152
153 #${portletId}-title-desc-date-paginated-list .bip-pagination button:disabled {
154 opacity: 1;
155 }
156
157 #${portletId}-title-desc-date-paginated-list .bip-pagination .webcontent-search-pagination-arrows {
158 align-items: center;
159 display: flex;
160 gap: 8px;
161 justify-content: center;
162 }
163
164 #${portletId}-title-desc-date-paginated-list .bip-pagination .webcontent-search-pagination-go-to-page {
165 align-items: center;
166 display: flex;
167 flex-basis: 100%;
168 gap: 8px;
169 justify-content: center;
170 }
171
172 @media (max-width: 420px) {
173 #${portletId}-title-desc-date-paginated-list .bip-pagination {
174 gap: 6px;
175 }
176
177 #${portletId}-title-desc-date-paginated-list .bip-pagination .webcontent-search-pagination-page-text {
178 flex-basis: 100%;
179 order: -1;
180 text-align: center;
181 }
182
183 #${portletId}-title-desc-date-paginated-list .bip-pagination .webcontent-search-pagination-page-input {
184 flex: 1 1 120px;
185 min-width: 0;
186 }
187 }
188 </style>
189
190 <div class="webcontent-search-bottom-bar" style="margin-top: 20px; margin-bottom: 32px;">
191 <div class="pagination-container bip-pagination" role="navigation" aria-label="Paginacja listy artykułów"></div>
192 </div>
193 </div>
194
195 <script>
196 Liferay.on("allPortletsReady", function () {
197 var pagination = document.querySelector(".taglib-page-iterator");
198 var paginationContainer = document.querySelector("#${portletId}-title-desc-date-paginated-list .pagination-container");
199
200 if (paginationContainer && pagination) {
201 pagination.style.display = "none";
202 var paginationText = "";
203 var currentPageText = document.querySelector(".current-page-menu .lfr-icon-menu-text");
204 if (currentPageText) {
205 paginationText = getPagesPaginationText(currentPageText.textContent).trim();
206 }
207 var firstPageLink = document.querySelector(".lfr-pagination-buttons.pagination .page-item.first a");
208 var paginationControls = document.querySelectorAll(".lfr-pagination-buttons.pagination .page-item:not(.first):not(.last) a");
209 var lastPageLink = document.querySelector(".lfr-pagination-buttons.pagination .page-item.last a");
210
211 if (paginationText && paginationControls.length > 1) {
212 var pagesContainer = document.createElement("div");
213 pagesContainer.classList.add("webcontent-search-pagination-page-text");
214 pagesContainer.setAttribute("aria-live", "polite");
215 pagesContainer.setAttribute("aria-atomic", "true");
216 pagesContainer.textContent = paginationText;
217
218 var firstPagBtn = document.createElement("button");
219 firstPagBtn.classList.add("webcontent-search-pagination-btn", "first-btn");
220 firstPagBtn.setAttribute("type", "button");
221 firstPagBtn.setAttribute("aria-label", "Pierwsza strona");
222 var firstHref = firstPageLink ? firstPageLink.href : null;
223 firstPagBtn.addEventListener("click", function (e) {
224 handleButtonClick(e, firstHref);
225 });
226 var isFirstPage = checkIfIsFirstLastPage(paginationText);
227 firstPagBtn.disabled = isFirstPage;
228 firstPagBtn.setAttribute("aria-disabled", String(isFirstPage));
229 var btnImgFirst = document.createElement("span");
230 firstPagBtn.append(btnImgFirst);
231
232 var prevPagBtn = document.createElement("button");
233 prevPagBtn.classList.add("webcontent-search-pagination-btn", "prev-btn");
234 prevPagBtn.setAttribute("type", "button");
235 prevPagBtn.setAttribute("aria-label", "Poprzednia strona");
236
237 function handleButtonClick(e, href) {
238 e.preventDefault();
239 if (href) {
240 window.location.href = href;
241 }
242 }
243 var prevHref = paginationControls.item(0) ? paginationControls.item(0).href : null;
244 prevPagBtn.addEventListener("click", function (e) {
245 handleButtonClick(e, prevHref);
246 });
247 prevPagBtn.disabled = isFirstPage;
248 prevPagBtn.setAttribute("aria-disabled", String(isFirstPage));
249 var btnImg = document.createElement("span");
250 prevPagBtn.append(btnImg);
251
252 var nxtPagBtn = document.createElement("button");
253 nxtPagBtn.setAttribute("aria-label", "Następna strona");
254 nxtPagBtn.classList.add("webcontent-search-pagination-btn", "next-btn");
255 nxtPagBtn.setAttribute("type", "button");
256 var nextHref = paginationControls.item(1) ? paginationControls.item(1).href : null;
257 nxtPagBtn.addEventListener("click", function (e) {
258 handleButtonClick(e, nextHref);
259 });
260 var isLastPage = checkIfIsFirstLastPage(paginationText, "last");
261 nxtPagBtn.disabled = isLastPage;
262 nxtPagBtn.setAttribute("aria-disabled", String(isLastPage));
263 var btnImg2 = document.createElement("span");
264 nxtPagBtn.append(btnImg2);
265
266 var lastPagBtn = document.createElement("button");
267 lastPagBtn.setAttribute("aria-label", "Ostatnia strona");
268 lastPagBtn.classList.add("webcontent-search-pagination-btn", "last-btn");
269 lastPagBtn.setAttribute("type", "button");
270 var lastHref = lastPageLink ? lastPageLink.href : null;
271 lastPagBtn.addEventListener("click", function (e) {
272 handleButtonClick(e, lastHref);
273 });
274 lastPagBtn.disabled = isLastPage;
275 lastPagBtn.setAttribute("aria-disabled", String(isLastPage));
276 var btnImgLast = document.createElement("span");
277 lastPagBtn.append(btnImgLast);
278
279 var pageNumberInput = document.createElement("input");
280 pageNumberInput.classList.add("webcontent-search-pagination-page-input");
281 pageNumberInput.setAttribute("type", "number");
282 pageNumberInput.setAttribute("min", "1");
283 pageNumberInput.setAttribute("max", getLastNumber(paginationText));
284 pageNumberInput.value = getFirstNumber(paginationText);
285 pageNumberInput.setAttribute("aria-label", "Numer strony");
286 pageNumberInput.setAttribute("placeholder", "Numer strony");
287
288 var goToPageBtn = document.createElement("button");
289 goToPageBtn.classList.add("webcontent-search-pagination-go-to-page-btn");
290 goToPageBtn.setAttribute("type", "button");
291 goToPageBtn.textContent = "Przejdź";
292
293 function goToPage() {
294 var pageNumber = parseInt(pageNumberInput.value, 10);
295 var lastPageNumber = parseInt(getLastNumber(paginationText), 10);
296 var pageUrlSource = nextHref || firstHref || lastHref;
297
298 if (!pageNumber || pageNumber < 1 || pageNumber > lastPageNumber || !pageUrlSource) {
299 pageNumberInput.setCustomValidity("Wpisz numer strony od 1 do " + lastPageNumber + ".");
300 pageNumberInput.reportValidity();
301 return;
302 }
303
304 pageNumberInput.setCustomValidity("");
305 var pageUrl = new URL(pageUrlSource, window.location.href);
306 var currentPageNumber = parseInt(getFirstNumber(paginationText), 10);
307 var pageParameter = Array.from(pageUrl.searchParams.keys()).find(function (key) {
308 return /(?:^|_)cur$/i.test(key) || /(?:^|_)page$/i.test(key) || /(?:^|_)strona$/i.test(key);
309 });
310
311 if (!pageParameter) {
312 pageParameter = Array.from(pageUrl.searchParams.keys()).find(function (key) {
313 var value = parseInt(pageUrl.searchParams.get(key), 10);
314 return value === currentPageNumber + 1 || value === currentPageNumber - 1;
315 });
316 }
317
318 if (pageParameter) {
319 pageUrl.searchParams.set(pageParameter, pageNumber);
320 window.location.href = pageUrl.toString();
321 }
322 }
323
324 goToPageBtn.addEventListener("click", goToPage);
325 pageNumberInput.addEventListener("keydown", function (e) {
326 if (e.key === "Enter") {
327 goToPage();
328 }
329 });
330
331 var arrowsGroupStart = document.createElement("div");
332 arrowsGroupStart.classList.add("webcontent-search-pagination-arrows");
333 arrowsGroupStart.append(firstPagBtn, prevPagBtn);
334
335 var arrowsGroupEnd = document.createElement("div");
336 arrowsGroupEnd.classList.add("webcontent-search-pagination-arrows");
337 arrowsGroupEnd.append(nxtPagBtn, lastPagBtn);
338
339 var goToPageGroup = document.createElement("div");
340 goToPageGroup.classList.add("webcontent-search-pagination-go-to-page");
341 goToPageGroup.append(pageNumberInput, goToPageBtn);
342
343 paginationContainer.append(arrowsGroupStart, pagesContainer, arrowsGroupEnd, goToPageGroup);
344 }
345 }
346
347 function checkIfIsFirstLastPage(paginationPageText, type="first") {
348 if (typeof paginationPageText !== "string") {
349 return false;
350 }
351
352 if (type === "first") {
353 return getFirstNumber(paginationPageText) === "1";
354 }
355
356 if (type === "last") {
357 return getFirstNumber(paginationPageText) === getLastNumber(paginationPageText);
358 }
359
360 return false;
361 }
362
363 function getPagesPaginationText(string) {
364 if (typeof string !== "string") {
365 return "";
366 }
367
368 for (var i=0; i<string.length; i++) {
369 if (!isNaN(string.charAt(i)) && !isNaN(parseFloat(string.charAt(i)))) {
370 return string.slice(i);
371 }
372 }
373 return string;
374 }
375
376 function getFirstNumber(string) {
377 if (typeof string !== "string") {
378 return "-1";
379 }
380
381 var curNum = "";
382
383 for (var i=0; i<string.length; i++) {
384 if (!isNaN(string.charAt(i)) && !isNaN(parseFloat(string.charAt(i)))) {
385 curNum += string.charAt(i);
386 } else {
387 return curNum;
388 }
389 }
390
391 return "-1";
392 }
393
394 function getLastNumber(string) {
395 if (typeof string !== "string") {
396 return "-1";
397 }
398 var curNum = "";
399
400 for (var i=string.length-1; i>=0; i--) {
401 if (!isNaN(string.charAt(i)) && !isNaN(parseFloat(string.charAt(i)))) {
402 curNum += string.charAt(i);
403 } else {
404 return curNum.split("").reverse().join("");
405 }
406 }
407
408 return "-1";
409 }
410 });
411 </script>
412</#if>