--- lib/Grep/Action/Search.pm 2007/02/20 22:44:59 46 +++ lib/Grep/Action/Search.pm 2007/02/21 03:04:48 47 @@ -8,11 +8,27 @@ =cut package Grep::Action::Search; -use base qw/Grep::Action::SearchItem/; + +use Grep::Search; use Data::Dump qw/dump/; use Time::HiRes qw/time/; +use Jifty::Param::Schema; +use Jifty::Action schema { + + param q => + type is 'text', + label is 'Search for', + hint is 'enter few words to search for'; + + param item_fragment => + label is 'Show', + render as 'select', + available are qw/long short title/; + +}; + =head2 take_action =cut @@ -20,11 +36,9 @@ sub take_action { my $self = shift; - my $q = $self->argument_value('content_contains') || warn "can't find content_contains"; - - $self->SUPER::take_action( @_ ); + my $q = $self->argument_value('q') || warn "no q?"; - my $coll = $self->result->content('search'); + my $coll = Grep::Search->collection( $q ); Jifty->log->error('result not collection but ', dump( $coll )) unless ( $coll->isa('Jifty::Collection') ); @@ -37,6 +51,8 @@ $self->result->error('No local results, try remote feeds...'); } + $self->result->content( search => $coll ); + return $coll; }