summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-01-28 15:38:37 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2025-01-28 15:38:37 +0000
commit11cf61b0a340ff102e843655a7c408f0a4e3c16f (patch)
treec01f532abd7065d43678999e63f0f836e51efee1
parentbac65b58972ea6143d6e6a53e4d12543c8dd1c84 (diff)
downloadtroggle-11cf61b0a340ff102e843655a7c408f0a4e3c16f.tar.gz
troggle-11cf61b0a340ff102e843655a7c408f0a4e3c16f.tar.bz2
troggle-11cf61b0a340ff102e843655a7c408f0a4e3c16f.zip
Put troggle reports menu on troggle handbook pages
-rw-r--r--core/views/expo.py8
-rw-r--r--templates/base.html45
-rw-r--r--templates/expobase.html6
-rw-r--r--templates/expopage.html20
-rw-r--r--templates/menu.html3
-rw-r--r--templates/troggletoolbar.html33
6 files changed, 72 insertions, 43 deletions
diff --git a/core/views/expo.py b/core/views/expo.py
index 821decc..9089481 100644
--- a/core/views/expo.py
+++ b/core/views/expo.py
@@ -228,7 +228,7 @@ def expowebpage(request, expowebpath, path):
else:
editable = os.access(expowebpath / path, os.W_OK) # are file permissions writeable?
# print(f"EDITABLE ? {editable}\n{head}")
- has_menu = False
+ has_menu = False # this is the old-style AERW-era hand-coded menu on each individual page
menumatch = re.match(r'(.*)<ul id="links">', body, re.DOTALL + re.IGNORECASE)
if menumatch:
has_menu = False
@@ -248,8 +248,8 @@ def expowebpage(request, expowebpath, path):
else:
year = None
- # Determine if this page is part of the handbook
- handbook = path.startswith("handbook")
+ # Determine if this page is part of the troggle handbook
+ troggle = path.startswith("handbook/troggle")
return render(
request,
@@ -262,8 +262,8 @@ def expowebpage(request, expowebpath, path):
"homepage": (path == "index.htm"),
"has_menu": has_menu,
"year": year,
- "handbook": handbook,
"parent_caves": parent_caves,
+ "troggle": troggle,
},
)
diff --git a/templates/base.html b/templates/base.html
index 6434d1d..27a78df 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -25,46 +25,20 @@
<a href="/">Home</a> |
<a id="cuccLink" href="http://camcaving.uk/">CUCC</a> |
<a id="expoWebsiteLink" href="http://expo.survex.com">expo.survex</a> |
- <a id="handbook" href="/handbook/computing/onlinesystems.html">Handbook</a> |
- {% if user.username %}User:{{ user.username }}
- {% if user.person %}(<a href="{{ user.person.get_absolute_url }}">{{ user.person }}</a>){% endif %}
- | <a href='/accounts/logout/'>Log out</a> {% else %} <a href='/accounts/register/'>Register</a> | <a href='/accounts/login/'>Log in</a> {% endif %}
+ <a id="handbook" href="/handbook/index.htm">Handbook</a> |
+ {% if user.person %}User:(<a href="{{ user.person.get_absolute_url }}">{{ user.person }}</a>)
+ | <a href='/accounts/logout/'>Log out</a>
+ {% elif user.username %}User:{{ user.username }}
+ | <a href='/accounts/logout/'>Log out</a>
+ {% else %}
+ | <a href='/accounts/login/'>Log in</a>
+ {% endif %}
+ | <a href='/accounts/register/'>Register</a>
{% endblock%}
</div>
</div>
-{% if settings.DEVSERVER %}
-<div class="toolbarlinkslocal">
-{% else %}
-<div class="toolbarlinks">
-{% endif %}
- <a href="/logbookedit/">Logbook Entry</a> |
- <!--<a href="/1626/359/359.html">359 (HC)</a> |-->
- <a id="cavesLink" href="/caves">Caves</a> |
- <a id="qmsLink" href="{% url "caveQMs" "1623-290" %}">QMs</a> |
- <a href="/survexfile/">Survex</a> |
- <a href="{% url "survexcaveslist" %}">All Survex</a> |
- <a href="{% url "allscans" %}">Scans</a> |
- <a href="{% url "walletedit" %}">Upload Scans</a> |
- <a href="{% url "dwgallfiles" %}">Drawings</a> |
- <a href="{% url "dwgupload" %}">Upload Drawings</a> |
- <a href="{% url "photoupload" %}">Upload Photos</a> |
- <a href="{% url "gpxupload" %}">Upload GPX</a> |
- <br>
-
- <a href="{% url "dataissues" %}">Data Issues</a> |
- <a href="/handbook/computing/todo-data.html">tasks to do </a> |
- <a id="entsLink" href="{% url "entranceindex" %}">ents</a> |
- <a id="folklink" href="/folk">expoers</a> |
- <a id="caversLink" href="{% url "notablepersons" %}">survey lengths</a> |
- <a href="{% url "stats" %}">statistics</a> |
- <a href="/survexfilewild/{{current_year}}">Wild Survex({{current_year}})</a> |
- <a href="/wallets/year/{{current_year}}">Wallets({{current_year}})</a> |
- <a href="{% url "expedition" current_year %}">Expo({{current_year}})</a> |
- <a href="{% url "controlpanel" %}">Control panel</a> |
-
-</div>
<div id="nav">
{% block nav %}
@@ -81,6 +55,7 @@
{% block related %}
{% endblock %}
</div>
+ {% include 'troggletoolbar.html' %}
{% block content %}
REPLACE : The content
{% endblock %}
diff --git a/templates/expobase.html b/templates/expobase.html
index 689bd66..1e9c7da 100644
--- a/templates/expobase.html
+++ b/templates/expobase.html
@@ -1,6 +1,7 @@
+<!DOCTYPE html>
<!-- expobase.html - this text visible because this template has been included -->
{% autoescape off %}
-<html>
+<html lang="en">
<head>
<script>document.interestCohort = null;</script> <!-- Turn off Google FLoC -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@@ -9,6 +10,9 @@
{% block extrahead %}{% endblock %}
</head>
<body {% block bodyattrs %}{% endblock %}>
+{% if troggle %}
+{% include 'troggletoolbar.html' %}
+{% endif %}
{% block body %}{% endblock %}
</body>
</html>
diff --git a/templates/expopage.html b/templates/expopage.html
index 912fe5a..e1d5ad1 100644
--- a/templates/expopage.html
+++ b/templates/expopage.html
@@ -2,8 +2,24 @@
{% extends "expobase.html" %}
{% block title %}{{ title }}{% endblock %}
{% block bodyattrs %}{% if homepage %} id="homepage"{% endif %}{% endblock %}
+
{% block body %}
+{% if troggle %}
+<style>
+ h2#tophead {
+ margin-top: 5px;
+ margin-bottom: 20px;
+ margin-right: -22px;
+ margin-left: 0px;
+ }
+ h1 {
+ margin-top: 30px;
+ display: block;
+ }
+</style>
+{% endif %}
{{ body|safe }}
+
{% if homepage %}
{% if editable %}
<a href="{% url "editexpopage" path %}">Edit</a>
@@ -12,7 +28,9 @@
{% if not has_menu %}
{% include "menu.html" %}
{% else %}
- {% 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 %}
{% endif %}
{% endif %}
{% endblock %}
diff --git a/templates/menu.html b/templates/menu.html
index cda2740..724f8b4 100644
--- a/templates/menu.html
+++ b/templates/menu.html
@@ -47,8 +47,7 @@
<ul><li><a href="/years/{{current_year}}">{{ year }}</a></li></ul>
{% endif %}
<!--<li><a href="/guidebook/areas.htm">Areas</a></li>-->
-<li><a href="/expedition/{{current_year}}">Troggle</a></li>
-<li><a href="/handbook/troggle/training/trogbegin.html"><span style="color:red">Self-training</span></a></li>
+<li><a href="/handbook/troggle/training/trogbegin.html">Troggle</a></li>
<li><form name=P method=get action="/search" target="_top">
<input id="omega-autofocus" type=search name=P size=8 autofocus>
diff --git a/templates/troggletoolbar.html b/templates/troggletoolbar.html
new file mode 100644
index 0000000..53f9ea0
--- /dev/null
+++ b/templates/troggletoolbar.html
@@ -0,0 +1,33 @@
+<link rel="stylesheet" type="text/css" href="{{ settings.MEDIA_URL }}css/trog3.css" title="troggle-style"/>
+{% if settings.DEVSERVER %}
+<div class="toolbarlinkslocal">
+{% else %}
+<div class="toolbarlinks">
+{% endif %}
+ <a href="/logbookedit/">Logbook Entry</a> |
+ <!--<a href="/1626/359/359.html">359 (HC)</a> |-->
+ <a id="cavesLink" href="/caves">Caves</a> |
+ <a id="qmsLink" href="{% url "caveQMs" "1623-290" %}">QMs</a> |
+ <a href="/survexfile/">Survex</a> |
+ <a href="{% url "survexcaveslist" %}">All Survex</a> |
+ <a href="{% url "allscans" %}">Scans</a> |
+ <a href="{% url "walletedit" %}">Upload Scans</a> |
+ <a href="{% url "dwgallfiles" %}">Drawings</a> |
+ <a href="{% url "dwgupload" %}">Upload Drawings</a> |
+ <a href="{% url "photoupload" %}">Upload Photos</a> |
+ <a href="{% url "gpxupload" %}">Upload GPX</a> |
+
+ <br>
+
+ <a href="{% url "dataissues" %}">Data Issues</a> |
+ <a href="/handbook/computing/todo-data.html">tasks to do </a> |
+ <a id="entsLink" href="{% url "entranceindex" %}">ents</a> |
+ <a id="folklink" href="/folk">expoers</a> |
+ <a id="caversLink" href="{% url "notablepersons" %}">survey lengths</a> |
+ <a href="{% url "stats" %}">statistics</a> |
+ <a href="/survexfilewild/{{current_year}}">Wild Survex({{current_year}})</a> |
+ <a href="/wallets/year/{{current_year}}">Wallets({{current_year}})</a> |
+ <a href="/expedition/{{current_year}}">Expo({{current_year}})</a> |
+ <a href="{% url "controlpanel" %}">Control panel</a> |
+
+</div> \ No newline at end of file