[Jifty-commit] r7441 - jifty/trunk/lib/Jifty/View/Declare

Jifty commits jifty-commit at lists.jifty.org
Tue Aug 25 02:57:34 EDT 2009


Author: sartak
Date: Tue Aug 25 02:57:33 2009
New Revision: 7441

Modified:
   jifty/trunk/lib/Jifty/View/Declare/CRUD.pm

Log:
Need to use render_mason since we're cross-calling

Modified: jifty/trunk/lib/Jifty/View/Declare/CRUD.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/CRUD.pm	(original)
+++ jifty/trunk/lib/Jifty/View/Declare/CRUD.pm	Tue Aug 25 02:57:33 2009
@@ -834,16 +834,12 @@
 private template 'paging_top' => sub {
     my $self       = shift;
     my $collection = shift;
-    my $page       = shift || 1;
-
-    if ( $collection->pager->last_page > 1 ) {
-        div {
-            { class is 'crud-pages page-count' };
-            outs(
-                _( "Page %1 of %2", $page, $collection->pager->last_page ) );
-            }
-    }
+    my $page       = shift;
 
+    render_mason '/_elements/paging' => {
+        collection => $collection,
+        page       => $page,
+    };
 };
 
 =head2 paging_bottom $collection $page_number
@@ -856,29 +852,10 @@
     my $self       = shift;
     my $collection = shift;
     my $page       = shift;
-    div {
-        { class is 'crud-paging paging' };
-        if ( $collection->pager->previous_page ) {
-            span {
-                { class is 'crud-prev-page' };
-                hyperlink(
-                    label   => _("Previous Page"),
-                    onclick => {
-                        args => { page => $collection->pager->previous_page }
-                    }
-                );
-            }
-        }
-        if ( $collection->pager->next_page ) {
-            span {
-                { class is 'crud-next-page' };
-                hyperlink(
-                    label   => _("Next Page"),
-                    onclick =>
-                        { args => { page => $collection->pager->next_page } }
-                );
-            }
-        }
+
+    render_mason '/_elements/paging' => {
+        collection => $collection,
+        page       => $page,
     };
 };
 


More information about the Jifty-commit mailing list