blob: 700ee8840b7f96dbaf29c951c3f106577433632c [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
7<% unless (param('q')) { %><div id="crab-bg"></div><% } %>
8
Nils Diewald7cad8402014-07-08 17:06:56 +00009% my $location;
10% my $search_route;
Nils Diewaldb22abdf2014-06-18 22:57:50 +000011% unless (current_route 'tutorial') {
Nils Diewalddb03fa92014-06-23 13:36:55 +000012<div id="tutorial">
Nils Diewald4e9fbcb2014-07-15 11:45:09 +000013%# my $tut_page = url_for(session('tutorial') || 'tutorial');
14%# <a href="<%= $tut_page %>"
15%# target="_blank"><i title="Open in new tab"
16%# class="fa fa-external-link-square"></i></a>
17%#
18%# <a href="javascript:window.open(getTutorialPage())"
19%# target="_blank"><i title="Open in new tab"
20%# class="fa fa-external-link-square"></i></a>
21%= javascript begin
22document.write('<a href="' + getTutorialPage().replace(/\?embedded=1/, '') + '" ');
23document.write('target="_blank"><i title="Open in new tab" ');
24document.write('class="fa fa-external-link-square"></i></a>');
25% end
Nils Diewald4af3f0b2014-06-25 01:43:17 +000026 <i onclick="closeTutorial()"
27 title="close"
28 class="fa fa-toggle-up"></i>
Nils Diewald4e9fbcb2014-07-15 11:45:09 +000029 <iframe src="about:blank"></iframe>
30%# data-src="<%= $tut_page->query([embedded => 1]) %>"></iframe>
Nils Diewald2329e1d2014-06-12 16:07:57 +000031</div>
Nils Diewald7cad8402014-07-08 17:06:56 +000032% if (current_route eq 'match') {
33% $search_route = url_for('search_corpus');
34% $location = 'in corpus <span class="location">' . stash('corpus_id') . '</span>';
35% }
36% else {
37% $search_route = url_for;
38% if (stash('doc_id')) {
39% $location = ' in document <span class="location">' . stash('corpus_id') . '/' . stash('doc_id') . '</span>';
40% }
41% elsif (stash('corpus_id')) {
42% $location = ' in corpus <span class="location">' . stash('corpus_id') . '</span>';
43% }
44% elsif (stash('collection_id')) {
45% $location = ' in collection <span class="location">' . stash('collection_id') . '</span>';
46% };
47% }
Nils Diewalddb03fa92014-06-23 13:36:55 +000048% }
49% else {
50% $search_route = url_for('index');
Nils Diewaldb22abdf2014-06-18 22:57:50 +000051% };
Nils Diewald33e15552014-06-13 19:38:37 +000052
Nils Diewald02df9912014-06-03 16:08:07 +000053<div id="top">
Nils Diewaldb22abdf2014-06-18 22:57:50 +000054 <a href="<%= url_for 'index' %>"><h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1></a>
Nils Diewalddb03fa92014-06-23 13:36:55 +000055
Nils Diewalde2c83812014-11-11 21:13:18 +000056%= form_for $search_route, autocomplete => 'off', begin
Nils Diewald7cad8402014-07-08 17:06:56 +000057 <div id="searchbar">
58%= search_field 'q', id => 'q-field', autofocus => 'autofocus', placeholder => 'Find ...'
59 <button type="submit"><i class="fa fa-search"></i></button>
Nils Diewaldb40ddad2014-06-23 15:39:18 +000060% if (stash('test_port')) {
Nils Diewald7cad8402014-07-08 17:06:56 +000061 <button type="submit" name="action" value="inspect"><i class="fa fa-code"></i></button>
Nils Diewaldb40ddad2014-06-23 15:39:18 +000062% };
Nils Diewald7cad8402014-07-08 17:06:56 +000063 </div>
64 <% if ($location) { %><%== $location %><% } %>
65 with
66 <div class="select">
Nils Diewalde2c83812014-11-11 21:13:18 +000067 %= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2'], ['CQL v1.2' => 'cql']], id => 'ql-field'
Nils Diewald7cad8402014-07-08 17:06:56 +000068 </div>
Nils Diewalde2c83812014-11-11 21:13:18 +000069%# ['Annis' => 'annis']
Nils Diewald02df9912014-06-03 16:08:07 +000070
Nils Diewald02df9912014-06-03 16:08:07 +000071<div id="button-right">
Nils Diewalde8e88052014-11-10 16:32:02 +000072% unless (param('q')) { param(cutoff => 1) };
73%= check_box cutoff => 1, id => 'q-cutoff-field'
74<label for="q-cutoff-field"><span></span>Quick</label>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000075% unless (current_route 'tutorial') {
Nils Diewald7cad8402014-07-08 17:06:56 +000076<button type="button" title="Tutorial" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000077% };
Nils Diewald7cad8402014-07-08 17:06:56 +000078% if (param('q')) {
79<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>
80% }
Nils Diewald2329e1d2014-06-12 16:07:57 +000081</div>
Nils Diewald02df9912014-06-03 16:08:07 +000082
Nils Diewald7cad8402014-07-08 17:06:56 +000083% end
84
Nils Diewald02df9912014-06-03 16:08:07 +000085</div>
86
Nils Diewald4af3f0b2014-06-25 01:43:17 +000087%= content 'sidebar' => begin
Nils Diewald7cad8402014-07-08 17:06:56 +000088<div id="sidebar">
Nils Diewald2329e1d2014-06-12 16:07:57 +000089%= include 'collections'
Nils Diewald4af3f0b2014-06-25 01:43:17 +000090 <i class="fa fa-bars"></i>
Nils Diewald02df9912014-06-03 16:08:07 +000091</div>
Nils Diewald02df9912014-06-03 16:08:07 +000092% end
93
Nils Diewald4af3f0b2014-06-25 01:43:17 +000094<main>
95%= content main => begin
96 <p>This is the alternative KorAP Frontend.</p>
97 <p>The primary goal is to serve as a testbed for the query serialization and for different flavours of user interfaces.</p>
98 <p>Search capabilities are limited to the demo user.</p>
Nils Diewald47bdd912014-07-15 16:31:56 +000099 <p>Currently the frontend only supports recent versions of Mozilla Firefox.</p>
Nils Diewald4af3f0b2014-06-25 01:43:17 +0000100% end
101</main>
Nils Diewald33e15552014-06-13 19:38:37 +0000102
Nils Diewald4af3f0b2014-06-25 01:43:17 +0000103%= content 'javascript'
104%= include 'partial/javascript'
Nils Diewaldca01b762014-09-08 02:35:20 +0000105%= notifications 'Alertify', -no_include
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000106 </body>
107</html>