Minor changes to test svn on korap2
diff --git a/lib/Korap.pm b/lib/Korap.pm
index 9c7ddda..bf61bfa 100644
--- a/lib/Korap.pm
+++ b/lib/Korap.pm
@@ -43,12 +43,11 @@
}
);
- $r->get('/')->to('search#remote');
+ $r->get('/')->to('search#remote')->name('index');
$r->get('/util/query')->to('search#query');
# Tutorial
- $r->get('/tutorial')->to('tutorial#page')->name('tutorial');
- $r->get('/tutorial/(*tutorial)')->to('tutorial#page');
+ $r->get('/tutorial/(*tutorial)', { tutorial => 'start' })->to('tutorial#page')->name('tutorial');
my $collection = $r->route('/collection');
$collection->to('search#info');
diff --git a/lib/Korap/Tutorial.pm b/lib/Korap/Tutorial.pm
index 224190f..2b54e77 100644
--- a/lib/Korap/Tutorial.pm
+++ b/lib/Korap/Tutorial.pm
@@ -3,7 +3,13 @@
sub page {
my $c = shift;
- $c->layout('snippet');
+
+ if ($c->param('snippet')) {
+ $c->layout('snippet');
+ }
+ else {
+ $c->layout('default');
+ };
$c->title('KorAP');
my $page = $c->stash('tutorial');
diff --git a/public/style.css b/public/style.css
index 537c72f..bbb41f3 100644
--- a/public/style.css
+++ b/public/style.css
@@ -234,7 +234,8 @@
padding: 5px;
}
-#tutorial > i {
+#tutorial > i,
+#tutorial > a > i {
font-size: 20pt;
color: #496000;
position: absolute;
@@ -244,6 +245,10 @@
cursor: pointer;
}
+#tutorial > a > i {
+ right: 40pt;
+}
+
#tutorial iframe {
width: 100%;
min-height: 100%;
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
index f7abfb7..2af32a2 100644
--- a/templates/layouts/default.html.ep
+++ b/templates/layouts/default.html.ep
@@ -12,14 +12,17 @@
</head>
<body>
+% unless (current_route 'tutorial') {
<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>
+ % my $tut_page = url_for(session('tutorial') || 'tutorial');
+ <a href="<%= $tut_page %>" target="_blank"><i title="Open in new tab" class="fa fa-external-link-square"></i></a>
+ <i onclick="closeTutorial()" title="close" class="fa fa-toggle-up"></i>
+ <iframe src="about:blank" data-src="<%= $tut_page->query([snippet => 1]) %>"></iframe>
</div>
-
+% };
<div id="top">
- <h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1>
+ <a href="<%= url_for 'index' %>"><h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1></a>
%= form_for url_for() => begin
%= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2']], id => 'ql-field'
<br />
@@ -32,7 +35,9 @@
% if (param('q')) {
<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>
% }
+% unless (current_route 'tutorial') {
<button type="button" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button>
+% };
</div>
</div>