blob: c393c729bac2036906446cdd585e0b63f38865c3 [file] [log] [blame]
Nils Diewald2329e1d2014-06-12 16:07:57 +00001% if (param 'q') {
Nils Diewald5d1ffb42014-05-21 17:45:34 +00002%= search begin
Nils Diewald2329e1d2014-06-12 16:07:57 +00003
4% unless (param 'snippet') {
Nils Diewald5d1ffb42014-05-21 17:45:34 +00005<div style="clear: both">
Nils Diewald5d1ffb42014-05-21 17:45:34 +00006% my $url = url_with->query(['p' => '{page}']);
7% my $pages = (stash('search.totalResults') / (stash('search.itemsPerPage') || 1));
8% $pages = $pages < 0 ? 0 : $pages;
Nils Diewald44a72782014-06-20 16:03:21 +00009 <div id="pagination"><%= pagination(stash('search.startPage'), $pages, $url) =%></div>
10 <p class="found">Found
11 <span id="total-results"><%= commify(stash('search.totalResults')) %> matches</span>
12 <% if (stash 'search.bm.hit') { %> in <%= stash 'search.bm.hit' %> (<%= stash 'search.bm.result' %>)<% } %>
Nils Diewald2329e1d2014-06-12 16:07:57 +000013 </p>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000014</div>
15
Nils Diewald02df9912014-06-03 16:08:07 +000016%= include 'query'
Nils Diewald2329e1d2014-06-12 16:07:57 +000017% };
Nils Diewald5d1ffb42014-05-21 17:45:34 +000018
Nils Diewald44a72782014-06-20 16:03:21 +000019
20
Nils Diewald5d1ffb42014-05-21 17:45:34 +000021<ol class="left-aligned">
22%= search_hits begin
Nils Diewald44a72782014-06-20 16:03:21 +000023%# ID, title, corpusID, author, pubDate, textClass
Nils Diewald33e15552014-06-13 19:38:37 +000024 <li data-corpus-id="<%= $_->{corpusID} %>"
25 data-doc-id="<%= korap_doc_id($_) %>"
26 data-match-id="<%= korap_match_id($_) %>">
Nils Diewald1eba6572014-06-17 19:49:53 +000027 <div>
Nils Diewald44a72782014-06-20 16:03:21 +000028 <div class="snippet"><%== $_->{snippet} %></div>
Nils Diewald1eba6572014-06-17 19:49:53 +000029 <div class="tokenInfo"></div>
30 </div>
Nils Diewald44a72782014-06-20 16:03:21 +000031 <p>
32 <strong><%= $_->{title} %></strong>
33 <%= $_->{author} ? ' by ' . $_->{author} : '' %>;
34 published on <%= date_format $_->{pubDate} %>
35 as <%= $_->{docID} %> (<%= $_->{corpusID} %>)
36 </p>
Nils Diewald2329e1d2014-06-12 16:07:57 +000037 <ul class="action right">
38 <li onmouseup="closeSnippet(this)" title="close"><i class="fa fa-toggle-up"></i></li>
Nils Diewald33e15552014-06-13 19:38:37 +000039 <li onclick="showTable(this)" title="Annotations"><i class="fa fa-info-circle"></i></li>
Nils Diewald1eba6572014-06-17 19:49:53 +000040<!--
Nils Diewald2329e1d2014-06-12 16:07:57 +000041 <li title="Tree Visualizations"><i class="fa fa-sitemap"></i></li>
42 <li title="Remember"><i class="fa fa-star-o"></i></li>
Nils Diewald1eba6572014-06-17 19:49:53 +000043-->
Nils Diewald2329e1d2014-06-12 16:07:57 +000044 </ul>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000045 </li>
46% end
47</ol>
Nils Diewald44a72782014-06-20 16:03:21 +000048
Nils Diewald5d1ffb42014-05-21 17:45:34 +000049% end
Nils Diewald44a72782014-06-20 16:03:21 +000050
51% }
52% else {
53%= include 'intro'
Nils Diewald1eba6572014-06-17 19:49:53 +000054% };