New kwic view
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
index 97c53b4..c34f35f 100644
--- a/templates/layouts/default.html.ep
+++ b/templates/layouts/default.html.ep
@@ -3,21 +3,22 @@
<head>
<title><%= title %></title>
%= stylesheet '/style.css'
-%= stylesheet '/kwic-3.0.css'
+%= stylesheet '/kwic-4.0.css'
%= stylesheet '/fontawesome/font-awesome.min.css'
%= javascript '/jquery-2.0.0.min.js'
+%= javascript '/translatehtml.js'
<meta charset="utf-8" />
</head>
<body>
<div id="tutorial" style="display: none">
<i onclick="closeTutorial()" class="fa fa-toggle-up"></i>
- <iframe src="about:blank" data-src="<%= url_for(session('tutorial') // 'tutorial') %>"></iframe>
+ <iframe src="about:blank" data-src="<%= url_for(session('tutorial') || 'tutorial') %>"></iframe>
</div>
+
<div id="top">
-%#= image '/img/korap-logo.svg', style => 'position: absolute; z-index: 999'
-%= image '/img/korap-logo-solo.svg', style => 'position: absolute; z-index: 999'
+ <h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1>
%= form_for url_for() => begin
%= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2']], id => 'ql-field'
<br />
@@ -39,6 +40,13 @@
%= include 'collections'
</div>
+
+%# <div>
+%#= javascript begin
+%# translateTable();
+%# end
+%# </div>
+
<div id="search">
%= content
</div>
@@ -53,6 +61,15 @@
$(o.parentNode.parentNode).removeClass('active');
};
+
+function showTable (o) {
+ var match = o.parentNode.parentNode;
+ var corpusID = match.getAttribute('data-corpus-id');
+ var docID = match.getAttribute('data-doc-id');
+ var matchID = match.getAttribute('data-match-id');
+ jQuery.getJSON('/corpus/' + corpusID + '/' + docID + '/' + matchID);
+};
+
function openTutorial (o) {
var tut = $("#tutorial");
tut.slideDown();
@@ -73,10 +90,6 @@
closeTutorial();
};
-/*
-function requestInfo
-*/
-
$("code.query.serial,#sidebar").on("click", function () {
$(this).toggleClass('active');
});
@@ -84,6 +97,7 @@
% end
+
%= notifications 'Alertify'
</body>
</html>
diff --git a/templates/search.html.ep b/templates/search.html.ep
index 8ed571b..7cfa791 100644
--- a/templates/search.html.ep
+++ b/templates/search.html.ep
@@ -14,8 +14,6 @@
%= pagination(stash('search.startPage'), $pages, $url)
</div>
-%#= l('Found <span id="total-results">[_1]</span> [quant,_1,match]')
-%#= l('in [_1])
Found <span id="total-results"><%= commify(stash('search.totalResults')) %> matches</span>
% if (stash 'search.bm.hit') {
in <%= stash 'search.bm.hit' %> (<%= stash 'search.bm.result' %>)
@@ -28,19 +26,22 @@
<ol class="left-aligned">
%= search_hits begin
- <li>
+ <li data-corpus-id="<%= $_->{corpusID} %>"
+ data-doc-id="<%= korap_doc_id($_) %>"
+ data-match-id="<%= korap_match_id($_) %>">
%# ID, title, corpusID, author, pubDate, textClass
<div class="snippet"><%== $_->{snippet} %></div>
<p><strong><%= $_->{title} %></strong><%= $_->{author} ? ' by ' . $_->{author} : '' %>; published on <%= date_format $_->{pubDate} %> as <%= $_->{docID} %> (<%= $_->{corpusID} %>)</p>
+
%# as <%= $_->{ID} %>
%# textClass docID
-% foreach (grep { m!/morpho$! } split(/\s+/, $_->{foundries})) {
+%# foreach (grep { m!/morpho$! } split(/\s+/, $_->{foundries})) {
%# <%= $_ %>
-% };
+%# };
<ul class="action right">
<li onmouseup="closeSnippet(this)" title="close"><i class="fa fa-toggle-up"></i></li>
- <li title="Annotations"><i class="fa fa-info-circle"></i></li>
+ <li onclick="showTable(this)" title="Annotations"><i class="fa fa-info-circle"></i></li>
<li title="Tree Visualizations"><i class="fa fa-sitemap"></i></li>
<li title="Remember"><i class="fa fa-star-o"></i></li>
</ul>