diff options
-rw-r--r-- | core/views/prospect.py | 16 | ||||
-rw-r--r-- | templates/errors/disabled.html | 50 |
2 files changed, 65 insertions, 1 deletions
diff --git a/core/views/prospect.py b/core/views/prospect.py index 880c8d0..aaefc11 100644 --- a/core/views/prospect.py +++ b/core/views/prospect.py @@ -52,8 +52,22 @@ def prospecting(request): '''This produces the multipage 'prospecting guide' document, intended to be printed and carried into the field - in 1999. - All the formatting and selection clverness is in the template file. + All the formatting and selection cleverness is in the template file. + + This produces a vast number of bad 404 URLs as many URLs in the cave_data + XML files refer to other caves, assuming that they are in the same directory + as the prospecting guide. But since the introduction of the 1623/ level, this is + not true. e.g. 163 refers to 162 as href="../162.htm" which is valid in the cave + description page but not when navigating from the prospecting guide page. + + Since this vast number of broken links is getting in the way of finding real errors, the guide + has been disabled. ''' + message = f'This prospecting guide text report contains many broken URLs because of a major redesign\n' +\ + ' to put caves into 1623/ and 1624/ folders in 2017. It was mostly useless because recent QM info was not in it anyway.\n\n' +\ + 'It is disabled in the python code in "prospecting(request):" in troggle/core/views/prospect.py' + return render(request,'errors/disabled.html', {'message': message}) + areas = [] for key, name in AREANAMES: a = Area.objects.get(short_name = key) # assumes unique diff --git a/templates/errors/disabled.html b/templates/errors/disabled.html new file mode 100644 index 0000000..e625dc5 --- /dev/null +++ b/templates/errors/disabled.html @@ -0,0 +1,50 @@ +{% extends 'base.html' %} + +{% block title %}Troggle Disabled Page{% endblock %} +{% block content %} + +<div class='middle'> + <h2>Troggle Page Disabled</h2> +</div> + + +<div class='middle3 login'> + <div class='space'></div> + <div class='align-center'> + <h3>DISABLED PAGE.</h3> + <h4> + + <font color="red"> + {% if message %} + <pre> + {{message}} + </pre> + {% else %} + <p>This page is disabled. This is not an error. Consult a nerd to find out why.</p> + + {% endif %} + </font> + </h4> + <div class='space'><p> </div> + + <h3>What you should do now</h3> + <p>If you want to find out why, email the nerds at + <a href="mailto:expo-tech@lists.wookware.org">expo-tech@lists.wookware.org</a> with this information: + <ol> + <li>The error message written in <font color="red">red</font> above. + <li>The previous page URL: <font color="red"> +<script type="text/javascript"> + document.write(document.referrer); +</script></font> + <li>Go back to this previous page <script type="text/javascript"> + document.write("<a href='",document.referrer,"'>",document.referrer,"</a>"); + </script> + and see if you can tell whether the bad page reference was in HTML text which had been written manually, or whether it appeared to be a programming error. + </ol> + + + </div> +</div> +</div> + +{% endblock %}
\ No newline at end of file |