From 6a114f8a32bb795b428964e2cbd5fe6d694d8514 Mon Sep 17 00:00:00 2001 From: Kathryn Tipton Date: Thu, 24 Jan 2019 17:21:55 -0500 Subject: [PATCH] Make report types editable though the UI. --- lib/Tuba.pm | 3 +++ lib/Tuba/ReportType.pm | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 lib/Tuba/ReportType.pm diff --git a/lib/Tuba.pm b/lib/Tuba.pm index 81222170..1658bc60 100644 --- a/lib/Tuba.pm +++ b/lib/Tuba.pm @@ -495,6 +495,9 @@ sub startup { # Roles $r->resource('role_type'); + # Report Type + $r->resource('report_type'); + # Lexicons $r->resource('lexicon'); my $lex = $r->find('select_lexicon'); diff --git a/lib/Tuba/ReportType.pm b/lib/Tuba/ReportType.pm new file mode 100644 index 00000000..8a98b2ff --- /dev/null +++ b/lib/Tuba/ReportType.pm @@ -0,0 +1,35 @@ +=head1 NAME + +Tuba::ReportType : Controller class for report types. + +=cut + +package Tuba::ReportType; +use Mojo::Base qw/Tuba::Controller/; +use Tuba::DB::Objects qw/-nicknames/; + +sub _default_list_order { + return "identifier"; +} + +=head1 show + +Show metadata about a report types. + +=cut + +sub show { + my $c = shift; + my $identifier = $c->stash('report_type_identifier'); + my $meta = ReportType->meta; + my $object = ReportType->new( identifier => $identifier ) + ->load( speculative => 1 ) or return $c->reply->not_found; + $c->stash(object => $object); + $c->stash(meta => $meta); + $c->SUPER::show(@_); +} + + + +1; +