make dynamic content portable using uri_for

This commit is contained in:
Oliver Gorwits
2012-01-18 14:45:53 +00:00
parent b2adf9d839
commit 266faacfe0
16 changed files with 48 additions and 43 deletions

View File

@@ -13,8 +13,13 @@ use Netdisco::Web::Device;
before_template sub {
my $tokens = shift;
# allow portable static content
$tokens->{uri_base} = request->base->path
if request->base->path ne '/';
# allow portable dynamic content
$tokens->{uri_for} = \&uri_for;
};
get '/' => sub {