blob: ff795626f1ac8abeb92e63adcec5cfff8d7c7015 [file] [log] [blame]
Nils Diewald5d1ffb42014-05-21 17:45:34 +00001% layout 'default', title 'KorAP';
2% use JSON::XS;
3
4
5%= search begin
6<div style="clear: both">
7<p class="found"><span class="pagination">
8% my $url = url_with->query(['p' => '{page}']);
9% my $pages = (stash('search.totalResults') / (stash('search.itemsPerPage') || 1));
10% $pages = $pages < 0 ? 0 : $pages;
11<%= pagination(stash('search.startPage'), $pages, $url); %></span>
Nils Diewalddd2d4e82014-05-31 17:08:33 +000012Found <span id="total-results"><%= commify(stash('search.totalResults')) %> matches</span>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000013% if (stash 'search.bm.hit') {
14 in <%= stash 'search.bm.hit' %> (<%= stash 'search.bm.result' %>)
15% }
16</p>
17</div>
18
19
Nils Diewalddd2d4e82014-05-31 17:08:33 +000020%= notifications 'Humane'
Nils Diewald5d1ffb42014-05-21 17:45:34 +000021
22
23% if (stash('search.query')) {
24<code><span>JSON-LD Query</span><pre>
25% my $json = JSON::XS->new->pretty;
26%= $json->encode(stash('search.query'))
27</pre></span></code>
28% }
29
30
31<ol class="left-aligned">
32%= search_hits begin
33 <li>
34%# ID, title, corpusID, author, pubDate, textClass
35<%== $_->{snippet} %>
36 </li>
37% end
38</ol>
39% end
40
41
Nils Diewalddd2d4e82014-05-31 17:08:33 +000042%= javascript begin
Nils Diewald5d1ffb42014-05-21 17:45:34 +000043$("li,code").on("click", function () {
44 $(this).toggleClass('active');
45});
Nils Diewalddd2d4e82014-05-31 17:08:33 +000046% end