blob: f99e4106fb5fa8861f8d6b7efc134c4f58685bcd [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 Diewald7cad8402014-07-08 17:06:56 +00006% my $location;
7% my $search_route;
Nils Diewaldb22abdf2014-06-18 22:57:50 +00008% unless (current_route 'tutorial') {
Nils Diewalddb03fa92014-06-23 13:36:55 +00009<div id="tutorial">
Nils Diewald4e9fbcb2014-07-15 11:45:09 +000010%# my $tut_page = url_for(session('tutorial') || 'tutorial');
11%# <a href="<%= $tut_page %>"
12%# target="_blank"><i title="Open in new tab"
13%# class="fa fa-external-link-square"></i></a>
14%#
15%# <a href="javascript:window.open(getTutorialPage())"
16%# target="_blank"><i title="Open in new tab"
17%# class="fa fa-external-link-square"></i></a>
18%= javascript begin
19document.write('<a href="' + getTutorialPage().replace(/\?embedded=1/, '') + '" ');
20document.write('target="_blank"><i title="Open in new tab" ');
21document.write('class="fa fa-external-link-square"></i></a>');
22% end
Nils Diewald4af3f0b2014-06-25 01:43:17 +000023 <i onclick="closeTutorial()"
24 title="close"
25 class="fa fa-toggle-up"></i>
Nils Diewald4e9fbcb2014-07-15 11:45:09 +000026 <iframe src="about:blank"></iframe>
27%# data-src="<%= $tut_page->query([embedded => 1]) %>"></iframe>
Nils Diewald2329e1d2014-06-12 16:07:57 +000028</div>
Nils Diewald7cad8402014-07-08 17:06:56 +000029% if (current_route eq 'match') {
30% $search_route = url_for('search_corpus');
31% $location = 'in corpus <span class="location">' . stash('corpus_id') . '</span>';
32% }
33% else {
34% $search_route = url_for;
35% if (stash('doc_id')) {
36% $location = ' in document <span class="location">' . stash('corpus_id') . '/' . stash('doc_id') . '</span>';
37% }
38% elsif (stash('corpus_id')) {
39% $location = ' in corpus <span class="location">' . stash('corpus_id') . '</span>';
40% }
41% elsif (stash('collection_id')) {
42% $location = ' in collection <span class="location">' . stash('collection_id') . '</span>';
43% };
44% }
Nils Diewalddb03fa92014-06-23 13:36:55 +000045% }
46% else {
47% $search_route = url_for('index');
Nils Diewaldb22abdf2014-06-18 22:57:50 +000048% };
Nils Diewald33e15552014-06-13 19:38:37 +000049
Nils Diewald02df9912014-06-03 16:08:07 +000050<div id="top">
Nils Diewaldb22abdf2014-06-18 22:57:50 +000051 <a href="<%= url_for 'index' %>"><h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1></a>
Nils Diewalddb03fa92014-06-23 13:36:55 +000052
Nils Diewalde2c83812014-11-11 21:13:18 +000053%= form_for $search_route, autocomplete => 'off', begin
Nils Diewald7cad8402014-07-08 17:06:56 +000054 <div id="searchbar">
55%= search_field 'q', id => 'q-field', autofocus => 'autofocus', placeholder => 'Find ...'
56 <button type="submit"><i class="fa fa-search"></i></button>
Nils Diewaldb40ddad2014-06-23 15:39:18 +000057% if (stash('test_port')) {
Nils Diewald7cad8402014-07-08 17:06:56 +000058 <button type="submit" name="action" value="inspect"><i class="fa fa-code"></i></button>
Nils Diewaldb40ddad2014-06-23 15:39:18 +000059% };
Nils Diewald7cad8402014-07-08 17:06:56 +000060 </div>
61 <% if ($location) { %><%== $location %><% } %>
62 with
63 <div class="select">
Nils Diewalde2c83812014-11-11 21:13:18 +000064 %= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2'], ['CQL v1.2' => 'cql']], id => 'ql-field'
Nils Diewald7cad8402014-07-08 17:06:56 +000065 </div>
Nils Diewalde2c83812014-11-11 21:13:18 +000066%# ['Annis' => 'annis']
Nils Diewald02df9912014-06-03 16:08:07 +000067
Nils Diewald02df9912014-06-03 16:08:07 +000068<div id="button-right">
Nils Diewalde8e88052014-11-10 16:32:02 +000069% unless (param('q')) { param(cutoff => 1) };
70%= check_box cutoff => 1, id => 'q-cutoff-field'
71<label for="q-cutoff-field"><span></span>Quick</label>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000072% unless (current_route 'tutorial') {
Nils Diewald7cad8402014-07-08 17:06:56 +000073<button type="button" title="Tutorial" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000074% };
Nils Diewald7cad8402014-07-08 17:06:56 +000075% if (param('q')) {
76<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>
77% }
Nils Diewald2329e1d2014-06-12 16:07:57 +000078</div>
Nils Diewald02df9912014-06-03 16:08:07 +000079
Nils Diewald7cad8402014-07-08 17:06:56 +000080% end
81
Nils Diewald02df9912014-06-03 16:08:07 +000082</div>
83
Nils Diewald4af3f0b2014-06-25 01:43:17 +000084%= content 'sidebar' => begin
Nils Diewald7cad8402014-07-08 17:06:56 +000085<div id="sidebar">
Nils Diewald2329e1d2014-06-12 16:07:57 +000086%= include 'collections'
Nils Diewald4af3f0b2014-06-25 01:43:17 +000087 <i class="fa fa-bars"></i>
Nils Diewald02df9912014-06-03 16:08:07 +000088</div>
Nils Diewald02df9912014-06-03 16:08:07 +000089% end
90
Nils Diewald4af3f0b2014-06-25 01:43:17 +000091<main>
92%= content main => begin
93 <p>This is the alternative KorAP Frontend.</p>
94 <p>The primary goal is to serve as a testbed for the query serialization and for different flavours of user interfaces.</p>
95 <p>Search capabilities are limited to the demo user.</p>
Nils Diewald47bdd912014-07-15 16:31:56 +000096 <p>Currently the frontend only supports recent versions of Mozilla Firefox.</p>
Nils Diewald4af3f0b2014-06-25 01:43:17 +000097% end
98</main>
Nils Diewald33e15552014-06-13 19:38:37 +000099
Nils Diewald4af3f0b2014-06-25 01:43:17 +0000100%= content 'javascript'
101%= include 'partial/javascript'
Nils Diewaldca01b762014-09-08 02:35:20 +0000102%= notifications 'Alertify', -no_include
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000103 </body>
104</html>