blob: ac376e37eda1e8b683990a2fda51dfa158214798 [file] [log] [blame]
Nils Diewald5d1ffb42014-05-21 17:45:34 +00001<!DOCTYPE html>
2<html>
Nils Diewald4af3f0b2014-06-25 01:43:17 +00003%= include 'partial/header'
Nils Diewald5d1ffb42014-05-21 17:45:34 +00004 <body>
Nils Diewald2329e1d2014-06-12 16:07:57 +00005
Nils Diewald5cc44002014-11-12 02:19:22 +00006%# Background-image
Nils Diewald29c0b1d2014-11-13 21:14:17 +00007% if (!param('q') && current_route eq 'index') {
8<div id="crab-bg"></div>
9% };
Nils Diewald5cc44002014-11-12 02:19:22 +000010
Nils Diewald7cad8402014-07-08 17:06:56 +000011% my $location;
12% my $search_route;
Nils Diewaldb22abdf2014-06-18 22:57:50 +000013% unless (current_route 'tutorial') {
Nils Diewalddb03fa92014-06-23 13:36:55 +000014<div id="tutorial">
Nils Diewald4e9fbcb2014-07-15 11:45:09 +000015%# my $tut_page = url_for(session('tutorial') || 'tutorial');
16%# <a href="<%= $tut_page %>"
17%# target="_blank"><i title="Open in new tab"
18%# class="fa fa-external-link-square"></i></a>
19%#
20%# <a href="javascript:window.open(getTutorialPage())"
21%# target="_blank"><i title="Open in new tab"
22%# class="fa fa-external-link-square"></i></a>
23%= javascript begin
24document.write('<a href="' + getTutorialPage().replace(/\?embedded=1/, '') + '" ');
25document.write('target="_blank"><i title="Open in new tab" ');
26document.write('class="fa fa-external-link-square"></i></a>');
27% end
Nils Diewald4af3f0b2014-06-25 01:43:17 +000028 <i onclick="closeTutorial()"
29 title="close"
30 class="fa fa-toggle-up"></i>
Nils Diewald4e9fbcb2014-07-15 11:45:09 +000031 <iframe src="about:blank"></iframe>
32%# data-src="<%= $tut_page->query([embedded => 1]) %>"></iframe>
Nils Diewald2329e1d2014-06-12 16:07:57 +000033</div>
Nils Diewald7cad8402014-07-08 17:06:56 +000034% if (current_route eq 'match') {
35% $search_route = url_for('search_corpus');
36% $location = 'in corpus <span class="location">' . stash('corpus_id') . '</span>';
37% }
38% else {
39% $search_route = url_for;
40% if (stash('doc_id')) {
41% $location = ' in document <span class="location">' . stash('corpus_id') . '/' . stash('doc_id') . '</span>';
42% }
43% elsif (stash('corpus_id')) {
44% $location = ' in corpus <span class="location">' . stash('corpus_id') . '</span>';
45% }
46% elsif (stash('collection_id')) {
47% $location = ' in collection <span class="location">' . stash('collection_id') . '</span>';
48% };
49% }
Nils Diewalddb03fa92014-06-23 13:36:55 +000050% }
51% else {
52% $search_route = url_for('index');
Nils Diewaldb22abdf2014-06-18 22:57:50 +000053% };
Nils Diewald33e15552014-06-13 19:38:37 +000054
Nils Diewald02df9912014-06-03 16:08:07 +000055<div id="top">
Nils Diewaldb22abdf2014-06-18 22:57:50 +000056 <a href="<%= url_for 'index' %>"><h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1></a>
Nils Diewalddb03fa92014-06-23 13:36:55 +000057
Nils Diewalde2c83812014-11-11 21:13:18 +000058%= form_for $search_route, autocomplete => 'off', begin
Nils Diewald7cad8402014-07-08 17:06:56 +000059 <div id="searchbar">
60%= search_field 'q', id => 'q-field', autofocus => 'autofocus', placeholder => 'Find ...'
61 <button type="submit"><i class="fa fa-search"></i></button>
Nils Diewaldb40ddad2014-06-23 15:39:18 +000062% if (stash('test_port')) {
Nils Diewald7cad8402014-07-08 17:06:56 +000063 <button type="submit" name="action" value="inspect"><i class="fa fa-code"></i></button>
Nils Diewaldb40ddad2014-06-23 15:39:18 +000064% };
Nils Diewald7cad8402014-07-08 17:06:56 +000065 </div>
66 <% if ($location) { %><%== $location %><% } %>
67 with
68 <div class="select">
Nils Diewald7e259592014-11-12 19:04:55 +000069 %= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2'], ['Annis' => 'annis'], ['CQL v1.2' => 'cql']], id => 'ql-field'
Nils Diewald7cad8402014-07-08 17:06:56 +000070 </div>
Nils Diewald02df9912014-06-03 16:08:07 +000071
Nils Diewald02df9912014-06-03 16:08:07 +000072<div id="button-right">
Nils Diewalde8e88052014-11-10 16:32:02 +000073% unless (param('q')) { param(cutoff => 1) };
74%= check_box cutoff => 1, id => 'q-cutoff-field'
75<label for="q-cutoff-field"><span></span>Quick</label>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000076% unless (current_route 'tutorial') {
Nils Diewald7cad8402014-07-08 17:06:56 +000077<button type="button" title="Tutorial" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000078% };
Nils Diewald7cad8402014-07-08 17:06:56 +000079% if (param('q')) {
80<button type="button" title="Alignment" onclick="$('#search > ol').toggleClass('left-aligned right-aligned'); $(this).children('i').toggleClass('fa-align-right fa-align-left')"><i class="fa fa-align-right"></i></button>
81% }
Nils Diewald2329e1d2014-06-12 16:07:57 +000082</div>
Nils Diewald02df9912014-06-03 16:08:07 +000083
Nils Diewald7cad8402014-07-08 17:06:56 +000084% end
85
Nils Diewald02df9912014-06-03 16:08:07 +000086</div>
87
Nils Diewald4af3f0b2014-06-25 01:43:17 +000088%= content 'sidebar' => begin
Nils Diewald7cad8402014-07-08 17:06:56 +000089<div id="sidebar">
Nils Diewald2329e1d2014-06-12 16:07:57 +000090%= include 'collections'
Nils Diewald4af3f0b2014-06-25 01:43:17 +000091 <i class="fa fa-bars"></i>
Nils Diewald02df9912014-06-03 16:08:07 +000092</div>
Nils Diewald02df9912014-06-03 16:08:07 +000093% end
94
Nils Diewald4af3f0b2014-06-25 01:43:17 +000095<main>
96%= content main => begin
97 <p>This is the alternative KorAP Frontend.</p>
98 <p>The primary goal is to serve as a testbed for the query serialization and for different flavours of user interfaces.</p>
99 <p>Search capabilities are limited to the demo user.</p>
Nils Diewald47bdd912014-07-15 16:31:56 +0000100 <p>Currently the frontend only supports recent versions of Mozilla Firefox.</p>
Nils Diewald4af3f0b2014-06-25 01:43:17 +0000101% end
102</main>
Nils Diewald33e15552014-06-13 19:38:37 +0000103
Nils Diewald4af3f0b2014-06-25 01:43:17 +0000104%= content 'javascript'
105%= include 'partial/javascript'
Nils Diewaldca01b762014-09-08 02:35:20 +0000106%= notifications 'Alertify', -no_include
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000107 </body>
108</html>