Fixed mirroring - made collections work
diff --git a/templates/layouts/main.html.ep b/templates/layouts/main.html.ep
index 9050f77..7f6f811 100644
--- a/templates/layouts/main.html.ep
+++ b/templates/layouts/main.html.ep
@@ -20,13 +20,13 @@
     <div id="kalamar-bg"></div>
 
     % unless ($embedded) {
-    %= include 'partial/header'
+      %= include 'partial/header'
     % }
 
     % my $aside = content_for('sidebar');
     <aside tabindex="0" class="<% unless (length($aside) > 0) { %>off<% } elsif (stash('sidebar_active')) { %>active<% } %>">
       <div>
-    %= $aside
+      %= $aside
       </div>
     </aside>
 
@@ -40,6 +40,6 @@
       <%= doc_link_to 'V '. $Kalamar::VERSION, 'korap', 'kalamar' %>
     </footer>
     % };
-%= notifications 'Kalamar::Plugin::Notifications'
+    %= notifications 'Kalamar::Plugin::Notifications'
   </body>
 </html>
diff --git a/templates/query.html.ep b/templates/query.html.ep
index a25a5e5..b3e52fd 100644
--- a/templates/query.html.ep
+++ b/templates/query.html.ep
@@ -1,9 +1,9 @@
-% use Mojo::JSON;
+% use Mojo::JSON 'encode_json';
 
-%= javascript begin
- KorAP.currentQuery = <%== Mojo::JSON::encode_json(search->query_jsonld) %>;
-% end
-
-<pre>
-%== search->api_response
-</pre>
+% if (search->api_response) {
+%=  javascript begin
+%   my $kq_hash = search->api_response;
+%   $kq_hash->{matches} = ["..."];
+  KorAP.koralQuery = <%= b(encode_json($kq_hash))->decode %>;
+%   end
+% };
diff --git a/templates/search.html.ep b/templates/search.html.ep
index 47ec86a..f34f00f 100644
--- a/templates/search.html.ep
+++ b/templates/search.html.ep
@@ -1,5 +1,4 @@
 % layout 'main', title => loc('searchtitle', q => search->query, ql => search->query_language);
-% use Mojo::JSON 'encode_json';
 
 <div class="resultinfo">
   <div id="pagination"><%= pagination(search->start_page, search->total_pages, url_with->query(['p' => '{page}'])) =%></div>
@@ -17,12 +16,7 @@
 % };
 </div>
 
-% if (search->collection_jsonld) {
-%=  javascript begin
-KorAP.currentVC = <%== encode_json search->collection_jsonld %>;
-%   end
-% };
-
+%= include 'query'
 
 <div id="search">
 % if (search->total_results != 0 && search->results->size) {
@@ -35,5 +29,3 @@
 <p id="no-results"><%== loc 'noMatches', q => search->query %></p>
 % }
 </div>
-
-%= include 'query'