blob: 71c56b3e804938070452a6764d874599626ff826 [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 Diewaldf49633a2014-11-08 22:33:25 +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 Diewald13bad6a2014-07-18 16:44:51 +000064 %= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2'], ['Annis' => 'annis'], ['CQL v1.2' => 'cql']], id => 'ql-field'
Nils Diewald7cad8402014-07-08 17:06:56 +000065 </div>
Nils Diewald02df9912014-06-03 16:08:07 +000066
Nils Diewald02df9912014-06-03 16:08:07 +000067<div id="button-right">
Nils Diewalde8e88052014-11-10 16:32:02 +000068% unless (param('q')) { param(cutoff => 1) };
69%= check_box cutoff => 1, id => 'q-cutoff-field'
70<label for="q-cutoff-field"><span></span>Quick</label>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000071% unless (current_route 'tutorial') {
Nils Diewald7cad8402014-07-08 17:06:56 +000072<button type="button" title="Tutorial" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000073% };
Nils Diewald7cad8402014-07-08 17:06:56 +000074% if (param('q')) {
75<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>
76% }
Nils Diewald2329e1d2014-06-12 16:07:57 +000077</div>
Nils Diewald02df9912014-06-03 16:08:07 +000078
Nils Diewald7cad8402014-07-08 17:06:56 +000079% end
80
Nils Diewald02df9912014-06-03 16:08:07 +000081</div>
82
Nils Diewald4af3f0b2014-06-25 01:43:17 +000083%= content 'sidebar' => begin
Nils Diewald7cad8402014-07-08 17:06:56 +000084<div id="sidebar">
Nils Diewald2329e1d2014-06-12 16:07:57 +000085%= include 'collections'
Nils Diewald4af3f0b2014-06-25 01:43:17 +000086 <i class="fa fa-bars"></i>
Nils Diewald02df9912014-06-03 16:08:07 +000087</div>
Nils Diewald02df9912014-06-03 16:08:07 +000088% end
89
Nils Diewald4af3f0b2014-06-25 01:43:17 +000090<main>
91%= content main => begin
92 <p>This is the alternative KorAP Frontend.</p>
93 <p>The primary goal is to serve as a testbed for the query serialization and for different flavours of user interfaces.</p>
94 <p>Search capabilities are limited to the demo user.</p>
Nils Diewald47bdd912014-07-15 16:31:56 +000095 <p>Currently the frontend only supports recent versions of Mozilla Firefox.</p>
Nils Diewald4af3f0b2014-06-25 01:43:17 +000096% end
97</main>
Nils Diewald33e15552014-06-13 19:38:37 +000098
Nils Diewald4af3f0b2014-06-25 01:43:17 +000099%= content 'javascript'
100%= include 'partial/javascript'
Nils Diewaldca01b762014-09-08 02:35:20 +0000101%= notifications 'Alertify', -no_include
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000102 </body>
103</html>