blob: 8ed571b24ab79871cb49dc83d70690c8f5de0d02 [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 Diewald2329e1d2014-06-12 16:07:57 +00006 <p class="found">
7 <span class="pagination">
Nils Diewald5d1ffb42014-05-21 17:45:34 +00008% my $url = url_with->query(['p' => '{page}']);
9% my $pages = (stash('search.totalResults') / (stash('search.itemsPerPage') || 1));
10% $pages = $pages < 0 ? 0 : $pages;
Nils Diewald2329e1d2014-06-12 16:07:57 +000011 </span>
Nils Diewald02df9912014-06-03 16:08:07 +000012
Nils Diewald2329e1d2014-06-12 16:07:57 +000013 <div id="pagination">
Nils Diewald02df9912014-06-03 16:08:07 +000014%= pagination(stash('search.startPage'), $pages, $url)
Nils Diewald2329e1d2014-06-12 16:07:57 +000015 </div>
Nils Diewald02df9912014-06-03 16:08:07 +000016
17%#= l('Found <span id="total-results">[_1]</span> [quant,_1,match]')
18%#= l('in [_1])
Nils Diewalddd2d4e82014-05-31 17:08:33 +000019Found <span id="total-results"><%= commify(stash('search.totalResults')) %> matches</span>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000020% if (stash 'search.bm.hit') {
21 in <%= stash 'search.bm.hit' %> (<%= stash 'search.bm.result' %>)
22% }
Nils Diewald2329e1d2014-06-12 16:07:57 +000023 </p>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000024</div>
25
Nils Diewald02df9912014-06-03 16:08:07 +000026%= include 'query'
Nils Diewald2329e1d2014-06-12 16:07:57 +000027% };
Nils Diewald5d1ffb42014-05-21 17:45:34 +000028
29<ol class="left-aligned">
30%= search_hits begin
31 <li>
32%# ID, title, corpusID, author, pubDate, textClass
Nils Diewald2329e1d2014-06-12 16:07:57 +000033 <div class="snippet"><%== $_->{snippet} %></div>
34 <p><strong><%= $_->{title} %></strong><%= $_->{author} ? ' by ' . $_->{author} : '' %>; published on <%= date_format $_->{pubDate} %> as <%= $_->{docID} %> (<%= $_->{corpusID} %>)</p>
35%# as <%= $_->{ID} %>
36%# textClass docID
37% foreach (grep { m!/morpho$! } split(/\s+/, $_->{foundries})) {
38%# <%= $_ %>
39% };
40
41 <ul class="action right">
42 <li onmouseup="closeSnippet(this)" title="close"><i class="fa fa-toggle-up"></i></li>
43 <li title="Annotations"><i class="fa fa-info-circle"></i></li>
44 <li title="Tree Visualizations"><i class="fa fa-sitemap"></i></li>
45 <li title="Remember"><i class="fa fa-star-o"></i></li>
46 </ul>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000047 </li>
48% end
49</ol>
50% end
Nils Diewald2329e1d2014-06-12 16:07:57 +000051% }