Skip to content

Commit

Permalink
Make report types editable though the UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
lomky committed Jan 24, 2019
1 parent 58d5b14 commit 6a114f8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Tuba.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
35 changes: 35 additions & 0 deletions lib/Tuba/ReportType.pm
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 6a114f8

Please sign in to comment.