11
0
Fork 0
mirror of https://github.com/ChaosChemnitz/interfug15 synced 2025-06-28 13:36:07 +02:00
interfug15_github/lib/ChaosChemnitz/Interfug15/Webseite.pm
2015-06-22 13:44:31 +02:00

38 lines
726 B
Perl

package ChaosChemnitz::Interfug15::Webseite;
use Dancer2;
our $VERSION = '0.1';
our $PAGES = [
{url => '/', name => 'Startseite'},
{url => '/anreise', name => 'Anreise'},
{url => '/cfp', name => 'Call for Papers'},
{url => '/kontakt', name => 'Kontakt'},
{url => '/tickets', name => 'Tickets'},
];
get qr/.*/ => sub {
my $site = request->path;
my $found = 0;
for my $page (@$PAGES) {
if ($page->{url} eq "$site") {
$found = 1;
last;
}
}
if (!$found) {
send_error "Not found", 404;
}
$site = substr $site, 1;
if ($site eq '') {
$site = 'home';
}
template $site, {pages => $PAGES};
};
true;