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 | 4af3f0b | 2014-06-25 01:43:17 +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 | <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 Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 19 | </div> |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame^] | 20 | % 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 Diewald | db03fa9 | 2014-06-23 13:36:55 +0000 | [diff] [blame] | 36 | % } |
| 37 | % else { |
| 38 | % $search_route = url_for('index'); |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 39 | % }; |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 40 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 41 | <div id="top"> |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 42 | <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] | 43 | |
Nils Diewald | db03fa9 | 2014-06-23 13:36:55 +0000 | [diff] [blame] | 44 | %= form_for $search_route => begin |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame^] | 45 | <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 Diewald | b40ddad | 2014-06-23 15:39:18 +0000 | [diff] [blame] | 48 | % if (stash('test_port')) { |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame^] | 49 | <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] | 50 | % }; |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame^] | 51 | </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 Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 58 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 59 | <div id="button-right"> |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 60 | % unless (current_route 'tutorial') { |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame^] | 61 | <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] | 62 | % }; |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame^] | 63 | % 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 Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 66 | </div> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 67 | |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame^] | 68 | % end |
| 69 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 70 | </div> |
| 71 | |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 72 | %= content 'sidebar' => begin |
Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame^] | 73 | <div id="sidebar"> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 74 | %= include 'collections' |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 75 | <i class="fa fa-bars"></i> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 76 | </div> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 77 | % end |
| 78 | |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 79 | <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 Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 86 | |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 87 | %= content 'javascript' |
| 88 | %= include 'partial/javascript' |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 89 | %= notifications 'Alertify' |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 90 | </body> |
| 91 | </html> |