From d4317b5fd33961847fda17f3a94afb2f7414b657 Mon Sep 17 00:00:00 2001
From: Philip Sargent <philip.sargent@klebos.com>
Date: Sat, 17 Apr 2021 21:24:37 +0100
Subject: [PATCH] better error pages

---
 templates/errors/generic.html | 28 ++++++++++++++++++++++++
 templates/pagenotfound.html   | 41 ++++++++++++++++++++++++++++++++++-
 2 files changed, 68 insertions(+), 1 deletion(-)

diff --git a/templates/errors/generic.html b/templates/errors/generic.html
index a626a5a..a132ec0 100644
--- a/templates/errors/generic.html
+++ b/templates/errors/generic.html
@@ -1,11 +1,39 @@
 {% extends 'base.html' %}
+{% block extrahead %}
+<style>
+div#editLinks {
+	Zposition:absolute;
+    background: #999;
+	bottom:0px;
+	right:0px;
+	font-family: "Courier New", Courier, monospace;
+	filter:alpha(opacity=75);
+	-moz-opacity:.75;
+	opacity:.75;
+    text-align:right;
+}
 
+div#editLinks a{
+	color:#FFF;
+}
+</style>
+{% endblock %}
 {% block title %}Website Error - {% endblock %}
 {% block content %}
 
 <div class='middle'>
 	<h2>Website Error</h2>
 </div>
+  <div id="editLinks"> {% block loginInfo %}
+    <a href="/">Home</a> |
+    <a id="cuccLink" href="http://camcaving.uk/">CUCC</a> |
+    <a id="expoWebsiteLink" href="http://expo.survex.com">expo.survex</a> |
+    {% if user.username %}User:{{ user.username }}
+    {% if user.person %}(<a href="{{ user.person.get_absolute_url }}">{{ user.person }}</a>){% endif %}
+    | <a <a href='/accounts/logout/'>Log out</a> {% else %} <a href='/accounts/login/'>Log in</a> {% endif %}
+   </div>
+    {% endblock%}
+    
 <div style='width: 300px;'  class='middle3 login'>
 	<div class='align-center'>
 	<div class='space'></div>
diff --git a/templates/pagenotfound.html b/templates/pagenotfound.html
index 514ebf3..d59ffaa 100644
--- a/templates/pagenotfound.html
+++ b/templates/pagenotfound.html
@@ -1,11 +1,50 @@
 <!-- pagenotfound.html - this text visible because this template has been included -->
 {% extends "expobase.html" %}
+{% block extrahead %}
+<style>
+div#editLinks {
+	Zposition:absolute;
+    background: #999;
+	bottom:0px;
+	right:0px;
+	font-family: "Courier New", Courier, monospace;
+	filter:alpha(opacity=75);
+	-moz-opacity:.75;
+	opacity:.75;
+    text-align:right;
+}
+
+div#editLinks a{
+	color:#FFF;
+}
+</style>
+{% endblock %}
 {% block title %}Page not found {{ path }}{% endblock %}
+
 {% block body %}
 <h1>Page not found {{ path }}</h1>
+
+  <div id="editLinks"> {% block loginInfo %}
+    <a href="/">Home</a> |
+    <a id="cuccLink" href="http://camcaving.uk/">CUCC</a> |
+    <a id="expoWebsiteLink" href="http://expo.survex.com">expo.survex</a> |
+    {% if user.username %}User:{{ user.username }}
+    {% if user.person %}(<a href="{{ user.person.get_absolute_url }}">{{ user.person }}</a>){% endif %}
+    | <a <a href='/accounts/logout/'>Log out</a> {% else %} <a href='/accounts/login/'>Log in</a> {% endif %}
+   </div>
+    {% endblock%}
+    
 <p>Probably a mistake. But you can use <a href="{%url "editexpopage" path %}">this link</a>
 <p>
  or 'Edit this page' in the menu on the left to create this page if you are logged in.
- <p>If you can't see that option in the menu, then you are not logged in and you can't create anything.
+ <ul>
+ <li>If you can't see that option in the menu, then you are not logged in and you can't create anything.
+ 
+ <li>You can log on or log off using the gray menu bar above.
+ </ul>
+ 
+ <p>Did you get lost ?
+ 
+ <img align=center src="/handbook/i/204-area.png">
 {% include "menu.html" %}
 {% endblock %}