diff options
author | Martin Green <martin.speleo@gmail.com> | 2022-06-24 15:48:35 +0100 |
---|---|---|
committer | Martin Green <martin.speleo@gmail.com> | 2022-06-24 15:48:35 +0100 |
commit | ceb6d2fef174eac9341fd68b89c8fb8bbfaa4ff1 (patch) | |
tree | 155470a5ff5b1fdcdbb1c5ee7ca47f1459746e82 | |
parent | b38412b145fac56f8b3e7ebdd6d213f6bcaeb936 (diff) | |
download | troggle-ceb6d2fef174eac9341fd68b89c8fb8bbfaa4ff1.tar.gz troggle-ceb6d2fef174eac9341fd68b89c8fb8bbfaa4ff1.tar.bz2 troggle-ceb6d2fef174eac9341fd68b89c8fb8bbfaa4ff1.zip |
Added a sub menu when in the handbook directory. Imcreased width of edit preview
-rw-r--r-- | core/views/expo.py | 4 | ||||
-rw-r--r-- | templates/editexpopage.html | 2 | ||||
-rw-r--r-- | templates/menu.html | 13 |
3 files changed, 16 insertions, 3 deletions
diff --git a/core/views/expo.py b/core/views/expo.py index 65b6812..330733e 100644 --- a/core/views/expo.py +++ b/core/views/expo.py @@ -174,8 +174,10 @@ def expowebpage(request, expowebpath, path): menumatch = re.match(r'(.*)<ul id="links">', body, re.DOTALL + re.IGNORECASE) if menumatch: has_menu = True + + handbook = path.startswith("handbook") return render(request, 'expopage.html', {'editable': editable, 'path': path, 'title': title, - 'body': body, 'homepage': (path == "index.htm"), 'has_menu': has_menu}) + 'body': body, 'homepage': (path == "index.htm"), 'has_menu': has_menu, 'handbook': handbook}) def mediapage(request, subpath=None, doc_root=None): '''This is for special prefix paths /photos/ /site_media/, /static/ etc. diff --git a/templates/editexpopage.html b/templates/editexpopage.html index d66c9ca..ef3aa20 100644 --- a/templates/editexpopage.html +++ b/templates/editexpopage.html @@ -86,7 +86,7 @@ var previewFrame = document.getElementById('preview'); var preview = previewFrame.contentDocument || previewFrame.contentWindow.document; preview.open(); - preview.write("<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /><link rel='stylesheet' type='text/css' href='/css/main2.css' /></head><body>"); + preview.write("<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /><link rel='stylesheet' type='text/css' href='/css/main2.css' /> <style type=text/css>body{max-width: none;margin-left: 15px;margin-right: 15px;}</style></head><body>"); preview.write(editor.getValue()); preview.write("</body></html>"); preview.close(); diff --git a/templates/menu.html b/templates/menu.html index ec93869..b02bf76 100644 --- a/templates/menu.html +++ b/templates/menu.html @@ -1,7 +1,17 @@ {% if not homepage %} +<div id="menu"> <ul id="links"> <li><a href="/index.htm">Home</a></li> -<li><a href="/handbook/index.htm">Handbook</a></li> +<li><a href="/handbook/index.htm">Handbook</a> +{% if handbook %} +<ul> + <li><a href="/handbook/rig/rigit.html">Rigging guide</a></li> + <li><a href="/handbook/survey/index.htm">Surveying guide</a></li> + <li><a href="/handbook/look4.htm">Prospecting guide</a></li> + <li><a href="/handbook/rescue.htm">Rescue guide</a></li> + <li><a href="/handbook/photo.htm">Photography guide</a></li> +</ul> +{% endif%}</li> <li><a href="/handbook/computing/onlinesystems.html">Online systems</a></li> <li><a href="/caves">Caves</a></li> <li><a href="/infodx.htm">Site index</a></li> @@ -14,4 +24,5 @@ {% if editable %}<li><a href="{% url "editexpopage" path %}" class="editlink"><strong>Edit this page</strong></a></li>{% endif %} {% if cave_editable %}<li><a href="{% url "edit_cave" cave.slug %}" class="editlink"><strong>Edit this cave</strong></a></li>{% endif %} </ul> +</div> {% endif %} |