% if ($gallery) { <& header.mas, %ARGS, gallery => $gallery, image => $image &> % } % foreach my $e ( $App->errors ) {

<% $e | h %>

% } % foreach my $msg ( $App->messages ) {

<% $msg | h %>

% } % $m->call_next( gallery => $gallery, image => $image ); <& footer.mas, %ARGS, gallery => $gallery, image => $image &> <%shared> my $view = $App->config->view; $r->content_type( 'text/html; charset=' . $App->config->charset ); my $title; my ( $gallery, $image ); if ( $r->uri =~ m{^/admin} ) { $title = 'Admin'; } else { my $path = $m->dhandler_arg || '/'; ( $gallery, $image ) = Rudesind::UI::new_from_path( $path, $App->config ); $m->redirect( $App->config->uri_root . '/' ) unless $gallery; $title = $image ? $image->title : $gallery->title; } <%method title> <% $title | h %>