blob: 20353d0e1551cc07e8e21170da9db86eec51021f [file] [log] [blame]
Nils Diewald0ec142f2015-05-05 00:29:23 +00001% layout 'main', title => loc('searchtitle', q => search->query, ql => search->query_language);
Akron9cc3eaf2015-06-10 22:15:52 +02002% use Mojo::JSON 'encode_json';
Nils Diewaldfccfbcb2015-04-29 20:48:19 +00003
4<div class="resultinfo">
Nils Diewalda898dac2015-05-06 21:04:16 +00005 <div id="pagination"><%= pagination(search->start_page, search->total_pages, url_with->query(['p' => '{page}'])) =%></div>
Nils Diewaldfccfbcb2015-04-29 20:48:19 +00006
Nils Diewald8f4b5da2014-12-03 22:13:39 +00007% my $found = search->total_results;
Nils Diewaldfccfbcb2015-04-29 20:48:19 +00008% if ($found != -1) {
Nils Diewalda898dac2015-05-06 21:04:16 +00009% my $found_text = loc('numf', number => $found);
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000010% if (search->time_exceeded) {
Nils Diewalda898dac2015-05-06 21:04:16 +000011% $found_text = '> ' . $found_text;
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000012% };
13 <p class="found"><span id="total-results"><%= $found_text %></span> <%= loc('matchCount', found => $found) %></p>
Nils Diewalda898dac2015-05-06 21:04:16 +000014%# <% if (search->benchmark) { %> (~ <%= search->benchmark %>)<% } %>
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000015% } else {
16 <p></p>
17% };
Nils Diewald5d1ffb42014-05-21 17:45:34 +000018</div>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000019
Akron9cc3eaf2015-06-10 22:15:52 +020020% if (search->collection_jsonld) {
21%= javascript begin
22KorAP.currentVC = <%== encode_json search->collection_jsonld %>;
23% end
24% };
25
26
Nils Diewald8f4b5da2014-12-03 22:13:39 +000027% if (search->total_results != 0 && search->results->size) {
Nils Diewald4af3f0b2014-06-25 01:43:17 +000028<div id="search">
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>
34</div>
Nils Diewalda898dac2015-05-06 21:04:16 +000035% } else {
36<p id="no-results"><%== loc 'noMatches', q => search->query %></p>
Nils Diewaldfccfbcb2015-04-29 20:48:19 +000037% }
Nils Diewald845282c2015-05-14 07:53:03 +000038
39%= include 'query'