]> iEval git - plack-app-gruntmaster.git/commitdiff
Add title to job entries
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 19 Mar 2014 18:04:26 +0000 (20:04 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 19 Mar 2014 18:04:26 +0000 (20:04 +0200)
lib/Gruntmaster/Page/Generic.pm

index 10ed5568e6831b88ea43d0da93b27956dab7016c..fe9525dc44a1feb392f30f290adcdd9450d0896f 100644 (file)
@@ -73,7 +73,7 @@ sub create_thing {
        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";
 }
@@ -89,7 +89,7 @@ sub prefetch;
 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 };
@@ -145,7 +145,7 @@ thing {
 };
 
 thing {
-       params qw/log Job/, 'Job log';
+       params qw/log Job/, 'Job log', 'Job <tmpl_var id>';
        prefetch 'owner', 'problem';
        makers {
                my $env = $_[0];
This page took 0.0281 seconds and 4 git commands to generate.