add text only render mode for /tree

This commit is contained in:
Aaron Bieber 2022-10-06 20:25:59 -06:00
parent b0598c6775
commit 34a8e6bc5a
No known key found for this signature in database

View File

@ -113,12 +113,19 @@ get '/tree' => sub ($c) {
$c->stash( mtime => $mtime );
my $search = $c->param('name');
my $raw = $c->param('raw');
my $db = $c->sqlports->db;
$c->render(
template => 'tree',
name => $search,
tree => $db->query( $depsQuery, $search )->text
);
if ( $raw ne "" ) {
$c->render( text => $db->query( $depsQuery, $search )->text );
}
else {
$c->render(
template => 'tree',
name => $search,
tree => $db->query( $depsQuery, $search )->text
);
}
};
get '/' => sub ($c) {