mirror of
https://github.com/ChaosChemnitz/interfug15
synced 2025-06-28 13:36:07 +02:00
Nur noch ein Handler für alle
This commit is contained in:
parent
1d19edc231
commit
67733986a2
1 changed files with 23 additions and 19 deletions
|
@ -11,24 +11,28 @@ our $PAGES = [
|
||||||
{url => '/tickets', name => 'Tickets'},
|
{url => '/tickets', name => 'Tickets'},
|
||||||
];
|
];
|
||||||
|
|
||||||
get '/' => sub {
|
get qr/.*/ => sub {
|
||||||
template 'home', { pages => $PAGES };
|
my $site = request->path;
|
||||||
};
|
my $found = 0;
|
||||||
|
|
||||||
get '/anreise' => sub {
|
for my $page (@$PAGES) {
|
||||||
template 'anreise', { pages => $PAGES };
|
if ($page->{url} eq "$site") {
|
||||||
};
|
$found = 1;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get '/cfp' => sub {
|
if (!$found) {
|
||||||
template 'cfp', { pages => $PAGES };
|
send_error "Not found", 404;
|
||||||
};
|
}
|
||||||
|
|
||||||
get '/kontakt' => sub {
|
$site = unpack "xA*", $site;
|
||||||
template 'kontakt', { pages => $PAGES };
|
|
||||||
};
|
|
||||||
|
|
||||||
get '/tickets' => sub {
|
if ($site eq '') {
|
||||||
template 'tickets', { pages => $PAGES };
|
$site = 'home';
|
||||||
|
}
|
||||||
|
|
||||||
|
template $site, {pages => $PAGES};
|
||||||
};
|
};
|
||||||
|
|
||||||
true;
|
true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue