You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by cu...@apache.org on 2019/05/29 16:36:35 UTC

[whimsy] 02/02: Improved error page base

This is an automated email from the ASF dual-hosted git repository.

curcuru pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit 5ad008b38a76142520b372ab128744dec63014da
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Wed May 29 12:36:25 2019 -0400

    Improved error page base
---
 www/404.cgi | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/www/404.cgi b/www/404.cgi
new file mode 100755
index 0000000..17152eb
--- /dev/null
+++ b/www/404.cgi
@@ -0,0 +1,33 @@
+#!/usr/bin/env ruby
+PAGETITLE = "404 - Not Found Error - Apache Whimsy"
+$LOAD_PATH.unshift '/srv/whimsy/lib'
+require 'wunderbar'
+require 'wunderbar/bootstrap'
+require 'whimsy/asf'
+
+_html do
+  _body? do
+    _whimsy_body(
+    title: PAGETITLE,
+    subtitle: "URL #{ENV['REDIRECT_URL']} Not Found",
+    style: 'panel-danger',
+    related: {
+      "/" => "Whimsy Server Homepage",
+      "/committers/tools" => "Whimsy All Tools Listing",
+      "https://github.com/apache/whimsy/blob/master/www#{ENV['SCRIPT_NAME']}" => "See This Source Code",
+      "mailto:dev@whimsical.apache.org?subject=[SITE] 404 Error Page #{ENV['REDIRECT_URL']}" => "Questions? Email Whimsy PMC"
+    },
+    helpblock: -> {
+      _p do
+        _span.label.label_danger '404'
+        _ " Whatever you're looking for at "
+        _code ENV['REDIRECT_URL'] 
+        _ " is not there.  We'll double-check our crystal balls, but you should probably try another "
+        _a 'magic link.', href: '/'
+      end
+    }
+    ) do
+        # No-op
+    end
+  end
+end