[Jifty-commit] r2033 - in wifty/trunk: lib/Wifty
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Thu Oct 19 16:58:14 EDT 2006
Author: nelhage
Date: Thu Oct 19 16:58:13 2006
New Revision: 2033
Modified:
wifty/trunk/lib/Wifty/Dispatcher.pm
wifty/trunk/share/web/templates/_elements/nav
Log:
Adding a simplistic search page to Wifty
Modified: wifty/trunk/lib/Wifty/Dispatcher.pm
==============================================================================
--- wifty/trunk/lib/Wifty/Dispatcher.pm (original)
+++ wifty/trunk/lib/Wifty/Dispatcher.pm Thu Oct 19 16:58:13 2006
@@ -69,6 +69,19 @@
set pages => $pages;
};
+on 'search', run {
+ my $search = Jifty->web->response->result('search');
+ my $collection = undef;
+ if($search) {
+ $collection = $search->content('search');
+ }
+ my $action = Jifty->web->new_action(class => 'SearchPage', moniker => 'search');
+ $action->sticky_on_success(1);
+
+ set search => $action;
+ set pages => $collection;
+};
+
# Show recent edits
on 'recent', run {
my $then = DateTime->from_epoch( epoch => ( time - ( 86400 * 7 ) ) );
Modified: wifty/trunk/share/web/templates/_elements/nav
==============================================================================
--- wifty/trunk/share/web/templates/_elements/nav (original)
+++ wifty/trunk/share/web/templates/_elements/nav Thu Oct 19 16:58:13 2006
@@ -2,6 +2,7 @@
my $top = Jifty->web->navigation;
$top->child( Home => url => "/", sort_order => 1 );
$top->child( Recent => url => "/recent", label => "Recent Changes", sort_order => 2 );
+$top->child( Search => url => "/search", label => "Search", sort_order => 3 );
if ( Jifty->config->framework('AdminMode') ) {
$top->child( Administration => url => "/__jifty/admin/", sort_order => 998);
More information about the Jifty-commit
mailing list