1<#assign
2 keywords= htmlUtil.escape(searchResultsPortletDisplayContext.getKeywords())
3
4 curParam = searchContainer.getCurParam()
5 currentPage = searchContainer.getCur()
6 searchTotal = searchContainer.getTotal()
7 totalItems = (searchTotal < 100)?then(searchTotal, 100)
8 pageSize = searchContainer.getDelta()
9 totalPages = ((totalItems + pageSize - 1) / pageSize)?int
10
11 iteratorURL = searchContainer.getIteratorURL()
12/>
13
14
15<#if entries?has_content>
16 <div class="mb-10">
17 <h3 class="display-md"><@liferay.language key="search-keyword-for"/> “${keywords}”</h3>
18 <p class="text-secondary-paragraph">
19 ${totalItems} <@liferay.language key="results-found"/>
20 </p>
21 </div>
22
23 <#list entries as entry>
24 <span class="badge bg-gray-50 text-dark fw-500 border py-1.5 mb-3">${entry.getModelResource()}</span>
25
26 <a href="${entry.getViewURL()}" class="dl-link link-default fs-md fw-500 d-block">${entry.getHighlightedTitle()}</a>
27 <#if entry.isContentVisible()><p class="fs-sm text-secondary-paragraph mt-3">${entry.getContent()}</p></#if>
28 <#if entry.isCreationDateVisible()><p class="fs-sm text-secondary-paragraph mt-3">${entry.getCreationDateString()}</p></#if>
29
30 <hr class="my-6 border-secondary">
31 </#list>
32 <#else>
33 <h5 class="text-primary-paragraph text-center my-14"><@liferay.language key="no-results-found" /></h5>
34</#if>
35
36<#-- Pagination -->
37<#if totalPages gt 1>
38
39 <#assign
40 isFirstPage = currentPage == 1
41 isLastPage = currentPage == totalPages
42 previousStart = (currentPage - 1
43 nextStart = currentPage + 1
44 />
45
46 <#macro pageUrl start>
47 ${iteratorURL}&${curParam}=${start}
48 </#macro>
49
50 <nav class="pagination-bar" aria-label="Pagination">
51 <ul class="pagination">
52
53 <#-- Previous -->
54 <li class="page-item${isFirstPage?then(' disabled', '')}">
55 <#if isFirstPage>
56 <button
57 class="page-link"
58 type="button"
59 disabled
60 aria-label="Previous page"
61 >
62 <i class="dl-chevron-left-icon"></i>
63 </button>
64 <#else>
65 <a
66 class="page-link"
67 href="<@pageUrl previousStart />"
68 aria-label="Previous page"
69 >
70 <i class="dl-chevron-left-icon"></i>
71 </a>
72 </#if>
73 </li>
74
75 <#-- Pages -->
76 <#list 1..totalPages as page>
77 <#assign
78 isCurrentPage = page == currentPage
79 />
80
81 <li class="page-item${isCurrentPage?then(' active', '')}">
82 <#if isCurrentPage>
83 <span
84 class="page-link"
85 aria-current="page"
86 >
87 ${page}
88 </span>
89 <#else>
90 <a
91 class="page-link"
92 href="<@pageUrl page />"
93 aria-label="Page ${page}"
94 >
95 ${page}
96 </a>
97 </#if>
98 </li>
99 </#list>
100
101 <#-- Next -->
102 <li class="page-item${isLastPage?then(' disabled', '')}">
103 <#if isLastPage>
104 <button
105 class="page-link"
106 type="button"
107 disabled
108 aria-label="Next page"
109 >
110 <i class="dl-chevron-right-icon"></i>
111 </button>
112 <#else>
113 <a
114 class="page-link"
115 href="<@pageUrl nextStart />"
116 aria-label="Next page"
117 >
118 <i class="dl-chevron-right-icon"></i>
119 </a>
120 </#if>
121 </li>
122
123 </ul>
124 </nav>
125
126</#if>