diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Root.pm | 14 | ||||
-rw-r--r-- | templates/web/default/errors/page_error_410_gone.html | 20 |
2 files changed, 31 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Root.pm b/perllib/FixMyStreet/App/Controller/Root.pm index 830773542..7e2acc03c 100644 --- a/perllib/FixMyStreet/App/Controller/Root.pm +++ b/perllib/FixMyStreet/App/Controller/Root.pm @@ -71,11 +71,12 @@ sub default : Path { $c->detach('/page_error_404_not_found'); } -=head2 page_error_404_not_found +=head2 page_error_404_not_found, page_error_410_gone - $c->detach('/page_error_404_not_found', [ $error_msg ] ); + $c->detach( '/page_error_404_not_found', [$error_msg] ); + $c->detach( '/page_error_410_gone', [$error_msg] ); -Display a 404 page. Pass in an optional error message in an arrayref. +Display a 404 (not found) or 410 (gone) page. Pass in an optional error message in an arrayref. =cut @@ -86,6 +87,13 @@ sub page_error_404_not_found : Private { $c->response->status(404); } +sub page_error_410_gone : Private { + my ( $self, $c, $error_msg ) = @_; + $c->stash->{template} = 'errors/page_error_410_gone.html'; + $c->stash->{error_msg} = $error_msg; + $c->response->status(410); +} + =head2 end Attempt to render a view, if needed. diff --git a/templates/web/default/errors/page_error_410_gone.html b/templates/web/default/errors/page_error_410_gone.html new file mode 100644 index 000000000..c4d5035d8 --- /dev/null +++ b/templates/web/default/errors/page_error_410_gone.html @@ -0,0 +1,20 @@ +[% INCLUDE 'header.html', title => loc('Page Gone') %] + +<h1>[%loc('Page Gone') %]</h1> + +[% IF error_msg %] + <p class="error">[% error_msg | html %]</p> +[% END %] + +<p> + [% + tprintf( + loc("The requested URL '%s' is no longer available"), + c.req.uri + ) + %] +</p> + +[% # FIXME - add more helpful suggestions to this page %] + +[% INCLUDE 'footer.html' %] |