Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 3 | %= include 'partial/header' |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 4 | <body> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 5 | |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 6 | % my $location; |
| 7 | % my $search_route; |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 8 | % unless (current_route 'tutorial') { |
Nils Diewald | db03fa9 | 2014-06-23 13:36:55 +0000 | [diff] [blame] | 9 | <div id="tutorial"> |
Nils Diewald | 4e9fbcb | 2014-07-15 11:45:09 +0000 | [diff] [blame] | 10 | %# 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 |
| 19 | document.write('<a href="' + getTutorialPage().replace(/\?embedded=1/, '') + '" '); |
| 20 | document.write('target="_blank"><i title="Open in new tab" '); |
| 21 | document.write('class="fa fa-external-link-square"></i></a>'); |
| 22 | % end |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 23 | <i onclick="closeTutorial()" |
| 24 | title="close" |
| 25 | class="fa fa-toggle-up"></i> |
Nils Diewald | 4e9fbcb | 2014-07-15 11:45:09 +0000 | [diff] [blame] | 26 | <iframe src="about:blank"></iframe> |
| 27 | %# data-src="<%= $tut_page->query([embedded => 1]) %>"></iframe> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 28 | </div> |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 29 | % 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 Diewald | db03fa9 | 2014-06-23 13:36:55 +0000 | [diff] [blame] | 45 | % } |
| 46 | % else { |
| 47 | % $search_route = url_for('index'); |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 48 | % }; |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 49 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 50 | <div id="top"> |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 51 | <a href="<%= url_for 'index' %>"><h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1></a> |
Nils Diewald | db03fa9 | 2014-06-23 13:36:55 +0000 | [diff] [blame] | 52 | |
Nils Diewald | db03fa9 | 2014-06-23 13:36:55 +0000 | [diff] [blame] | 53 | %= form_for $search_route => begin |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 54 | <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 Diewald | b40ddad | 2014-06-23 15:39:18 +0000 | [diff] [blame] | 57 | % if (stash('test_port')) { |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 58 | <button type="submit" name="action" value="inspect"><i class="fa fa-code"></i></button> |
Nils Diewald | b40ddad | 2014-06-23 15:39:18 +0000 | [diff] [blame] | 59 | % }; |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 60 | </div> |
| 61 | <% if ($location) { %><%== $location %><% } %> |
| 62 | with |
| 63 | <div class="select"> |
Nils Diewald | 13bad6a | 2014-07-18 16:44:51 +0000 | [diff] [blame] | 64 | %= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2'], ['Annis' => 'annis'], ['CQL v1.2' => 'cql']], id => 'ql-field' |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 65 | </div> |
| 66 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 67 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 68 | <div id="button-right"> |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 69 | % unless (current_route 'tutorial') { |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 70 | <button type="button" title="Tutorial" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button> |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 71 | % }; |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 72 | % 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 Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 75 | </div> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 76 | |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 77 | % end |
| 78 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 79 | </div> |
| 80 | |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 81 | %= content 'sidebar' => begin |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 82 | <div id="sidebar"> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 83 | %= include 'collections' |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 84 | <i class="fa fa-bars"></i> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 85 | </div> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 86 | % end |
| 87 | |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 88 | <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 Diewald | 47bdd91 | 2014-07-15 16:31:56 +0000 | [diff] [blame] | 93 | <p>Currently the frontend only supports recent versions of Mozilla Firefox.</p> |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 94 | % end |
| 95 | </main> |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 96 | |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 97 | %= content 'javascript' |
| 98 | %= include 'partial/javascript' |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 99 | %= notifications 'Alertify' |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 100 | </body> |
| 101 | </html> |