morphological view for testbed
diff --git a/templates/collections.html.ep b/templates/collections.html.ep
index cab2ea2..3dee20f 100644
--- a/templates/collections.html.ep
+++ b/templates/collections.html.ep
@@ -1,6 +1,6 @@
<h2>Virtual Collections</h2>
<ul>
-% foreach my $vc (@{info_on 'collection'}) {
+% foreach my $vc (@{resource_info('collection')}) {
<li class="active" title="<%= $vc->{description} // '' %>"><h3><%= $vc->{name} %></h3>
% my $stats = $vc->{stats};
<dl class="info">
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
index c34f35f..f7abfb7 100644
--- a/templates/layouts/default.html.ep
+++ b/templates/layouts/default.html.ep
@@ -3,10 +3,11 @@
<head>
<title><%= title %></title>
%= stylesheet '/style.css'
+%= stylesheet '/table.css'
%= stylesheet '/kwic-4.0.css'
%= stylesheet '/fontawesome/font-awesome.min.css'
%= javascript '/jquery-2.0.0.min.js'
-%= javascript '/translatehtml.js'
+%= javascript '/translateTable.js'
<meta charset="utf-8" />
</head>
<body>
@@ -40,13 +41,6 @@
%= include 'collections'
</div>
-
-%# <div>
-%#= javascript begin
-%# translateTable();
-%# end
-%# </div>
-
<div id="search">
%= content
</div>
@@ -61,13 +55,30 @@
$(o.parentNode.parentNode).removeClass('active');
};
-
function showTable (o) {
var match = o.parentNode.parentNode;
+ var table = $(match).children("div").children("div.tokenInfo").first();
+
+ if (table.hasClass("active")) {
+ table.removeClass("active");
+ return;
+ }
+ else if (table.children("table").length > 0) {
+ table.addClass("active");
+ return;
+ };
+
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);
+ var url = '/corpus/' + corpusID + '/' + docID + '/' + matchID;
+ var snippet;
+
+ jQuery.getJSON(url, function (res) {
+ var snippet = new SnippetTable(res['snippet']);
+ table.addClass("active");
+ table.append(snippet.toTable());
+ });
};
function openTutorial (o) {
diff --git a/templates/search.html.ep b/templates/search.html.ep
index 7cfa791..a409a40 100644
--- a/templates/search.html.ep
+++ b/templates/search.html.ep
@@ -26,12 +26,15 @@
<ol class="left-aligned">
%= search_hits begin
+
<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>
+ <div>
+ <div class="snippet">
+ <%== $_->{snippet} %>
+ </div>
%# as <%= $_->{ID} %>
%# textClass docID
@@ -39,14 +42,28 @@
%# <%= $_ %>
%# };
+ <div class="tokenInfo"></div>
+ </div>
+ <p><strong><%= $_->{title} %></strong><%= $_->{author} ? ' by ' . $_->{author} : '' %>; published on <%= date_format $_->{pubDate} %> as <%= $_->{docID} %> (<%= $_->{corpusID} %>)</p>
+
<ul class="action right">
<li onmouseup="closeSnippet(this)" title="close"><i class="fa fa-toggle-up"></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>
+
+
</li>
% end
</ol>
% end
-% }
+% } else {
+<div id="intro">
+ <p>This is the alternative KorAP Frontend.</p>
+ <p>The primary goal is to serve as a testbed for the query serialization and for different flavours of user interfaces.</p>
+ <p>Search capabilities are limited to the demo user.</p>
+</div>
+% };
diff --git a/templates/tutorial.html.ep b/templates/tutorial.html.ep
index 0c938d1..8179135 100644
--- a/templates/tutorial.html.ep
+++ b/templates/tutorial.html.ep
@@ -2,7 +2,7 @@
<p>Links to Blog, FAQ, About, Contact ...</p>
-<h1>KorAP-Tutorial</h1>
+<h2>KorAP-Tutorial</h2>
<ul>
<li>Introduction to KorAP</li>