blob: 2c2030c7184536601db4e7c8521849b003af623f [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 Diewaldf49633a2014-11-08 22:33:25 +000066%= hidden_field 'cutoff' => 0, id => 'q-cutoff-field'
Nils Diewald02df9912014-06-03 16:08:07 +000067
Nils Diewald02df9912014-06-03 16:08:07 +000068<div id="button-right">
Nils Diewaldb22abdf2014-06-18 22:57:50 +000069% unless (current_route 'tutorial') {
Nils Diewald7cad8402014-07-08 17:06:56 +000070<button type="button" title="Tutorial" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000071% };
Nils Diewald7cad8402014-07-08 17:06:56 +000072% if (param('q')) {
73<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>
74% }
Nils Diewald2329e1d2014-06-12 16:07:57 +000075</div>
Nils Diewald02df9912014-06-03 16:08:07 +000076
Nils Diewald7cad8402014-07-08 17:06:56 +000077% end
78
Nils Diewald02df9912014-06-03 16:08:07 +000079</div>
80
Nils Diewald4af3f0b2014-06-25 01:43:17 +000081%= content 'sidebar' => begin
Nils Diewald7cad8402014-07-08 17:06:56 +000082<div id="sidebar">
Nils Diewald2329e1d2014-06-12 16:07:57 +000083%= include 'collections'
Nils Diewald4af3f0b2014-06-25 01:43:17 +000084 <i class="fa fa-bars"></i>
Nils Diewald02df9912014-06-03 16:08:07 +000085</div>
Nils Diewald02df9912014-06-03 16:08:07 +000086% end
87
Nils Diewald4af3f0b2014-06-25 01:43:17 +000088<main>
89%= content main => begin
90 <p>This is the alternative KorAP Frontend.</p>
91 <p>The primary goal is to serve as a testbed for the query serialization and for different flavours of user interfaces.</p>
92 <p>Search capabilities are limited to the demo user.</p>
Nils Diewald47bdd912014-07-15 16:31:56 +000093 <p>Currently the frontend only supports recent versions of Mozilla Firefox.</p>
Nils Diewald4af3f0b2014-06-25 01:43:17 +000094% end
95</main>
Nils Diewald33e15552014-06-13 19:38:37 +000096
Nils Diewald4af3f0b2014-06-25 01:43:17 +000097%= content 'javascript'
98%= include 'partial/javascript'
Nils Diewaldca01b762014-09-08 02:35:20 +000099%= notifications 'Alertify', -no_include
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000100 </body>
101</html>