[Jifty-commit] r3219 - in jifty/trunk: lib/Jifty/View/Declare

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu May 10 14:21:02 EDT 2007


Author: jesse
Date: Thu May 10 14:21:01 2007
New Revision: 3219

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/View/Declare/CRUD.pm

Log:
 r56774 at pinglin:  jesse | 2007-05-08 14:44:48 -0400
 * CRUD builder search works
 


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	Thu May 10 14:21:01 2007
@@ -25,8 +25,27 @@
 }
 
 template 'search' => sub {
+    my $self = shift;
+    my ( $object_type) = ($self->object_type);
+my $search = Jifty->web->new_action(
+    class             => "Search".$object_type,
+    moniker           => "search",
+    sticky_on_success => 1,
+);
+
+div { { class is "jifty_admin" } ;
+    render_action($search);
+
+ $search->button(
+    label   => _('Search'),
+    onclick => {
+        submit  => $search,
+        refresh => Jifty->web->current_region->parent,
+        args    => { page => 1}
+    }
+  );
 
- b{i{   'search goes here.'}};
+ }
 };
 
 template 'view' => sub {
@@ -102,8 +121,9 @@
 
 template 'list' => sub {
     my $self = shift;
-    my ( $object_type, $page, $new_slot_path, $item_path, $search_collection )
-        = ($self->object_type, get(qw(page new_slot_path item_path search_collection)));
+    my ( $object_type) = ($self->object_type);
+    
+    my( $page, $new_slot_path, $item_path, $search_collection )= get(qw(page new_slot_path item_path search_collection));
 
     $item_path ||= $self->fragment_for("view");
 
@@ -115,8 +135,7 @@
         $collection = $collection_class->new();
         $collection->unlimit();
     } else {
-	$collection = $search;
-#        $collection = $search->content('search');
+        $collection = $search->content('search');
     }
 
     $collection->set_page_info(


More information about the Jifty-commit mailing list