Permalink
Browse files

[November] added (back?) view history

  • Loading branch information...
1 parent 8166dbd commit 8075afb2390f598a3f8e3ff20c476677766665f0 @masak masak committed Nov 18, 2009
Showing with 19 additions and 0 deletions.
  1. +19 −0 lib/November.pm
View
@@ -38,6 +38,7 @@ class November does Session does Cache {
['in'], { self.log_in },
['out'], { self.log_out },
['recent'], { self.list_recent_changes },
+ ['history'], { self.view_page_history(~$^page) },
['all'], { self.list_all_pages },
];
@@ -255,6 +256,24 @@ class November does Session does Cache {
);
}
+ method view_page_history($page is rw = 'Main_Page') {
+ $page .= subst('%20', '_', :g);
+
+ unless $.storage.wiki_page_exists($page) {
+ self.not_found($page);
+ return;
+ }
+
+ my $title = $page.trans( ['_'] => [' '] );
+
+ self.response('page_history.tmpl',
+ {
+ 'TITLE' => $title,
+ 'CHANGES' => self.get_changes($page, limit => 50),
+ }
+ );
+ }
+
method get_changes (:$page, :$limit) {
# RAKUDO: Seemingly impossible to get the right number of list
# containers using an array variable @recent_changes here.

0 comments on commit 8075afb

Please sign in to comment.