diff options
-rw-r--r-- | core/views/caves.py | 12 | ||||
-rw-r--r-- | templates/entranceindex.html | 24 | ||||
-rw-r--r-- | urls.py | 4 |
3 files changed, 38 insertions, 2 deletions
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 %} + +<h1>Entrance Index</h1> + +<table> +<theader> +<tr><th>Name</th><th>Point</th><th>Position</th>tr> +</theader> +<tbody> +<ul> +{% for entrance in entrances %} +<tr><td>{{ entrance }}</td><td>{{ entrance.best_station }}</td><td>{{ entrance.latlong }}</td></tr> +{% endfor %} +</tbody> +</ul> + + + +{% endblock %} @@ -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/ |