2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-01-19 01:12:32 +00:00

Added a sub menu when in the handbook directory. Imcreased width of edit preview

This commit is contained in:
Martin Green 2022-06-24 15:48:35 +01:00
parent b38412b145
commit ceb6d2fef1
3 changed files with 16 additions and 3 deletions

View File

@ -174,8 +174,10 @@ def expowebpage(request, expowebpath, path):
menumatch = re.match(r'(.*)<ul id="links">', body, re.DOTALL + re.IGNORECASE) menumatch = re.match(r'(.*)<ul id="links">', body, re.DOTALL + re.IGNORECASE)
if menumatch: if menumatch:
has_menu = True has_menu = True
handbook = path.startswith("handbook")
return render(request, 'expopage.html', {'editable': editable, 'path': path, 'title': title, 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): def mediapage(request, subpath=None, doc_root=None):
'''This is for special prefix paths /photos/ /site_media/, /static/ etc. '''This is for special prefix paths /photos/ /site_media/, /static/ etc.

View File

@ -86,7 +86,7 @@
var previewFrame = document.getElementById('preview'); var previewFrame = document.getElementById('preview');
var preview = previewFrame.contentDocument || previewFrame.contentWindow.document; var preview = previewFrame.contentDocument || previewFrame.contentWindow.document;
preview.open(); 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(editor.getValue());
preview.write("</body></html>"); preview.write("</body></html>");
preview.close(); preview.close();

View File

@ -1,7 +1,17 @@
{% if not homepage %} {% if not homepage %}
<div id="menu">
<ul id="links"> <ul id="links">
<li><a href="/index.htm">Home</a></li> <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="/handbook/computing/onlinesystems.html">Online systems</a></li>
<li><a href="/caves">Caves</a></li> <li><a href="/caves">Caves</a></li>
<li><a href="/infodx.htm">Site index</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 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 %} {% if cave_editable %}<li><a href="{% url "edit_cave" cave.slug %}" class="editlink"><strong>Edit this cave</strong></a></li>{% endif %}
</ul> </ul>
</div>
{% endif %} {% endif %}