blob: 58a8f384c2a0061e44d4c841149c4ef9b2be80d9 [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
Nils Diewald4af3f0b2014-06-25 01:43:17 +000027<div id="search">
Akronfb6d87d2018-10-24 18:10:20 +020028% if (stash('results')->size && stash('total_results') != 0) {
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000029 <ol class="align-left">
30%= search_results begin
31%= include 'match', match => $_
Nils Diewald4af3f0b2014-06-25 01:43:17 +000032% end
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000033 </ol>
Akronfb6d87d2018-10-24 18:10:20 +020034% } elsif (stash('results')->size == 0) {
35<p class="no-results"><%= loc 'noMatches', q => stash('q'), ql => stash('ql') %></p>
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000036% }
Akron4cdc4fc2020-04-28 12:19:11 +020037%= content_for 'after_search_results'
Akron48b1e4d2015-06-17 18:47:01 +020038</div>