From 38e3bbbaefc4c7bcc13623822b92411661088bc9 Mon Sep 17 00:00:00 2001
From: Ilya Kreymer
Date: Sat, 24 Jan 2015 12:32:50 -0800
Subject: [PATCH] templates: add new 'not_found.html' template, which will be
called for any missing replay request instead of default error.html
'not_found_html' settable in the config per collection, as per #65 for not
found index query, still use query.html but add condition to check for 0
results add more query and replay not found remove unused conditional (for
search_view -- always exists)
---
pywb/ui/error.html | 7 -------
pywb/ui/not_found.html | 10 ++++++++++
pywb/ui/query.html | 6 +++++-
pywb/webapp/handlers.py | 29 ++++++++++++++++++-----------
pywb/webapp/pywb_init.py | 1 +
tests/test_config.yaml | 4 ++++
tests/test_integration.py | 12 ++++++++++++
7 files changed, 50 insertions(+), 19 deletions(-)
create mode 100644 pywb/ui/not_found.html
diff --git a/pywb/ui/error.html b/pywb/ui/error.html
index b122fc38..b3a8c478 100644
--- a/pywb/ui/error.html
+++ b/pywb/ui/error.html
@@ -9,10 +9,3 @@
{% endif %}
-
-{% if env.pywb_proxy_magic and err_url and status == '404 Not Found' %}
-
-Try Different Collection
-
-{% endif %}
-
diff --git a/pywb/ui/not_found.html b/pywb/ui/not_found.html
new file mode 100644
index 00000000..39faa3b3
--- /dev/null
+++ b/pywb/ui/not_found.html
@@ -0,0 +1,10 @@
+Url Not Found
+
+The url {{ url }} could not be found in this collection.
+
+{% if env.pywb_proxy_magic and url %}
+
+Try Different Collection
+
+{% endif %}
+
diff --git a/pywb/ui/query.html b/pywb/ui/query.html
index 2d1f5c86..3e54534b 100644
--- a/pywb/ui/query.html
+++ b/pywb/ui/query.html
@@ -24,7 +24,8 @@ function ts_to_date(ts, is_gmt)
- pywb Sample Calendar Results
+ pywb Query Results
+ {% if cdx_lines | length > 0 %}
{{ cdx_lines | length }} captures of {{ url }}
@@ -47,5 +48,8 @@ function ts_to_date(ts, is_gmt)
* Unique captures are bold. Other captures are duplicates of a previous capture.
+ {% else %}
+ No captures found for {{ url }}
+ {% endif %}