/[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 67 by dpavlin, Tue Apr 8 23:22:22 2008 UTC revision 72 by dpavlin, Fri Apr 11 18:19:30 2008 UTC
# Line 11  use Data::Dump qw/dump/; Line 11  use Data::Dump qw/dump/;
11  sub object_type { 'Unit' };  sub object_type { 'Unit' };
12    
13  sub per_page {  sub per_page {
14          my $per_page = get('per_page') || 5;          my $per_page = get('per_page') || 3;
15          warn "## Units per_page = $per_page\n";          warn "## Units per_page = $per_page\n";
16          return $per_page;          return $per_page;
17  };  };
# Line 123  private template 'paging_top' => sub { Line 123  private template 'paging_top' => sub {
123                          );                          );
124                  }                  }
125          }          }
126            show( './paging_bottom', $collection, $page );
127    };
128    
129    private template paging_bottom => sub {
130            my $self           = shift;
131            my $collection = shift;
132            my $page           = shift;
133            div {
134                    { class is 'paging' };
135                    if ( $collection->pager->previous_page ) {
136                            span {
137                                    hyperlink(
138                                            label   => _("Previous Page"),
139                                            onclick => {
140                                                    args => { page => $collection->pager->previous_page }
141                                            }
142                                    );
143                            }
144                    }
145    
146                    foreach my $p ( $collection->pager->first_page .. $collection->pager->last_page ) {
147                            if ( $p == $page ) {
148                                    b { $p }
149                            } else {
150                                    span {
151                                            hyperlink(
152                                                    label   => $p,
153                                                    onclick =>
154                                                            { args => { page => $p } }
155                                            );
156                                    }
157                            }
158                    }
159                            
160    
161                    if ( $collection->pager->next_page ) {
162                            span {
163                                    hyperlink(
164                                            label   => _("Next Page"),
165                                            onclick =>
166                                                    { args => { page => $collection->pager->next_page } }
167                                    );
168                            }
169                    }
170            };
171  };  };
172    
173    

Legend:
Removed from v.67  
changed lines
  Added in v.72

  ViewVC Help
Powered by ViewVC 1.1.26