[Jifty-commit] r6095 - wifty/trunk/lib/Wifty

Jifty commits jifty-commit at lists.jifty.org
Fri Dec 12 11:27:37 EST 2008


Author: ruz
Date: Fri Dec 12 11:27:37 2008
New Revision: 6095

Modified:
   wifty/trunk/lib/Wifty/Dispatcher.pm

Log:
* add feeds to the dispatcher

Modified: wifty/trunk/lib/Wifty/Dispatcher.pm
==============================================================================
--- wifty/trunk/lib/Wifty/Dispatcher.pm	(original)
+++ wifty/trunk/lib/Wifty/Dispatcher.pm	Fri Dec 12 11:27:37 2008
@@ -93,17 +93,24 @@
 };
 
 # Show recent edits
+under 'feeds/atom/recent', run {
+    set pages => recent_changes();
+};
 on 'recent*', run {
+    set pages => recent_changes();
+};
+
+sub recent_changes {
     my $then = DateTime->from_epoch( epoch => ( time - ( 86400 * 7 ) ) );
     my $pages = Wifty::Model::PageCollection->new();
     $pages->limit(
         column   => 'updated',
         operator => '>',
-        value    => $then->ymd
+        value    => $then->ymd,
     );
     $pages->order_by( column => 'updated', order => 'desc' );
-    set pages => $pages;
-};
+    return $pages;
+}
 
 sub setup_page_nav {
     my ($prefix, $page, $rev) = @_;


More information about the Jifty-commit mailing list