blob: 492acdf4d899c161af18730da94265dbedad8e44 [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 Diewald4af3f0b2014-06-25 01:43:17 +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 <i onclick="closeTutorial()"
15 title="close"
16 class="fa fa-toggle-up"></i>
17 <iframe src="about:blank"
18 data-src="<%= $tut_page->query([embedded => 1]) %>"></iframe>
Nils Diewald2329e1d2014-06-12 16:07:57 +000019</div>
Nils Diewald7cad8402014-07-08 17:06:56 +000020% if (current_route eq 'match') {
21% $search_route = url_for('search_corpus');
22% $location = 'in corpus <span class="location">' . stash('corpus_id') . '</span>';
23% }
24% else {
25% $search_route = url_for;
26% if (stash('doc_id')) {
27% $location = ' in document <span class="location">' . stash('corpus_id') . '/' . stash('doc_id') . '</span>';
28% }
29% elsif (stash('corpus_id')) {
30% $location = ' in corpus <span class="location">' . stash('corpus_id') . '</span>';
31% }
32% elsif (stash('collection_id')) {
33% $location = ' in collection <span class="location">' . stash('collection_id') . '</span>';
34% };
35% }
Nils Diewalddb03fa92014-06-23 13:36:55 +000036% }
37% else {
38% $search_route = url_for('index');
Nils Diewaldb22abdf2014-06-18 22:57:50 +000039% };
Nils Diewald33e15552014-06-13 19:38:37 +000040
Nils Diewald02df9912014-06-03 16:08:07 +000041<div id="top">
Nils Diewaldb22abdf2014-06-18 22:57:50 +000042 <a href="<%= url_for 'index' %>"><h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1></a>
Nils Diewalddb03fa92014-06-23 13:36:55 +000043
Nils Diewalddb03fa92014-06-23 13:36:55 +000044%= form_for $search_route => begin
Nils Diewald7cad8402014-07-08 17:06:56 +000045 <div id="searchbar">
46%= search_field 'q', id => 'q-field', autofocus => 'autofocus', placeholder => 'Find ...'
47 <button type="submit"><i class="fa fa-search"></i></button>
Nils Diewaldb40ddad2014-06-23 15:39:18 +000048% if (stash('test_port')) {
Nils Diewald7cad8402014-07-08 17:06:56 +000049 <button type="submit" name="action" value="inspect"><i class="fa fa-code"></i></button>
Nils Diewaldb40ddad2014-06-23 15:39:18 +000050% };
Nils Diewald7cad8402014-07-08 17:06:56 +000051 </div>
52 <% if ($location) { %><%== $location %><% } %>
53 with
54 <div class="select">
55 %= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2']], id => 'ql-field'
56 </div>
57
Nils Diewald02df9912014-06-03 16:08:07 +000058
Nils Diewald02df9912014-06-03 16:08:07 +000059<div id="button-right">
Nils Diewaldb22abdf2014-06-18 22:57:50 +000060% unless (current_route 'tutorial') {
Nils Diewald7cad8402014-07-08 17:06:56 +000061<button type="button" title="Tutorial" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000062% };
Nils Diewald7cad8402014-07-08 17:06:56 +000063% if (param('q')) {
64<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>
65% }
Nils Diewald2329e1d2014-06-12 16:07:57 +000066</div>
Nils Diewald02df9912014-06-03 16:08:07 +000067
Nils Diewald7cad8402014-07-08 17:06:56 +000068% end
69
Nils Diewald02df9912014-06-03 16:08:07 +000070</div>
71
Nils Diewald4af3f0b2014-06-25 01:43:17 +000072%= content 'sidebar' => begin
Nils Diewald7cad8402014-07-08 17:06:56 +000073<div id="sidebar">
Nils Diewald2329e1d2014-06-12 16:07:57 +000074%= include 'collections'
Nils Diewald4af3f0b2014-06-25 01:43:17 +000075 <i class="fa fa-bars"></i>
Nils Diewald02df9912014-06-03 16:08:07 +000076</div>
Nils Diewald02df9912014-06-03 16:08:07 +000077% end
78
Nils Diewald4af3f0b2014-06-25 01:43:17 +000079<main>
80%= content main => begin
81 <p>This is the alternative KorAP Frontend.</p>
82 <p>The primary goal is to serve as a testbed for the query serialization and for different flavours of user interfaces.</p>
83 <p>Search capabilities are limited to the demo user.</p>
84% end
85</main>
Nils Diewald33e15552014-06-13 19:38:37 +000086
Nils Diewald4af3f0b2014-06-25 01:43:17 +000087%= content 'javascript'
88%= include 'partial/javascript'
Nils Diewald2329e1d2014-06-12 16:07:57 +000089%= notifications 'Alertify'
Nils Diewald5d1ffb42014-05-21 17:45:34 +000090 </body>
91</html>