Permalink
Browse files

add 404 Not Found page based on the content on sco. Use template for it

  • Loading branch information...
szabgab committed Oct 21, 2014
1 parent 35c3562 commit e865a6c2fd04ac3edb5026180de2b567c73a4763
Showing with 15 additions and 3 deletions.
  1. +3 −2 lib/MetaCPAN/SCO.pm
  2. +11 −0 tt/404.tt
  3. +1 −1 tt/incl/header.tt
View
@@ -27,10 +27,11 @@ sub run {
my $request = Plack::Request->new($env);
if ($request->path_info eq '/') {
return template('index');
return template('index', {front => 1});
}
return [ '404', [ 'Content-Type' => 'text/html' ], ['404 Not Found'], ];
my $reply = template('404');
return [ '404', [ 'Content-Type' => 'text/html' ], $reply->[2], ];
};
builder {
View
@@ -0,0 +1,11 @@
<h1 class=huge>Not found</h1>
<br>
Whatever it was you were looking for, it's not here.
This may be due to...
<ul>
<li>You made a typo in the URL</li>
<li>What you are looking for no longer exists on CPAN</li>
<!-- <li>You are completely confused, which is not my fault :-)</li> -->
<li>You followed an invalid link. If this is the case, please
inform the maintainer of the <a href="/">referring page</a>
</ul>
View
@@ -8,7 +8,7 @@
<link rel="stylesheet" href="http://st.pimg.net/tucs/style.css?3" />
</head>
<body id="cpansearch" onload="document.f.query.focus();" class="front">
<body id="cpansearch" onload="document.f.query.focus();" <% IF front %>class="front"<% END %>>
<div class="header">
<center><div class="logo"><a href="/"><img src="http://st.pimg.net/tucs/img/cpan_banner.png" alt="CPAN"></a></div></center>

0 comments on commit e865a6c

Please sign in to comment.