From 34a8e6bc5af8f7995cf6f9d2beaa6d1a48125df0 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Thu, 6 Oct 2022 20:25:59 -0600 Subject: [PATCH] add text only render mode for /tree --- openbsd.app.pl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/openbsd.app.pl b/openbsd.app.pl index 0654b28..665e493 100755 --- a/openbsd.app.pl +++ b/openbsd.app.pl @@ -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) {