17 |
default => '', |
default => '', |
18 |
); |
); |
19 |
|
|
20 |
has 'sort' => ( |
has 'on_page' => ( # FIXME Frey::Web->page, sigh! |
21 |
is => 'rw', |
is => 'rw', |
22 |
isa => 'Str', |
isa => 'Int', |
23 |
|
default => 1, |
24 |
); |
); |
25 |
|
|
26 |
has page => ( |
has 'sort' => ( |
27 |
is => 'rw', |
is => 'rw', |
28 |
isa => 'Int', |
isa => 'Str', |
|
default => 1, |
|
29 |
); |
); |
30 |
|
|
31 |
our $v = { |
our $v = { |
49 |
|
|
50 |
sub results_as_markup { |
sub results_as_markup { |
51 |
my $self = shift; |
my $self = shift; |
|
my $p = {@_}; |
|
52 |
|
|
53 |
my ($search,$page) = ( $p->{search} , $p->{page} ); |
my ($search,$page) = ( $self->search , $self->on_page ); |
54 |
|
|
55 |
sub next_page { |
sub next_page { |
56 |
my ($self) = @_; |
my ($self) = @_; |
85 |
$cond->set_phrase( $search ); |
$cond->set_phrase( $search ); |
86 |
$cond->set_max( $on_page * $page ); ## FIXME * $page is needed by hest 1.3.8 |
$cond->set_max( $on_page * $page ); ## FIXME * $page is needed by hest 1.3.8 |
87 |
$cond->set_skip( $skip ); |
$cond->set_skip( $skip ); |
88 |
$cond->set_order( $p->{sort} ) if ($p->{sort}); |
$cond->set_order( $self->sort ) if $self->sort; |
89 |
|
|
90 |
my $nres = $node->search($cond, ( $self->config->{estraier}->{depth} || 0 ) ); |
my $nres = $node->search($cond, ( $self->config->{estraier}->{depth} || 0 ) ); |
91 |
|
|
187 |
my ($self) = @_; |
my ($self) = @_; |
188 |
|
|
189 |
$self->add_css('static/Frey/NoPager.css'); |
$self->add_css('static/Frey/NoPager.css'); |
190 |
$self->add_css('static/Frey/NoPager.js'); |
$self->add_js ('static/Frey/NoPager.js'); |
191 |
|
|
192 |
$self->add_js(qq| |
$self->add_js(qq| |
193 |
$(document).ready( function() { |
\$(document).ready( function() { |
194 |
$.log.info('hook onchange to #search_form' ); |
\$.log.info('hook onchange to #search_form' ); |
195 |
$('#search_form').change( function() { |
\$('#search_form').change( function() { |
196 |
//logDebug('submit #search_form'); |
//logDebug('submit #search_form'); |
197 |
this.submit(); |
this.submit(); |
198 |
}); |
}); |