Test user switch
diff --git a/lib/Korap/Search.pm b/lib/Korap/Search.pm
index b8972a0..40d1ffe 100644
--- a/lib/Korap/Search.pm
+++ b/lib/Korap/Search.pm
@@ -7,6 +7,8 @@
$c->layout('default');
$c->title('KorAP');
+ $c->stash(test_port => $c->req->url->to_abs->port == 6666 ? 1 : 0);
+
if ((scalar $c->param('action') // '') eq 'inspect') {
my $api = $c->config('KorAP')->{api};
my $url = Mojo::URL->new($api)->path('resource/query');
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
index 8dfb04c..35a121d 100644
--- a/templates/layouts/default.html.ep
+++ b/templates/layouts/default.html.ep
@@ -98,7 +98,9 @@
% end
<button type="submit" name="action" value="ok"><i class="fa fa-search"></i></button>
+% if (stash('test_port')) {
<button type="submit" name="action" value="inspect"><i class="fa fa-code"></i></button>
+% };
% end
<div id="button-right">
diff --git a/templates/query.html.ep b/templates/query.html.ep
index 3485296..c6c17d5 100644
--- a/templates/query.html.ep
+++ b/templates/query.html.ep
@@ -1,6 +1,6 @@
% use JSON::XS;
-% if (stash('search.query')) {
+% if (stash('search.query') && stash('test_port')) {
% state $json = JSON::XS->new->allow_blessed->pretty;
<code class="query serial<% if (param('action') eq 'inspect') { %> active<% } %>">
<span>JSON-LD Serialization for <%= param 'q' %> (<%= param 'ql' %>)</span>