diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2025-01-22 20:19:33 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2025-01-22 20:19:33 +0000 |
commit | a5341c4eb256d7d18bddca597c97a9fb91794ea6 (patch) | |
tree | 91b466fc8d1189a95dd07c572455cfd90ab034ec | |
parent | 18517f5ec7378ceffb554dd21b5fbf49bdae24af (diff) | |
download | troggle-a5341c4eb256d7d18bddca597c97a9fb91794ea6.tar.gz troggle-a5341c4eb256d7d18bddca597c97a9fb91794ea6.tar.bz2 troggle-a5341c4eb256d7d18bddca597c97a9fb91794ea6.zip |
tidied login and control panel pages
-rw-r--r-- | core/views/other.py | 3 | ||||
-rw-r--r-- | settings.py | 7 | ||||
-rw-r--r-- | templates/controlPanel.html | 18 | ||||
-rw-r--r-- | urls.py | 4 |
4 files changed, 20 insertions, 12 deletions
diff --git a/core/views/other.py b/core/views/other.py index b97ea9a..f1cd6ac 100644 --- a/core/views/other.py +++ b/core/views/other.py @@ -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: diff --git a/settings.py b/settings.py index 1e2303e..d201b4c 100644 --- a/settings.py +++ b/settings.py @@ -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 diff --git a/templates/controlPanel.html b/templates/controlPanel.html index b8f66d5..acbd1c8 100644 --- a/templates/controlPanel.html +++ b/templates/controlPanel.html @@ -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 %}
\ No newline at end of file @@ -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"), |