my $pkg = "Gruntmaster::Page::$ucid";
putsym "${pkg}::_generate", sub { $_[1]->param(list \%thing, @_[2..$#_]) } if makepkg $pkg, @thing{qw/id title/};
- putsym "${pkg}::Entry::_generate", sub { $_[1]->param(entry \%thing, @_[2..$#_]) } if makepkg "${pkg}::Entry", "$thing{id}_entry", '<tmpl_var name>';
+ putsym "${pkg}::Entry::_generate", sub { $_[1]->param(entry \%thing, @_[2..$#_]) } if makepkg "${pkg}::Entry", "$thing{id}_entry", $thing{entry_title} // '<tmpl_var name>';
putsym "${pkg}::Read::generate", sub { [200, headers shift, [encode_json list \%thing, @_]] } if makepkg "${pkg}::Read";
putsym "${pkg}::Entry::Read::generate", sub { [200, headers shift, [encode_json entry \%thing, @_]] } if makepkg "${pkg}::Entry::Read";
}
sub thing (&){
my %thing;
no strict 'refs';
- local *{"params"} = sub { @thing{qw/id rsname title/} = @_ };
+ local *{"params"} = sub { @thing{qw/id rsname title entry_title/} = @_ };
local *{"choose"} = sub { $thing{choose} = shift };
local *{"sortby"} = sub { $thing{sortby} = shift };
local *{"mangle"} = sub { $thing{mangle} = shift };
};
thing {
- params qw/log Job/, 'Job log';
+ params qw/log Job/, 'Job log', 'Job <tmpl_var id>';
prefetch 'owner', 'problem';
makers {
my $env = $_[0];