Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title><%= title %></title> |
| 5 | %= stylesheet '/style.css' |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame^] | 6 | %= stylesheet '/kwic-4.0.css' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 7 | %= stylesheet '/fontawesome/font-awesome.min.css' |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 8 | %= javascript '/jquery-2.0.0.min.js' |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame^] | 9 | %= javascript '/translatehtml.js' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 10 | <meta charset="utf-8" /> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 11 | </head> |
| 12 | <body> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 13 | |
| 14 | <div id="tutorial" style="display: none"> |
| 15 | <i onclick="closeTutorial()" class="fa fa-toggle-up"></i> |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame^] | 16 | <iframe src="about:blank" data-src="<%= url_for(session('tutorial') || 'tutorial') %>"></iframe> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 17 | </div> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 18 | |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame^] | 19 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 20 | <div id="top"> |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame^] | 21 | <h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 22 | %= form_for url_for() => begin |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 23 | %= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2']], id => 'ql-field' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 24 | <br /> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 25 | %= search_field 'q', id => 'q-field' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 26 | <button type="submit" name="action" value="ok"><i class="fa fa-search"></i></button> |
| 27 | <button type="submit" name="action" value="inspect"><i class="fa fa-code"></i></button> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 28 | % end |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 29 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 30 | <div id="button-right"> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 31 | % if (param('q')) { |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 32 | <button type="button" 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> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 33 | % } |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 34 | <button type="button" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button> |
| 35 | </div> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 36 | |
| 37 | </div> |
| 38 | |
| 39 | <div id="sidebar" style="padding-top: 90px"> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 40 | %= include 'collections' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 41 | </div> |
| 42 | |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame^] | 43 | |
| 44 | %# <div> |
| 45 | %#= javascript begin |
| 46 | %# translateTable(); |
| 47 | %# end |
| 48 | %# </div> |
| 49 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 50 | <div id="search"> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 51 | %= content |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 52 | </div> |
| 53 | |
| 54 | %= javascript begin |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 55 | |
| 56 | $("ol > li:not(.active)").on("click", function () { |
| 57 | $(this).addClass('active'); |
| 58 | }); |
| 59 | |
| 60 | function closeSnippet (o) { |
| 61 | $(o.parentNode.parentNode).removeClass('active'); |
| 62 | }; |
| 63 | |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame^] | 64 | |
| 65 | function showTable (o) { |
| 66 | var match = o.parentNode.parentNode; |
| 67 | var corpusID = match.getAttribute('data-corpus-id'); |
| 68 | var docID = match.getAttribute('data-doc-id'); |
| 69 | var matchID = match.getAttribute('data-match-id'); |
| 70 | jQuery.getJSON('/corpus/' + corpusID + '/' + docID + '/' + matchID); |
| 71 | }; |
| 72 | |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 73 | function openTutorial (o) { |
| 74 | var tut = $("#tutorial"); |
| 75 | tut.slideDown(); |
| 76 | var iframe = tut.children("iframe"); |
| 77 | var src = iframe.attr("data-src"); |
| 78 | iframe.attr("src", src); |
| 79 | }; |
| 80 | |
| 81 | function closeTutorial (o) { |
| 82 | $("#tutorial").slideUp(); |
| 83 | }; |
| 84 | |
| 85 | function useQuery (o) { |
| 86 | var q = o.getAttribute("data-query"); |
| 87 | var ql = o.getAttribute("data-query-language"); |
| 88 | $("#ql-field").val(ql); |
| 89 | $("#q-field").val(q); |
| 90 | closeTutorial(); |
| 91 | }; |
| 92 | |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 93 | $("code.query.serial,#sidebar").on("click", function () { |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 94 | $(this).toggleClass('active'); |
| 95 | }); |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 96 | |
| 97 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 98 | % end |
| 99 | |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame^] | 100 | |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 101 | %= notifications 'Alertify' |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 102 | </body> |
| 103 | </html> |