blob: d912abe318cc69c4a512d88e2a7fb76814bfbd02 [file] [log] [blame]
Akron3c390c42020-03-30 09:06:21 +02001% layout 'main', schematype => 'SearchResultsPage';
Akronc23ce662021-12-14 12:39:42 +01002% my $numf = sub { return loc('numf', number => $_[0]) };
Nils Diewaldfccfbcb2015-04-29 20:48:19 +00003
Akron26d57f22021-09-10 16:48:57 +02004<div id="pagination"
5 class="button-group button-panel"
6 data-page="<%= stash('start_page') %>"
7 data-total="<%= stash('total_pages') %>"
8 data-count="<%= stash('items_per_page') %>"
Akronc23ce662021-12-14 12:39:42 +01009 ><%= pagination(stash('start_page'), stash('total_pages'), url_with->query({'p' => '{page}'}), { num_format => $numf }) =%></div>
Akron9bd140e2021-07-27 16:20:03 +020010
Akronfb6d87d2018-10-24 18:10:20 +020011<div id="resultinfo" <% if (stash('results')->size) { %> class="found"<%} %>>
Akronfb6d87d2018-10-24 18:10:20 +020012% my $found = stash('total_results') // 0;
Akronb917a7c2015-07-02 11:02:42 +020013 <p class="found">\
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000014% if ($found != -1) {
Nils Diewalda898dac2015-05-06 21:04:16 +000015% my $found_text = loc('numf', number => $found);
Akronfb6d87d2018-10-24 18:10:20 +020016% if (stash('time_exceeded')) {
Akron68751462025-07-04 11:39:55 +020017% $found_text = '<span title="' . $c->loc('moreMatches_long') . '">' .
18% $c->loc('moreMatches') . '</span> ' . $found_text;
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000019% };
Akron68751462025-07-04 11:39:55 +020020<span id="total-results"><%== $found_text %></span> <%= loc('matchCount', found => $found) %>\
Akronfb6d87d2018-10-24 18:10:20 +020021%# <% if (stash('benchmark')) { %> (~ <%= stash('benchmark') %>)<% } %>
22% } elsif (stash('start_index') == 0 && stash('results')->size == 0) {
Akronb917a7c2015-07-02 11:02:42 +020023<span id="total-results">0</span> <%= loc('matchCount', found => $found) %>\
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000024% };
Akron179c8ac2015-06-30 19:30:50 +020025</p>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000026</div>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000027
Nils Diewald4af3f0b2014-06-25 01:43:17 +000028<div id="search">
Akronfb6d87d2018-10-24 18:10:20 +020029% if (stash('results')->size && stash('total_results') != 0) {
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000030 <ol class="align-left">
31%= search_results begin
32%= include 'match', match => $_
Nils Diewald4af3f0b2014-06-25 01:43:17 +000033% end
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000034 </ol>
Akronfb6d87d2018-10-24 18:10:20 +020035% } elsif (stash('results')->size == 0) {
36<p class="no-results"><%= loc 'noMatches', q => stash('q'), ql => stash('ql') %></p>
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000037% }
Akron4cdc4fc2020-04-28 12:19:11 +020038%= content_for 'after_search_results'
Akron48b1e4d2015-06-17 18:47:01 +020039</div>