routes: add a new 404 page.

* Fix a bug where non-GET 404 requests weren't handled.
* Fix a bug where non-HTML 404 requests weren't handled.
* Show a random image from a specified pool on the 404 page.
This commit is contained in:
evazion
2020-12-24 00:07:19 -06:00
parent 039ccfa3af
commit c17678d509
8 changed files with 76 additions and 37 deletions

View File

@@ -0,0 +1,26 @@
<% page_title "Page not found" %>
<div id="c-static">
<div id="a-not-found">
<div style="text-align: center">
<h1>Page not found</h1>
<% if @post.present? && @artist.present? %>
<p>
<%= link_to @post do %>
<%= tag.img src: @post.large_file_url %>
<% end %>
<p class="fineprint">
<%= link_to "post ##{@post.id}", @post %>
by <%= link_to @artist.name, posts_path(tags: @artist.name), class: tag_class(@artist) %>
</p>
</p>
<% else %>
<p>Nobody here but us chickens!</p>
<% end %>
<p><%= link_to "Return to previous page", :back %></p>
</div>
</div>
</div>