Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 1 | package Korap::Tutorial; |
2 | use Mojo::Base 'Mojolicious::Controller'; | ||||
3 | |||||
4 | sub page { | ||||
5 | my $c = shift; | ||||
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 6 | |
Nils Diewald | 9c90c00 | 2014-11-13 21:21:15 +0000 | [diff] [blame] | 7 | # Redundant in Search |
8 | $c->stash(test_port => ( | ||||
9 | $c->req->url->to_abs->port == 6666 || | ||||
10 | $c->app->mode =~ m/^development|test$/) ? 1 : 0); | ||||
11 | |||||
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 12 | if ($c->param('embedded')) { |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 13 | $c->layout('snippet'); |
Nils Diewald | 4af3f0b | 2014-06-25 01:43:17 +0000 | [diff] [blame] | 14 | $c->stash(embedded => 1); |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 15 | } |
16 | else { | ||||
17 | $c->layout('default'); | ||||
18 | }; | ||||
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 19 | $c->title('KorAP'); |
20 | |||||
21 | my $page = $c->stash('tutorial'); | ||||
Nils Diewald | 4e9fbcb | 2014-07-15 11:45:09 +0000 | [diff] [blame] | 22 | return $c->render(template => 'tutorial/' . $page); |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 23 | }; |
24 | |||||
Nils Diewald | 4e9fbcb | 2014-07-15 11:45:09 +0000 | [diff] [blame] | 25 | |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 26 | 1; |
27 | |||||
28 | |||||
29 | __END__ |