Nils Diewald | 0ec142f | 2015-05-05 00:29:23 +0000 | [diff] [blame] | 1 | % layout 'main', title => loc('searchtitle', q => search->query, ql => search->query_language); |
Akron | 9cc3eaf | 2015-06-10 22:15:52 +0200 | [diff] [blame] | 2 | % use Mojo::JSON 'encode_json'; |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 3 | |
| 4 | <div class="resultinfo"> |
Nils Diewald | a898dac | 2015-05-06 21:04:16 +0000 | [diff] [blame] | 5 | <div id="pagination"><%= pagination(search->start_page, search->total_pages, url_with->query(['p' => '{page}'])) =%></div> |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 6 | |
Nils Diewald | 8f4b5da | 2014-12-03 22:13:39 +0000 | [diff] [blame] | 7 | % my $found = search->total_results; |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 8 | % if ($found != -1) { |
Nils Diewald | a898dac | 2015-05-06 21:04:16 +0000 | [diff] [blame] | 9 | % my $found_text = loc('numf', number => $found); |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 10 | % if (search->time_exceeded) { |
Nils Diewald | a898dac | 2015-05-06 21:04:16 +0000 | [diff] [blame] | 11 | % $found_text = '> ' . $found_text; |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 12 | % }; |
| 13 | <p class="found"><span id="total-results"><%= $found_text %></span> <%= loc('matchCount', found => $found) %></p> |
Nils Diewald | a898dac | 2015-05-06 21:04:16 +0000 | [diff] [blame] | 14 | %# <% if (search->benchmark) { %> (~ <%= search->benchmark %>)<% } %> |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 15 | % } else { |
| 16 | <p></p> |
| 17 | % }; |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 18 | </div> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 19 | |
Akron | 9cc3eaf | 2015-06-10 22:15:52 +0200 | [diff] [blame] | 20 | % if (search->collection_jsonld) { |
| 21 | %= javascript begin |
| 22 | KorAP.currentVC = <%== encode_json search->collection_jsonld %>; |
| 23 | % end |
| 24 | % }; |
| 25 | |
| 26 | |
Nils Diewald | 8f4b5da | 2014-12-03 22:13:39 +0000 | [diff] [blame] | 27 | % if (search->total_results != 0 && search->results->size) { |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 28 | <div id="search"> |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 29 | <ol class="align-left"> |
| 30 | %= search_results begin |
| 31 | %= include 'match', match => $_ |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 32 | % end |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 33 | </ol> |
| 34 | </div> |
Nils Diewald | a898dac | 2015-05-06 21:04:16 +0000 | [diff] [blame] | 35 | % } else { |
| 36 | <p id="no-results"><%== loc 'noMatches', q => search->query %></p> |
Nils Diewald | fccfbcb | 2015-04-29 20:48:19 +0000 | [diff] [blame] | 37 | % } |
Nils Diewald | 845282c | 2015-05-14 07:53:03 +0000 | [diff] [blame] | 38 | |
| 39 | %= include 'query' |