diff --git a/lib/PostText.pm b/lib/PostText.pm index 33e573b..17145e0 100644 --- a/lib/PostText.pm +++ b/lib/PostText.pm @@ -150,9 +150,9 @@ sub startup($self) { return undef; }); - $moderator->get('/list') - ->to('moderator#list') - ->name('mod_list'); + $moderator->get('/flagged') + ->to('moderator#flagged') + ->name('flagged_list'); } 1; diff --git a/lib/PostText/Controller/Moderator.pm b/lib/PostText/Controller/Moderator.pm index 9642940..b7c987e 100644 --- a/lib/PostText/Controller/Moderator.pm +++ b/lib/PostText/Controller/Moderator.pm @@ -8,7 +8,7 @@ sub login($self) { my $v; #Already logged in? - return $self->redirect_to('mod_list') if $self->is_mod; + return $self->redirect_to('flagged_list') if $self->is_mod; $v = $self->validation if $self->req->method eq 'POST'; @@ -35,7 +35,7 @@ sub login($self) { ); $self->flash(info => "Hello, $mod_name 😎"); - return $self->redirect_to('mod_list'); + return $self->redirect_to('flagged_list'); } else { $self->stash( diff --git a/t/moderator.t b/t/moderator.t index ad72e8f..a4b639b 100644 --- a/t/moderator.t +++ b/t/moderator.t @@ -29,15 +29,15 @@ subtest Login => sub { $t->post_ok('/login', form => \%valid_login) ->status_is(302) - ->header_like(Location => qr{moderator/list}); + ->header_like(Location => qr{moderator/flagged}); - $t->get_ok('/moderator/list') + $t->get_ok('/moderator/flagged') ->status_is(200) - ->text_like(h2 => qr/Top Secret/); + ->text_like(h2 => qr/Flagged Posts/); $t->get_ok('/login') ->status_is(302) - ->header_like(Location => qr{moderator/list}); + ->header_like(Location => qr{moderator/flagged}); $t->get_ok('/logout') ->status_is(302) diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index 716f431..5a0eeab 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -7,10 +7,16 @@

Post::Text

+<% if (is_mod) { =%> + +<% } =%>
<% if (flash 'error') { =%>

<%= flash 'error' %>

diff --git a/templates/moderator/flagged.html.ep b/templates/moderator/flagged.html.ep new file mode 100644 index 0000000..3744bc3 --- /dev/null +++ b/templates/moderator/flagged.html.ep @@ -0,0 +1,4 @@ +% layout 'default'; +% title 'Flagged Posts'; +

<%= title %>

+

Coming soon, stay tuned.

diff --git a/templates/moderator/list.html.ep b/templates/moderator/list.html.ep deleted file mode 100644 index 8200e46..0000000 --- a/templates/moderator/list.html.ep +++ /dev/null @@ -1,5 +0,0 @@ -% layout 'default'; -% title 'Top Secret'; -

<%= title %>

-

For mods only!!

-<%= link_to Logout => 'mod_logout' %>