| 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 | 5cc4400 | 2014-11-12 02:19:22 +0000 | [diff] [blame] | 6 | %# Background-image | 
| Nils Diewald | 29c0b1d | 2014-11-13 21:14:17 +0000 | [diff] [blame] | 7 | % if (!param('q') && current_route eq 'index') { | 
|  | 8 | <div id="crab-bg"></div> | 
|  | 9 | % }; | 
| Nils Diewald | 5cc4400 | 2014-11-12 02:19:22 +0000 | [diff] [blame] | 10 |  | 
| Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 11 | % my $location; | 
|  | 12 | % my $search_route; | 
| Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 13 | % unless (current_route 'tutorial') { | 
| Nils Diewald | db03fa9 | 2014-06-23 13:36:55 +0000 | [diff] [blame] | 14 | <div id="tutorial"> | 
| Nils Diewald | 4e9fbcb | 2014-07-15 11:45:09 +0000 | [diff] [blame] | 15 | %#   my $tut_page = url_for(session('tutorial') || 'tutorial'); | 
|  | 16 | %#  <a href="<%= $tut_page %>" | 
|  | 17 | %#     target="_blank"><i title="Open in new tab" | 
|  | 18 | %#                        class="fa fa-external-link-square"></i></a> | 
|  | 19 | %# | 
|  | 20 | %#  <a href="javascript:window.open(getTutorialPage())" | 
|  | 21 | %#     target="_blank"><i title="Open in new tab" | 
|  | 22 | %#                        class="fa fa-external-link-square"></i></a> | 
|  | 23 | %= javascript begin | 
|  | 24 | document.write('<a href="' + getTutorialPage().replace(/\?embedded=1/, '') + '" '); | 
|  | 25 | document.write('target="_blank"><i title="Open in new tab" '); | 
|  | 26 | document.write('class="fa fa-external-link-square"></i></a>'); | 
|  | 27 | % end | 
| Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 28 | <i onclick="closeTutorial()" | 
|  | 29 | title="close" | 
|  | 30 | class="fa fa-toggle-up"></i> | 
| Nils Diewald | 4e9fbcb | 2014-07-15 11:45:09 +0000 | [diff] [blame] | 31 | <iframe src="about:blank"></iframe> | 
|  | 32 | %#          data-src="<%= $tut_page->query([embedded => 1]) %>"></iframe> | 
| Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 33 | </div> | 
| Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 34 | %   if (current_route eq 'match') { | 
|  | 35 | %     $search_route = url_for('search_corpus'); | 
|  | 36 | %     $location = 'in corpus <span class="location">' . stash('corpus_id') . '</span>'; | 
|  | 37 | %   } | 
|  | 38 | %   else { | 
|  | 39 | %     $search_route = url_for; | 
|  | 40 | %     if (stash('doc_id')) { | 
|  | 41 | %       $location = ' in document <span class="location">' . stash('corpus_id') . '/' . stash('doc_id') . '</span>'; | 
|  | 42 | %     } | 
|  | 43 | %     elsif (stash('corpus_id')) { | 
|  | 44 | %       $location = ' in corpus <span class="location">' . stash('corpus_id') . '</span>'; | 
|  | 45 | %     } | 
|  | 46 | %     elsif (stash('collection_id')) { | 
|  | 47 | %       $location = ' in collection <span class="location">' . stash('collection_id') . '</span>'; | 
|  | 48 | %     }; | 
|  | 49 | %   } | 
| Nils Diewald | db03fa9 | 2014-06-23 13:36:55 +0000 | [diff] [blame] | 50 | % } | 
|  | 51 | % else { | 
|  | 52 | %   $search_route = url_for('index'); | 
| Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 53 | % }; | 
| Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 54 |  | 
| Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 55 | <div id="top"> | 
| Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 56 | <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] | 57 |  | 
| Nils Diewald | e2c8381 | 2014-11-11 21:13:18 +0000 | [diff] [blame] | 58 | %= form_for $search_route, autocomplete => 'off', begin | 
| Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 59 | <div id="searchbar"> | 
|  | 60 | %= search_field 'q', id => 'q-field', autofocus => 'autofocus', placeholder => 'Find ...' | 
|  | 61 | <button type="submit"><i class="fa fa-search"></i></button> | 
| Nils Diewald | b40ddad | 2014-06-23 15:39:18 +0000 | [diff] [blame] | 62 | %   if (stash('test_port')) { | 
| Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 63 | <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] | 64 | %   }; | 
| Nils Diewald | eca3044 | 2014-11-18 20:33:54 +0000 | [diff] [blame] | 65 | <i onclick="hint.popUp()" class="fa fa-arrow-circle-down show-hint"></i> | 
| Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 66 | </div> | 
|  | 67 | <% if ($location) { %><%== $location %><% } %> | 
|  | 68 | with | 
|  | 69 | <div class="select"> | 
| Nils Diewald | 7e25959 | 2014-11-12 19:04:55 +0000 | [diff] [blame] | 70 | %= 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] | 71 | </div> | 
| Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 72 |  | 
| Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 73 | <div id="button-right"> | 
| Nils Diewald | e8e8805 | 2014-11-10 16:32:02 +0000 | [diff] [blame] | 74 | % unless (param('q')) { param(cutoff => 1) }; | 
|  | 75 | %= check_box cutoff => 1, id => 'q-cutoff-field' | 
|  | 76 | <label for="q-cutoff-field"><span></span>Quick</label> | 
| Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 77 | % unless (current_route 'tutorial') { | 
| Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 78 | <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] | 79 | % }; | 
| Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 80 | % if (param('q')) { | 
|  | 81 | <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> | 
|  | 82 | % } | 
| Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 83 | </div> | 
| Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 84 |  | 
| Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 85 | % end | 
|  | 86 |  | 
| Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 87 | </div> | 
|  | 88 |  | 
| Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 89 | %= content 'sidebar' => begin | 
| Nils Diewald | 7cad840 | 2014-07-08 17:06:56 +0000 | [diff] [blame] | 90 | <div id="sidebar"> | 
| Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 91 | %= include 'collections' | 
| Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 92 | <i class="fa fa-bars"></i> | 
| Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 93 | </div> | 
| Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 94 | % end | 
|  | 95 |  | 
| Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 96 | <main> | 
|  | 97 | %= content main => begin | 
|  | 98 | <p>This is the alternative KorAP Frontend.</p> | 
|  | 99 | <p>The primary goal is to serve as a testbed for the query serialization and for different flavours of user interfaces.</p> | 
|  | 100 | <p>Search capabilities are limited to the demo user.</p> | 
| Nils Diewald | 47bdd91 | 2014-07-15 16:31:56 +0000 | [diff] [blame] | 101 | <p>Currently the frontend only supports recent versions of Mozilla Firefox.</p> | 
| Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 102 | % end | 
|  | 103 | </main> | 
| Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 104 |  | 
| Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 105 | %= content 'javascript' | 
|  | 106 | %= include 'partial/javascript' | 
| Nils Diewald | ca01b76 | 2014-09-08 02:35:20 +0000 | [diff] [blame] | 107 | %= notifications 'Alertify', -no_include | 
| Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 108 | </body> | 
|  | 109 | </html> |