129 |
private template paging_bottom => sub { |
private template paging_bottom => sub { |
130 |
my $self = shift; |
my $self = shift; |
131 |
my $collection = shift; |
my $collection = shift; |
132 |
my $page = shift; |
my $page = shift || 0; |
133 |
div { |
div { |
134 |
{ class is 'paging' }; |
{ class is 'paging' }; |
135 |
if ( $collection->pager->previous_page ) { |
if ( $collection->pager->previous_page ) { |
143 |
} |
} |
144 |
} |
} |
145 |
|
|
146 |
foreach my $p ( $collection->pager->first_page .. $collection->pager->last_page ) { |
my ( $f_p, $t_p ) = ( '...', '...' ); |
147 |
|
|
148 |
|
my $from = $page - 15; |
149 |
|
if ( $from < 0 ) { |
150 |
|
$from = $collection->pager->first_page; |
151 |
|
$f_p = ''; |
152 |
|
} |
153 |
|
my $to = $page + 15; |
154 |
|
if ( $to > $collection->pager->last_page ) { |
155 |
|
$to = $collection->pager->last_page; |
156 |
|
$t_p = ''; |
157 |
|
} |
158 |
|
|
159 |
|
outs $f_p; |
160 |
|
|
161 |
|
foreach my $p ( $from .. $to ) { |
162 |
if ( $p == $page ) { |
if ( $p == $page ) { |
163 |
b { $p } |
b { $p } |
164 |
} else { |
} else { |
171 |
} |
} |
172 |
} |
} |
173 |
} |
} |
174 |
|
|
175 |
|
outs $t_p; |
176 |
|
|
177 |
if ( $collection->pager->next_page ) { |
if ( $collection->pager->next_page ) { |
178 |
span { |
span { |