--- lib/Arh/View/Units.pm 2008/04/11 18:19:30 72 +++ lib/Arh/View/Units.pm 2008/04/18 16:17:31 77 @@ -129,7 +129,7 @@ private template paging_bottom => sub { my $self = shift; my $collection = shift; - my $page = shift; + my $page = shift || 0; div { { class is 'paging' }; if ( $collection->pager->previous_page ) { @@ -143,7 +143,22 @@ } } - foreach my $p ( $collection->pager->first_page .. $collection->pager->last_page ) { + my ( $f_p, $t_p ) = ( '...', '...' ); + + my $from = $page - 15; + if ( $from < 0 ) { + $from = $collection->pager->first_page; + $f_p = ''; + } + my $to = $page + 15; + if ( $to > $collection->pager->last_page ) { + $to = $collection->pager->last_page; + $t_p = ''; + } + + outs $f_p; + + foreach my $p ( $from .. $to ) { if ( $p == $page ) { b { $p } } else { @@ -156,7 +171,8 @@ } } } - + + outs $t_p; if ( $collection->pager->next_page ) { span {