/[Arh]/lib/Arh/View/Units.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/Arh/View/Units.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 76 by dpavlin, Fri Apr 11 18:19:30 2008 UTC revision 77 by dpavlin, Fri Apr 18 16:17:31 2008 UTC
# Line 129  private template 'paging_top' => sub { Line 129  private template 'paging_top' => sub {
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 ) {
# Line 143  private template paging_bottom => sub { Line 143  private template paging_bottom => sub {
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 {
# Line 156  private template paging_bottom => sub { Line 171  private template paging_bottom => sub {
171                                  }                                  }
172                          }                          }
173                  }                  }
174                            
175                    outs $t_p;
176    
177                  if ( $collection->pager->next_page ) {                  if ( $collection->pager->next_page ) {
178                          span {                          span {

Legend:
Removed from v.76  
changed lines
  Added in v.77

  ViewVC Help
Powered by ViewVC 1.1.26