Changeset 726

Show
Ignore:
Timestamp:
08/16/02 20:56:50
Author:
miyagawa
Message:

Data::Page 0.13

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Class-DBI-Pager/trunk/Changes

    r723 r726  
    330.02 
    44        * Fixed bug with DESTROY handled by AUTOLOAD 
     5        * Added previous_page, next_page in sync with Data::Page 0.13 
     6          (Thanks to Leon Brocard <acme@astray.com>) 
    57        - onto CPAN 
    68 
  • Class-DBI-Pager/trunk/Makefile.PL

    r723 r726  
    66        'Test::More' => 0.32, 
    77        'Class::DBI' => 0.89, 
    8         'Data::Page' => 0.12
     8        'Data::Page' => 0.13
    99        'Exporter::Lite' => 0.01, 
    1010    }, 
  • Class-DBI-Pager/trunk/README

    r723 r726  
    4343      Matched [% pager.total_entries %] items. 
    4444 
    45       [% WHILE movie = movies.next %] 
     45      [% WHILE (movie = movies.next) %] 
    4646      Title: [% movie.title | html %] 
    4747      [% END %] 
    4848 
    4949      [% num = pager.entries_per_page %] 
    50       [% IF pager.current_page > 1 %] 
    51       <a href="display?page=[% pager.current_page - 1 %]"> 
     50      [% IF pager.previous_page %] 
     51      <a href="display?page=[% pager.previous_page %]"> 
    5252      prev [% num %] items</a> | 
    5353      [% END %] 
    54       [% IF pager.current_page < pager.last_page %] 
    55       <a href="display?page=[% pager.current_page + 1 %]"> 
     54      [% IF pager.next_page %] 
     55      <a href="display?page=[% pager.next_page %]"> 
    5656      next [% num %] items</a> 
    5757      [% END %] 
  • Class-DBI-Pager/trunk/lib/Class/DBI/Pager.pm

    r723 r726  
    2727 
    2828BEGIN { 
    29     my @methods = qw(total_entries entries_per_page current_page first_page last_page first last); 
     29    my @methods = qw(total_entries entries_per_page current_page 
     30                     first_page last_page first last previous_page next_page); 
    3031    for my $method (@methods) { 
    3132        no strict 'refs'; 
     
    114115 
    115116  [% num = pager.entries_per_page %] 
    116   [% IF pager.current_page > 1 %] 
    117   <a href="display?page=[% pager.current_page - 1 %]"> 
     117  [% IF pager.previous_page %] 
     118  <a href="display?page=[% pager.previous_page %]"> 
    118119  prev [% num %] items</a> | 
    119120  [% END %] 
    120   [% IF pager.current_page < pager.last_page %] 
    121   <a href="display?page=[% pager.current_page + 1 %]"> 
     121  [% IF pager.next_page %] 
     122  <a href="display?page=[% pager.next_page %]"> 
    122123  next [% num %] items</a> 
    123124  [% END %] 
  • Class-DBI-Pager/trunk/t/01_pager.t

    r723 r726  
    55    eval "use DBD::SQLite"; 
    66    plan $@ ? (skip_all => 'needs DND::SQLite for testing') 
    7         : (tests => 29); 
     7        : (tests => 36); 
    88} 
    99 
     
    5252    is $pager->first, 1, "first is 1"; 
    5353    is $pager->last, 20, "last is 20"; 
     54    is $pager->previous_page, undef, "previous_page"; 
     55    is $pager->next_page, 2, "next_page"; 
    5456 
    5557    isa_ok $iterator, 'Class::DBI::Iterator'; 
     
    6971    is $pager->first, 41, "first is 41"; 
    7072    is $pager->last, 50, "last is 50"; 
     73    is $pager->previous_page, 2, "previous_page"; 
     74    is $pager->next_page, undef, "next_page"; 
    7175 
    7276    isa_ok $iterator, 'Class::DBI::Iterator'; 
     
    8690    is $pager->first, 1, "first is 1"; 
    8791    is $pager->last, 11, "last is 11"; 
     92    is $pager->previous_page, undef, "previous_page"; 
     93    is $pager->next_page, undef, "next_page"; 
     94 
     95    is $iterator->count, 11, "iterator counts 11"; 
    8896} 
    8997