summaryrefslogtreecommitdiffstats
path: root/lib/Narwhal/Component/Wiki.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Narwhal/Component/Wiki.pm')
-rw-r--r--lib/Narwhal/Component/Wiki.pm37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/Narwhal/Component/Wiki.pm b/lib/Narwhal/Component/Wiki.pm
index 1139301..e3eb254 100644
--- a/lib/Narwhal/Component/Wiki.pm
+++ b/lib/Narwhal/Component/Wiki.pm
@@ -31,6 +31,43 @@ sub page {
);
}
+sub old_page {
+ my $self = shift;
+ my ($req, $page_name, $rev) = @_;
+
+ my $page_rev = $self->lookup($rev);
+ return $req->new_response(404)
+ unless $page_rev;
+
+ $self->render(
+ $req,
+ 'page.tt',
+ {
+ page => $page_name,
+ text => $page_rev->text,
+ author => $page_rev->author,
+ modified => $page_rev->modification_date,
+ historical => 1,
+ },
+ );
+}
+
+sub history {
+ my $self = shift;
+ my ($req, $page_name) = @_;
+
+ my $page = $self->lookup("page:$page_name");
+
+ $self->render(
+ $req,
+ 'history.tt',
+ {
+ page => $page_name,
+ head => $page->current_revision,
+ }
+ );
+}
+
__PACKAGE__->meta->make_immutable;
no Moose;