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