blob: d91195fc3d56e3a1b86dfa5a9ae9ca0515adf7b2 [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')) {
Nils Diewalda898dac2015-05-06 21:04:16 +000017% $found_text = '> ' . $found_text;
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000018% };
Akron179c8ac2015-06-30 19:30:50 +020019<span id="total-results"><%= $found_text %></span> <%= loc('matchCount', found => $found) %>\
Akronfb6d87d2018-10-24 18:10:20 +020020%# <% if (stash('benchmark')) { %> (~ <%= stash('benchmark') %>)<% } %>
21% } elsif (stash('start_index') == 0 && stash('results')->size == 0) {
Akronb917a7c2015-07-02 11:02:42 +020022<span id="total-results">0</span> <%= loc('matchCount', found => $found) %>\
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000023% };
Akron179c8ac2015-06-30 19:30:50 +020024</p>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000025</div>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000026
Akron27ae9ec2015-06-23 00:43:21 +020027%= include 'query'
Akron9cc3eaf2015-06-10 22:15:52 +020028
Nils Diewald4af3f0b2014-06-25 01:43:17 +000029<div id="search">
Akronfb6d87d2018-10-24 18:10:20 +020030% if (stash('results')->size && stash('total_results') != 0) {
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000031 <ol class="align-left">
32%= search_results begin
33%= include 'match', match => $_
Nils Diewald4af3f0b2014-06-25 01:43:17 +000034% end
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000035 </ol>
Akronfb6d87d2018-10-24 18:10:20 +020036% } elsif (stash('results')->size == 0) {
37<p class="no-results"><%= loc 'noMatches', q => stash('q'), ql => stash('ql') %></p>
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000038% }
Akron4cdc4fc2020-04-28 12:19:11 +020039%= content_for 'after_search_results'
Akron48b1e4d2015-06-17 18:47:01 +020040</div>