blob: 0f5586692df2d871f371dab87405b8e2f6aa8387 [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 Diewaldeca30442014-11-18 20:33:54 +000065 <i onclick="hint.popUp()" class="fa fa-arrow-circle-down show-hint"></i>
Nils Diewald7cad8402014-07-08 17:06:56 +000066 </div>
67 <% if ($location) { %><%== $location %><% } %>
68 with
69 <div class="select">
Nils Diewald7e259592014-11-12 19:04:55 +000070 %= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2'], ['Annis' => 'annis'], ['CQL v1.2' => 'cql']], id => 'ql-field'
Nils Diewald7cad8402014-07-08 17:06:56 +000071 </div>
Nils Diewald02df9912014-06-03 16:08:07 +000072
Nils Diewald02df9912014-06-03 16:08:07 +000073<div id="button-right">
Nils Diewalde8e88052014-11-10 16:32:02 +000074% unless (param('q')) { param(cutoff => 1) };
75%= check_box cutoff => 1, id => 'q-cutoff-field'
76<label for="q-cutoff-field"><span></span>Quick</label>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000077% unless (current_route 'tutorial') {
Nils Diewald7cad8402014-07-08 17:06:56 +000078<button type="button" title="Tutorial" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000079% };
Nils Diewald7cad8402014-07-08 17:06:56 +000080% if (param('q')) {
81<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>
82% }
Nils Diewald2329e1d2014-06-12 16:07:57 +000083</div>
Nils Diewald02df9912014-06-03 16:08:07 +000084
Nils Diewald7cad8402014-07-08 17:06:56 +000085% end
86
Nils Diewald02df9912014-06-03 16:08:07 +000087</div>
88
Nils Diewald4af3f0b2014-06-25 01:43:17 +000089%= content 'sidebar' => begin
Nils Diewald7cad8402014-07-08 17:06:56 +000090<div id="sidebar">
Nils Diewald2329e1d2014-06-12 16:07:57 +000091%= include 'collections'
Nils Diewald4af3f0b2014-06-25 01:43:17 +000092 <i class="fa fa-bars"></i>
Nils Diewald02df9912014-06-03 16:08:07 +000093</div>
Nils Diewald02df9912014-06-03 16:08:07 +000094% end
95
Nils Diewald4af3f0b2014-06-25 01:43:17 +000096<main>
97%= content main => begin
98 <p>This is the alternative KorAP Frontend.</p>
99 <p>The primary goal is to serve as a testbed for the query serialization and for different flavours of user interfaces.</p>
100 <p>Search capabilities are limited to the demo user.</p>
Nils Diewald47bdd912014-07-15 16:31:56 +0000101 <p>Currently the frontend only supports recent versions of Mozilla Firefox.</p>
Nils Diewald4af3f0b2014-06-25 01:43:17 +0000102% end
103</main>
Nils Diewald33e15552014-06-13 19:38:37 +0000104
Nils Diewald4af3f0b2014-06-25 01:43:17 +0000105%= content 'javascript'
106%= include 'partial/javascript'
Nils Diewaldca01b762014-09-08 02:35:20 +0000107%= notifications 'Alertify', -no_include
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000108 </body>
109</html>