blob: a35bbab311b8dd04b0fe8b8d04da5bc7a450a2e2 [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 Diewald7e259592014-11-12 19:04:55 +000067 %= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2'], ['Annis' => 'annis'], ['CQL v1.2' => 'cql']], id => 'ql-field'
Nils Diewald7cad8402014-07-08 17:06:56 +000068 </div>
Nils Diewald02df9912014-06-03 16:08:07 +000069
Nils Diewald02df9912014-06-03 16:08:07 +000070<div id="button-right">
Nils Diewalde8e88052014-11-10 16:32:02 +000071% unless (param('q')) { param(cutoff => 1) };
72%= check_box cutoff => 1, id => 'q-cutoff-field'
73<label for="q-cutoff-field"><span></span>Quick</label>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000074% unless (current_route 'tutorial') {
Nils Diewald7cad8402014-07-08 17:06:56 +000075<button type="button" title="Tutorial" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000076% };
Nils Diewald7cad8402014-07-08 17:06:56 +000077% if (param('q')) {
78<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>
79% }
Nils Diewald2329e1d2014-06-12 16:07:57 +000080</div>
Nils Diewald02df9912014-06-03 16:08:07 +000081
Nils Diewald7cad8402014-07-08 17:06:56 +000082% end
83
Nils Diewald02df9912014-06-03 16:08:07 +000084</div>
85
Nils Diewald4af3f0b2014-06-25 01:43:17 +000086%= content 'sidebar' => begin
Nils Diewald7cad8402014-07-08 17:06:56 +000087<div id="sidebar">
Nils Diewald2329e1d2014-06-12 16:07:57 +000088%= include 'collections'
Nils Diewald4af3f0b2014-06-25 01:43:17 +000089 <i class="fa fa-bars"></i>
Nils Diewald02df9912014-06-03 16:08:07 +000090</div>
Nils Diewald02df9912014-06-03 16:08:07 +000091% end
92
Nils Diewald4af3f0b2014-06-25 01:43:17 +000093<main>
94%= content main => begin
95 <p>This is the alternative KorAP Frontend.</p>
96 <p>The primary goal is to serve as a testbed for the query serialization and for different flavours of user interfaces.</p>
97 <p>Search capabilities are limited to the demo user.</p>
Nils Diewald47bdd912014-07-15 16:31:56 +000098 <p>Currently the frontend only supports recent versions of Mozilla Firefox.</p>
Nils Diewald4af3f0b2014-06-25 01:43:17 +000099% end
100</main>
Nils Diewald33e15552014-06-13 19:38:37 +0000101
Nils Diewald4af3f0b2014-06-25 01:43:17 +0000102%= content 'javascript'
103%= include 'partial/javascript'
Nils Diewaldca01b762014-09-08 02:35:20 +0000104%= notifications 'Alertify', -no_include
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000105 </body>
106</html>