From b91223da6609ac3728643dbca756cfd0d4aff819 Mon Sep 17 00:00:00 2001 From: Martin Green Date: Mon, 3 Jul 2023 08:00:03 +0100 Subject: [PATCH] Add list of entrances --- core/views/caves.py | 12 +++++++++++- templates/entranceindex.html | 24 ++++++++++++++++++++++++ urls.py | 4 +++- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 templates/entranceindex.html diff --git a/core/views/caves.py b/core/views/caves.py index c3675a5..723df60 100644 --- a/core/views/caves.py +++ b/core/views/caves.py @@ -124,7 +124,7 @@ def getnotablecaves(): def caveindex(request): - Cave.objects.all() + #Cave.objects.all() caves1623 = list(Cave.objects.filter(area__short_name="1623")) caves1626 = list(Cave.objects.filter(area__short_name="1626")) caves1627 = list(Cave.objects.filter(area__short_name="1627")) @@ -136,6 +136,16 @@ def caveindex(request): "caveindex.html", {"caves1623": caves1623, "caves1626": caves1626, "caves1627": caves1627, "notablecaves": getnotablecaves(), "cavepage": True}, ) + +def entranceindex(request): + ents = Entrance.objects.all() + + return render( + request, + "entranceindex.html", + {"entrances": ents}, + ) + def cave3d(request, cave_id=""): diff --git a/templates/entranceindex.html b/templates/entranceindex.html new file mode 100644 index 0000000..30afdc4 --- /dev/null +++ b/templates/entranceindex.html @@ -0,0 +1,24 @@ +{% extends "cavebase.html" %} + + +{% block title %}Entrance Index{% endblock %} + +{% block content %} + +

Entrance Index

+ + + +tr> + + + +{% endfor %} + + + + + +{% endblock %} diff --git a/urls.py b/urls.py index 0b71a68..911eb4a 100644 --- a/urls.py +++ b/urls.py @@ -6,7 +6,7 @@ from django.conf.urls.static import static from troggle.core.views import statistics, survex from troggle.core.views.auth import expologin, expologout -from troggle.core.views.caves import (cave3d, caveEntrance, caveindex, +from troggle.core.views.caves import (cave3d, caveEntrance, caveindex, entranceindex, cavepage, caveQMs, edit_cave, cave_debug, edit_entrance, get_entrances, qm, expo_kml, expo_kmz) from troggle.core.views.drawings import dwgallfiles, dwgfilesingle @@ -94,6 +94,8 @@ trogglepatterns = [ re_path(r'^caves$', caveindex, name="caveindex"), re_path(r'^indxal.htm$', caveindex, name="caveindex"), # ~420 hrefs to this url in expoweb files re_path(r'^people/?$', notablepersons, name="notablepersons"), + + re_path(r'^entrances$', entranceindex, name="entranceindex"), re_path(r'^admin/doc/', include('django.contrib.admindocs.urls')), # needs docutils Python module (http://docutils.sf.net/). re_path(r'^admin/', admin.site.urls), # includes admin login & logout urls & /admin/jsi18n/
NamePointPosition
{{ entrance }}{{ entrance.best_station }}{{ entrance.latlong }}