Akron | 0e1ed24 | 2018-10-11 13:22:00 +0200 | [diff] [blame] | 1 | % layout 'main', title => loc('searchtitle', q => stash('q'), ql => stash('ql')), schematype => 'SearchResultsPage'; |
Akron | 8ea8429 | 2018-10-24 13:41:52 +0200 | [diff] [blame^] | 2 | |
Akron | 3239663 | 2018-10-11 17:08:37 +0200 | [diff] [blame] | 3 | <div id="resultinfo" <% if (stash('results')->size) { %> class="found"<%} %>> |
Akron | 0e1ed24 | 2018-10-11 13:22:00 +0200 | [diff] [blame] | 4 | <div id="pagination"><%= pagination(stash('start_page'), stash('total_pages'), url_with->query(['p' => '{page}'])) =%></div> |
Akron | 7093b81 | 2018-10-19 17:28:21 +0200 | [diff] [blame] | 5 | % my $found = stash('total_results') // 0; |
Akron | 0e1ed24 | 2018-10-11 13:22:00 +0200 | [diff] [blame] | 6 | <p class="found">\ |
| 7 | % if ($found != -1) { |
| 8 | % my $found_text = loc('numf', number => $found); |
| 9 | % if (stash('time_exceeded')) { |
| 10 | % $found_text = '> ' . $found_text; |
| 11 | % }; |
| 12 | <span id="total-results"><%= $found_text %></span> <%= loc('matchCount', found => $found) %>\ |
| 13 | %# <% if (stash('benchmark')) { %> (~ <%= stash('benchmark') %>)<% } %> |
Akron | 3239663 | 2018-10-11 17:08:37 +0200 | [diff] [blame] | 14 | % } elsif (stash('start_index') == 0 && stash('results')->size == 0) { |
Akron | 0e1ed24 | 2018-10-11 13:22:00 +0200 | [diff] [blame] | 15 | <span id="total-results">0</span> <%= loc('matchCount', found => $found) %>\ |
| 16 | % }; |
| 17 | </p> |
| 18 | </div> |
| 19 | |
| 20 | %= include 'query2' |
| 21 | |
| 22 | <div id="search"> |
Akron | 7093b81 | 2018-10-19 17:28:21 +0200 | [diff] [blame] | 23 | % if (stash('results')->size && stash('total_results') != 0) { |
Akron | 0e1ed24 | 2018-10-11 13:22:00 +0200 | [diff] [blame] | 24 | <ol class="align-left"> |
Akron | 7093b81 | 2018-10-19 17:28:21 +0200 | [diff] [blame] | 25 | %= search_results2 begin |
Akron | 0e1ed24 | 2018-10-11 13:22:00 +0200 | [diff] [blame] | 26 | %= include 'match', match => $_ |
| 27 | % end |
| 28 | </ol> |
Akron | 3239663 | 2018-10-11 17:08:37 +0200 | [diff] [blame] | 29 | % } elsif (stash('results')->size == 0) { |
Akron | 8ea8429 | 2018-10-24 13:41:52 +0200 | [diff] [blame^] | 30 | <p class="no-results"><%= loc 'noMatches', q => stash('q'), ql => stash('ql') %></p> |
Akron | 0e1ed24 | 2018-10-11 13:22:00 +0200 | [diff] [blame] | 31 | % } |
| 32 | </div> |