mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-15 10:47:35 +00:00
tidied login and control panel pages
This commit is contained in:
@@ -159,7 +159,8 @@ def controlpanel(request):
|
||||
return render(
|
||||
request,
|
||||
"controlPanel.html",
|
||||
{"error": 'You are logged in, but not logged in as "expoadmin". \nLogout and login again to contnue.', "year": current_expo()}
|
||||
{"error": ' - Needs "expoadmin" logon. \nLogout and login again.',
|
||||
"year": current_expo()}
|
||||
|
||||
)
|
||||
else:
|
||||
|
||||
@@ -83,8 +83,9 @@ APPEND_SLASH = (
|
||||
)
|
||||
SMART_APPEND_SLASH = True # not eorking as middleware different after Dj2.0
|
||||
|
||||
|
||||
LOGIN_REDIRECT_URL = "/" # does not seem to have any effect
|
||||
ROOT_URLCONF = "troggle.urls"
|
||||
LOGOUT_REDIRECT_URL = "/statistics" # see troggle/core/views/auth.py
|
||||
LOGIN_REDIRECT_URL = "/controlpanel" # see troggle/core/views/auth.py
|
||||
|
||||
SECURE_CONTENT_TYPE_NOSNIFF = True
|
||||
SECURE_BROWSER_XSS_FILTER = True
|
||||
@@ -126,8 +127,6 @@ MIDDLEWARE = [
|
||||
#'troggle.core.middleware.SmartAppendSlashMiddleware' # needs adapting after Dj2.0
|
||||
]
|
||||
|
||||
ROOT_URLCONF = "troggle.urls"
|
||||
|
||||
WSGI_APPLICATION = "troggle.wsgi.application" # change to asgi as soon as we upgrade to Django 3.0
|
||||
|
||||
ACCOUNT_ACTIVATION_DAYS = 3
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
|
||||
{% if jobs_completed %}
|
||||
<div class="noticeBox">
|
||||
Just finished running:
|
||||
@@ -14,14 +15,16 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!--
|
||||
{% if error %}
|
||||
<div class="noticeBox">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<h3>Administration Utilities</h3>
|
||||
-->
|
||||
<img class = "onright" alt="troggle logo" src="/handbook/troggle/tricky-troggle.jpg">
|
||||
<h3>Troggle Administration Utilities</h3>
|
||||
<ul>
|
||||
<li><a href="/logreport/{{year}}">Delete logbook entry</a> -Online logbook suffers duplicate entries (needs admin logon)
|
||||
<li><a href="/logreport/{{year}}">Delete logbook entry</a> -Online logbook suffers duplicate entries <span style="color:red">{{error}}</span>
|
||||
<li><a href="/pathsreport">Folder paths used</a> -folders settings used by this troggle installation
|
||||
<li><a href="/cave_data/cavealiases.txt_edit">Edit cave aliases</a> -edit historical cave aliases to current names
|
||||
<li><a href="/aliases/2023">Expoer name aliases</a> -short names recognised by troggle
|
||||
@@ -30,10 +33,11 @@
|
||||
<li><a href="/survexdir">Survex Directories</a> - Every Cave has an associated directory and a Primary survex file
|
||||
<li><a href="/surveximport">Survex import record</a> - indented *include and begin/end tree<br /><li><a href="/survexdebug">Survex debug report</a> - warnings and details<br />
|
||||
<li><a href="/therionissues">Therion Import issues</a> - warnings from the recent data import<br /><br />
|
||||
<li><a href="/admin/">Django admin</a> - Deep magic access to all models and data
|
||||
<li><a href="/admin/">Django admin</a> - Deep magic access to all models and data <span style="color:red">{{error}}</span>
|
||||
</ul>
|
||||
<h3>This control panel is/will/mabe being redeveloped</h3>
|
||||
<h3>This control panel is/will/maybe being redeveloped</h3>
|
||||
|
||||
<!--
|
||||
<p>Do not attempt to use any of these import functions as they are in active development.
|
||||
<ol>
|
||||
<li>Importing things in the wrong order will screw-up the database links and break things.
|
||||
@@ -114,6 +118,9 @@
|
||||
<p></font>
|
||||
|
||||
<hr />
|
||||
-->
|
||||
|
||||
<!--
|
||||
<h3>Export Logbook to a different format:</h3>
|
||||
<p>This creates 'logbook-new-format.html' in the years/<year>/ folder
|
||||
<table>
|
||||
@@ -158,4 +165,5 @@
|
||||
<p>
|
||||
</div>
|
||||
</font>
|
||||
-->
|
||||
{% endblock %}
|
||||
4
urls.py
4
urls.py
@@ -123,7 +123,7 @@ else:
|
||||
|
||||
# admin.site.urls is urls() which maps to get_urls() which is a function declared
|
||||
# in django/contrib/admin/sites.py which for me is
|
||||
# /home/philip/p11d5/lib/python3.11/site-packages/django/contrib/admin/sites.py
|
||||
# /home/philip/expo/troggle/.venv/lib/python3.xx/site-packages/django/contrib/admin/sites.py
|
||||
|
||||
trogglepatterns = [
|
||||
path('pubs.htm', pubspage, name="pubspage"), # ~165 hrefs to this url in expoweb files
|
||||
@@ -170,7 +170,7 @@ trogglepatterns = [
|
||||
path('accounts/login/', expologin, name='expologin'), # same as in django.contrib.auth.urls
|
||||
path("accounts/register/<slug:username>", register, name="re_register"),
|
||||
path("accounts/register/", register, name="register"),
|
||||
path('accounts/', include('django.contrib.auth.urls')), # see site-packages\registration\auth_urls_classes.py
|
||||
path('accounts/', include('django.contrib.auth.urls')), # see line 109 in this file
|
||||
|
||||
path('person/<slug:slug>', person, name="person"),
|
||||
path('personexpedition/<slug:slug>/<int:year>', personexpedition, name="personexpedition"),
|
||||
|
||||
Reference in New Issue
Block a user