diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-02-18 10:16:53 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-02-18 11:52:22 -0600 |
commit | 1d7c03c912e1064edd8dfb293210a217aba48dd6 (patch) | |
tree | 71e8ebb97cef1dd7ddbb9a4a65bf0f41e2406aaf | |
parent | 62a18e4d0e05f5d8ef18a7c25456213060e39521 (diff) | |
download | narwhal-1d7c03c912e1064edd8dfb293210a217aba48dd6.tar.gz narwhal-1d7c03c912e1064edd8dfb293210a217aba48dd6.zip |
use 'view' instead of 'page' for the action name
-rw-r--r-- | lib/Narwhal.pm | 4 | ||||
-rw-r--r-- | lib/Narwhal/Component/Wiki.pm | 4 | ||||
-rw-r--r-- | lib/Narwhal/Component/Wiki/Edit.pm | 2 | ||||
-rw-r--r-- | root/templates/edit.tt | 2 | ||||
-rw-r--r-- | root/templates/history.tt | 4 | ||||
-rw-r--r-- | root/templates/page.tt | 2 |
6 files changed, 9 insertions, 9 deletions
diff --git a/lib/Narwhal.pm b/lib/Narwhal.pm index 9c0f099..2b4cfa0 100644 --- a/lib/Narwhal.pm +++ b/lib/Narwhal.pm @@ -36,13 +36,13 @@ router as { route '/' => 'redirect.permanent', ( to => '/page/main', ); - route '/page/:page_name' => 'wiki.page', ( + route '/page/:page_name' => 'wiki.view', ( page_name => { isa => 'Str' }, ); route '/edit/:page_name' => 'http-method:edit', ( page_name => { isa => 'Str' }, ); - route '/page/:page_name/:rev' => 'wiki.old_page', ( + route '/page/:page_name/:rev' => 'wiki.view_old', ( page_name => { isa => 'Str' }, rev => { isa => qr/^[0-9a-f]{40}$/ }, ); diff --git a/lib/Narwhal/Component/Wiki.pm b/lib/Narwhal/Component/Wiki.pm index ce1fbbf..f923261 100644 --- a/lib/Narwhal/Component/Wiki.pm +++ b/lib/Narwhal/Component/Wiki.pm @@ -3,7 +3,7 @@ use Moose; with 'Narwhal::Component::Role::Wiki'; -sub page { +sub view { my $self = shift; my ($req, $page_name) = @_; @@ -31,7 +31,7 @@ sub page { ); } -sub old_page { +sub view_old { my $self = shift; my ($req, $page_name, $rev) = @_; diff --git a/lib/Narwhal/Component/Wiki/Edit.pm b/lib/Narwhal/Component/Wiki/Edit.pm index 3631e84..101739e 100644 --- a/lib/Narwhal/Component/Wiki/Edit.pm +++ b/lib/Narwhal/Component/Wiki/Edit.pm @@ -56,7 +56,7 @@ sub post { my $res = $req->new_response(303); $res->location( $req->uri_for({ - action => 'page', + action => 'view', page_name => $page_name, }) ); diff --git a/root/templates/edit.tt b/root/templates/edit.tt index 4b5c811..273145e 100644 --- a/root/templates/edit.tt +++ b/root/templates/edit.tt @@ -1,5 +1,5 @@ [% WRAPPER 'wrappers/root.tt' %] -<p><a href="[% uri_for('action', 'page', 'page_name', page) %]">View</a></p> +<p><a href="[% uri_for('action', 'view', 'page_name', page) %]">View</a></p> <form method="POST" action="[% uri_for('action', 'edit', 'page_name', page) %]"> <textarea name="text" rows="10" cols="30">[% text %]</textarea> <input type="submit" value="Submit" /> diff --git a/root/templates/history.tt b/root/templates/history.tt index 1393b7e..d77358d 100644 --- a/root/templates/history.tt +++ b/root/templates/history.tt @@ -1,9 +1,9 @@ [% WRAPPER 'wrappers/root.tt' %] -<p><a href="[% uri_for('action', 'page', 'page_name', page) %]">View Current</a></p> +<p><a href="[% uri_for('action', 'view', 'page_name', page) %]">View Current</a></p> <ul> [% SET cur = head %] [% WHILE cur %] -<li><a href="[% uri_for('action', 'old_page', 'page_name', page, 'rev', cur.digest) %]">[% cur.author.id %] on [% cur.modification_date %]</a></li> +<li><a href="[% uri_for('action', 'view_old', 'page_name', page, 'rev', cur.digest) %]">[% cur.author.id %] on [% cur.modification_date %]</a></li> [% SET cur = cur.previous_revision %] [% END %] </ul> diff --git a/root/templates/page.tt b/root/templates/page.tt index 69d5213..58c2546 100644 --- a/root/templates/page.tt +++ b/root/templates/page.tt @@ -1,7 +1,7 @@ [% WRAPPER 'wrappers/root.tt' %] [% IF historical %] <p>This is a historical view of this page</p> -<p><a href="[% uri_for('action', 'page', 'page_name', page) %]">View Current</a></p> +<p><a href="[% uri_for('action', 'view', 'page_name', page) %]">View Current</a></p> [% ELSE %] <p><a href="[% uri_for('action', 'edit', 'page_name', page) %]">Edit</a></p> [% END %] |