blob: be515f8ce94be47475ae9e67866d6fe21f4ee6af [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>
12Found <span id="total-results"><%= format_thousands(stash('search.totalResults')) %> matches</span>
13% if (stash 'search.bm.hit') {
14 in <%= stash 'search.bm.hit' %> (<%= stash 'search.bm.result' %>)
15% }
16</p>
17</div>
18
19
20%= notifications
21
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
42<script>
43<!--
44$("li,code").on("click", function () {
45 $(this).toggleClass('active');
46});
47-->
48</script>