From bc5c0b9e5381a3b51da626dc3e377989be857118 Mon Sep 17 00:00:00 2001 From: Philip Sargent <philip.sargent@klebos.com> Date: Mon, 1 Jun 2020 17:41:41 +0100 Subject: [PATCH] Chng troggle horizontal menu items & svx template --- parsers/survex.py | 1 - templates/base.html | 12 +++++------- templates/expowebbase.html | 19 ++++++++++--------- templates/menu.html | 2 +- urls.py | 24 ++++++++++++------------ 5 files changed, 28 insertions(+), 30 deletions(-) diff --git a/parsers/survex.py b/parsers/survex.py index 31f545b..86c69b0 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -476,7 +476,6 @@ def LoadAllSurvexBlocks(): print("+", file=sys.stderr) sys.stderr.flush(); - # Restore sys.stdout to our old saved file handler sys.stdout = stdout_orig print(' - Loaded All Survex Blocks.') diff --git a/templates/base.html b/templates/base.html index e30cbd5..f9d4bc8 100644 --- a/templates/base.html +++ b/templates/base.html @@ -35,13 +35,11 @@ <a href="{% url "survexcaveslist" %}">All Survex</a> | <a href="{% url "surveyscansfolders" %}">Scans</a> | <a href="{% url "tunneldata" %}">Tunneldata</a> | - <a href="{% url "survexcavessingle" 107 %}">107</a> | - <a href="{% url "survexcavessingle" 161 %}">161</a> | - <a href="{% url "survexcavessingle" 204 %}">204</a> | - <a href="{% url "survexcavessingle" 258 %}">258</a> | - <a href="{% url "survexcavessingle" 264 %}">264</a> | - <a href="{% url "expedition" 2016 %}">Expo2016</a> | - <a href="{% url "expedition" 2017 %}">Expo2017</a> | + <a href="{% url "survexcavessingle" "caves-1623/290/290.svx" %}">290</a> | + <a href="{% url "survexcavessingle" "caves-1623/291/291.svx" %}">291</a> | + <a href="{% url "survexcavessingle" "caves-1626/359/359.svx" %}">359</a> | + <a href="{% url "survexcavessingle" "caves-1623/258/258.svx" %}">258</a> | + <a href="{% url "survexcavessingle" "caves-1623/264/264.svx" %}">264</a> | <a href="{% url "expedition" 2018 %}">Expo2018</a> | <a href="{% url "expedition" 2019 %}">Expo2019</a> | <a href="{% url "expedition" 2020 %}">Expo2020</a> | diff --git a/templates/expowebbase.html b/templates/expowebbase.html index becdb05..4e9e922 100644 --- a/templates/expowebbase.html +++ b/templates/expowebbase.html @@ -1,11 +1,10 @@ +<!DOCTYPE html> <html> <head> - -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>{% block title %}{% endblock %} </title> <link rel="stylesheet" type="text/css" href="../css/main2.css" /> - </head> <body> <div id="mainmenu"> @@ -13,17 +12,19 @@ <li><a href="/index.htm">Expo website home</a></li> <li><a href="/intro.html">Introduction</a></li> <li><a href="/infodx.htm">Main index</a></li> -<li><a href="/indxal.htm">Cave index</a></li> +<li><a href="/caves/">Cave index</a></li> {% if cavepage %} <ul> <li><a href="{% url "survexcaveslist" %}">All Survex</a></li> <li><a href="{% url "surveyscansfolders" %}">Scans</a></li> <li><a href="{% url "tunneldata" %}">Tunneldata</a></li> -<li><a href="{% url "survexcavessingle" 161 %}">161</a></li> -<li><a href="{% url "survexcavessingle" 204 %}">204</a></li> -<li><a href="{% url "survexcavessingle" 258 %}">258</a></li> -<li><a href="{% url "expedition" 2012 %}">Expo2012</a></li> -<li><a href="{% url "expedition" 2013 %}">Expo2013</a></li> +<li><a href="{% url "survexcavessingle" "caves-1623/290/290.svx" %}">290</a></li> +<li><a href="{% url "survexcavessingle" "caves-1623/291/291.svx" %}">291</a></li> +<li><a href="{% url "survexcavessingle" "caves-1626/359/359.svx" %}">359</a></li> +<li><a href="{% url "survexcavessingle" "caves-1623/258/258.svx" %}">258</a></li> +<li><a href="{% url "survexcavessingle" "caves-1623/264/264.svx" %}">264</a></li> +<li><a href="{% url "expedition" 2018 %}">Expo2018</a></li> +<li><a href="{% url "expedition" 2019 %}">Expo2019</a></li> <li><a href="/admin">Django admin</a></li> </ul> {% endif %} diff --git a/templates/menu.html b/templates/menu.html index 374b261..5ff06a1 100644 --- a/templates/menu.html +++ b/templates/menu.html @@ -5,7 +5,7 @@ <li><a href="/handbook/index.htm">Handbook</a></li> <li><a href="/pubs.htm">Reports</a></li> <li><a href="/areas.htm">Areas</a></li> -<li><a href="/indxal.htm">Caves</a></li> +<li><a href="/caves/">Caves</a></li> <li><a href="/expedition/2019">Troggle</a></li> <li><form name=P method=get action="/search" target="_top"> <input id="omega-autofocus" type=search name=P value="testing" size=8 autofocus> diff --git a/urls.py b/urls.py index c21eb27..8b6c4b3 100755 --- a/urls.py +++ b/urls.py @@ -15,21 +15,17 @@ admin.autodiscover() # type url probably means it's used. -# HOW DOES THIS WORK: -# url( <regular expression that matches the thing in the web browser>, +# HOW DOES THIS WORK: +# url( <regular expression that matches the thing in the web browser>, # <reference to python function in 'core' folder>, -# <name optional argument for URL reversing (doesn't do much)>) +# <name optional argument for URL reversing (doesn't do much)>) actualurlpatterns = patterns('', - - url(r'^testingurl/?$' , views_caves.millenialcaves, name="testing"), - - url(r'^millenialcaves/?$', views_caves.millenialcaves, name="millenialcaves"), - url(r'^troggle$', views_other.frontpage, name="frontpage"), + url(r'^troggle$', views_other.frontpage, name="frontpage"), url(r'^todo/$', views_other.todo, name="todo"), - url(r'^caves/?$', views_caves.caveindex, name="caveindex"), + url(r'^caves/?$', views_caves.caveindex, name="caveindex"), url(r'^people/?$', views_logbooks.personindex, name="personindex"), url(r'^newqmnumber/?$', views_other.ajax_QM_number, ), @@ -110,6 +106,10 @@ actualurlpatterns = patterns('', # (r'^personform/(.*)$', personForm), + (r'^expofiles/(?P<path>.*)$', 'django.views.static.serve', + {'document_root': settings.EXPOFILES, 'show_indexes': True}), + (r'^static/(?P<path>.*)$', 'django.views.static.serve', + {'document_root': settings.STATIC_ROOT, 'show_indexes': True}), (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), (r'^tinymce_media/(?P<path>.*)$', 'django.views.static.serve', @@ -123,9 +123,9 @@ actualurlpatterns = patterns('', url(r'^survexfile/(?P<survex_file>.*?)\.err$', views_survex.err), - url(r'^survexfile/caves/$', views_survex.survexcaveslist, name="survexcaveslist"), - url(r'^survexfile/caves/(?P<survex_cave>.*)$', views_survex.survexcavesingle, name="survexcavessingle"), - url(r'^survexfileraw/(?P<survex_file>.*?)\.svx$', views_survex.svxraw, name="svxraw"), + url(r'^survexfile/caves/$', views_survex.survexcaveslist, name="survexcaveslist"), + url(r'^survexfile/(?P<survex_cave>.*)$', views_survex.survexcavesingle, name="survexcavessingle"), + url(r'^survexfileraw/(?P<survex_file>.*?)\.svx$', views_survex.svxraw, name="svxraw"), (r'^survey_files/listdir/(?P<path>.*)$', view_surveys.listdir),