blob: a409a402117fc3245349bbc777fcdff4b213cb8e [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
Nils Diewalddd2d4e82014-05-31 17:08:33 +000017Found <span id="total-results"><%= commify(stash('search.totalResults')) %> matches</span>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000018% if (stash 'search.bm.hit') {
19 in <%= stash 'search.bm.hit' %> (<%= stash 'search.bm.result' %>)
20% }
Nils Diewald2329e1d2014-06-12 16:07:57 +000021 </p>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000022</div>
23
Nils Diewald02df9912014-06-03 16:08:07 +000024%= include 'query'
Nils Diewald2329e1d2014-06-12 16:07:57 +000025% };
Nils Diewald5d1ffb42014-05-21 17:45:34 +000026
27<ol class="left-aligned">
28%= search_hits begin
Nils Diewald1eba6572014-06-17 19:49:53 +000029
Nils Diewald33e15552014-06-13 19:38:37 +000030 <li data-corpus-id="<%= $_->{corpusID} %>"
31 data-doc-id="<%= korap_doc_id($_) %>"
32 data-match-id="<%= korap_match_id($_) %>">
Nils Diewald5d1ffb42014-05-21 17:45:34 +000033%# ID, title, corpusID, author, pubDate, textClass
Nils Diewald1eba6572014-06-17 19:49:53 +000034 <div>
35 <div class="snippet">
36 <%== $_->{snippet} %>
37 </div>
Nils Diewald33e15552014-06-13 19:38:37 +000038
Nils Diewald2329e1d2014-06-12 16:07:57 +000039%# as <%= $_->{ID} %>
40%# textClass docID
Nils Diewald33e15552014-06-13 19:38:37 +000041%# foreach (grep { m!/morpho$! } split(/\s+/, $_->{foundries})) {
Nils Diewald2329e1d2014-06-12 16:07:57 +000042%# <%= $_ %>
Nils Diewald33e15552014-06-13 19:38:37 +000043%# };
Nils Diewald2329e1d2014-06-12 16:07:57 +000044
Nils Diewald1eba6572014-06-17 19:49:53 +000045 <div class="tokenInfo"></div>
46 </div>
47 <p><strong><%= $_->{title} %></strong><%= $_->{author} ? ' by ' . $_->{author} : '' %>; published on <%= date_format $_->{pubDate} %> as <%= $_->{docID} %> (<%= $_->{corpusID} %>)</p>
48
Nils Diewald2329e1d2014-06-12 16:07:57 +000049 <ul class="action right">
50 <li onmouseup="closeSnippet(this)" title="close"><i class="fa fa-toggle-up"></i></li>
Nils Diewald33e15552014-06-13 19:38:37 +000051 <li onclick="showTable(this)" title="Annotations"><i class="fa fa-info-circle"></i></li>
Nils Diewald1eba6572014-06-17 19:49:53 +000052<!--
Nils Diewald2329e1d2014-06-12 16:07:57 +000053 <li title="Tree Visualizations"><i class="fa fa-sitemap"></i></li>
54 <li title="Remember"><i class="fa fa-star-o"></i></li>
Nils Diewald1eba6572014-06-17 19:49:53 +000055-->
Nils Diewald2329e1d2014-06-12 16:07:57 +000056 </ul>
Nils Diewald1eba6572014-06-17 19:49:53 +000057
58
Nils Diewald5d1ffb42014-05-21 17:45:34 +000059 </li>
60% end
61</ol>
62% end
Nils Diewald1eba6572014-06-17 19:49:53 +000063% } else {
64<div id="intro">
65 <p>This is the alternative KorAP Frontend.</p>
66 <p>The primary goal is to serve as a testbed for the query serialization and for different flavours of user interfaces.</p>
67 <p>Search capabilities are limited to the demo user.</p>
68</div>
69% };