projects
/
gruntmaster-page.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed "Page 1 of 0" in job log
[gruntmaster-page.git]
/
lib
/
Plack
/
App
/
Gruntmaster
/
HTML.pm
diff --git
a/lib/Plack/App/Gruntmaster/HTML.pm
b/lib/Plack/App/Gruntmaster/HTML.pm
index 7a980737a7fd4eb5fe6da2a7bcf075d0e1845956..40b47a7494568448be9eb768bdaf50146a1e490b 100644
(file)
--- a/
lib/Plack/App/Gruntmaster/HTML.pm
+++ b/
lib/Plack/App/Gruntmaster/HTML.pm
@@
-4,6
+4,7
@@
use parent qw/Exporter/;
our @EXPORT = qw/render render_article/;
use File::Slurp qw/read_file/;
our @EXPORT = qw/render render_article/;
use File::Slurp qw/read_file/;
+use List::Util qw[min max];
use HTML::Element::Library;
use HTML::TreeBuilder;
use POSIX qw//;
use HTML::Element::Library;
use HTML::TreeBuilder;
use POSIX qw//;
@@
-276,7
+277,9
@@
sub process_log {
my $str = join '&', map { $_ . '=' . $args{args}{$_} } keys %{$args{args}};
$elem->find('a')->edit_href(sub{s/$/&$str/}) if $str;
}
my $str = join '&', map { $_ . '=' . $args{args}{$_} } keys %{$args{args}};
$elem->find('a')->edit_href(sub{s/$/&$str/}) if $str;
}
- $tree->fclass('current')->replace_content("Page $args{current_page} of $args{last_page}");
+
+ my $total_pages = max(1, $args{last_page});
+ $tree->fclass('current')->replace_content("Page $args{current_page} of $total_pages");
}
sub process_st {
}
sub process_st {
This page took
0.010089 seconds
and
4
git commands to generate.