mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-25 08:41:51 +00:00
Add list of entrances
This commit is contained in:
parent
e4fe5eaf5d
commit
b91223da66
@ -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"))
|
||||
@ -137,6 +137,16 @@ def caveindex(request):
|
||||
{"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=""):
|
||||
"""This is used to create a download url in templates/cave.html if anyone wants to download the .3d file
|
||||
|
24
templates/entranceindex.html
Normal file
24
templates/entranceindex.html
Normal file
@ -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 %}
|
4
urls.py
4
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
|
||||
@ -95,6 +95,8 @@ trogglepatterns = [
|
||||
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/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user