X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FPlack%2FApp%2FGruntmaster%2FHTML.pm;h=dc74d87dd2b952a9a4f8ae2da91152e434dce368;hb=ca0c7ea2c90553352245a398f62fcb25c3294c3f;hp=91699e6e7e96f3bb64698403750750ebfee0d992;hpb=c016b64482812bf81dc02402ddc3aa80cfc25cf9;p=gruntmaster-page.git diff --git a/lib/Plack/App/Gruntmaster/HTML.pm b/lib/Plack/App/Gruntmaster/HTML.pm index 91699e6..dc74d87 100644 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@ -234,6 +234,13 @@ sub process_log { $tree->find('table')->find('tbody')->find('tr')->iter3($args{log}, $iter); $args{next_page} ? $tree->fclass('next')->namedlink($args{next_page}, 'Next') : $tree->fclass('next')->detach; $args{previous_page} ? $tree->fclass('previous')->namedlink($args{previous_page}, 'Previous') : $tree->fclass('previous')->detach; + for my $cls (qw/next previous/) { + my $elem = $tree->fclass($cls); + next unless $elem; + delete $args{args}{page}; + my $str = join '&', map { $_ . '=' . $args{args}{$_} } keys %{$args{args}}; + $elem->find('a')->edit_href(sub{s/$/&$str/}); + } $tree->fclass('current')->replace_content("Page $args{current_page} of $args{last_page}"); } @@ -243,7 +250,7 @@ sub process_st { my $pbiter = sub { my ($data, $th) = @_; $th->attr(class => undef); - $th->namedlink($data->id, $data->name); + $th->namedlink(@$data); }; $tree->fclass('problem')->iter3($args{problems}, $pbiter); my $iter = sub {