diff options
-rw-r--r-- | .hgignore | 1 | ||||
-rw-r--r-- | core/models.py | 6 | ||||
-rw-r--r-- | flatpages/views.py | 28 | ||||
-rw-r--r-- | templates/cave_entrances.html | 4 | ||||
-rw-r--r-- | urls.py | 2 |
5 files changed, 24 insertions, 17 deletions
@@ -4,3 +4,4 @@ syntax: glob *.pyc db* localsettings.py +*~ diff --git a/core/models.py b/core/models.py index 180ac9d..e064814 100644 --- a/core/models.py +++ b/core/models.py @@ -568,6 +568,12 @@ class Entrance(TroggleModel): def __unicode__(self): return unicode(self.slug()) + def exact_location(self): + return SurvexStation.objects.lookup(self.exact_station) + def other_location(self): + return SurvexStation.objects.lookup(self.other_station) + + def find_location(self): if self.tag_station: s = SurvexStation.objects.lookup(self.tag_station) diff --git a/flatpages/views.py b/flatpages/views.py index cc1feef..0b4a8a0 100644 --- a/flatpages/views.py +++ b/flatpages/views.py @@ -78,20 +78,20 @@ def flatpage(request, path): return HttpResponse(o.read(), mimetype=getmimetype(path)) def getmimetype(path): - if path.endswith(".png"): return "image/png" - if path.endswith(".tif"): return "image/tif" - if path.endswith(".gif"): return "image/gif" - if path.endswith(".jpeg"): return "image/jpeg" - if path.endswith(".jpg"): return "image/jpeg" - if path.endswith("svg"): return "image/svg+xml" - if path.endswith(".pdf"): return "application/pdf" - if path.endswith(".ps"): return "application/postscript" - if path.endswith(".svx"): return "application/x-survex-svx" - if path.endswith(".3d"): return "application/x-survex-3d" - if path.endswith(".pos"): return "application/x-survex-pos" - if path.endswith(".err"): return "application/x-survex-err" - if path.endswith(".odt"): return "application/vnd.oasis.opendocument.text" - if path.endswith(".ods"): return "application/vnd.oasis.opendocument.spreadsheet" + if path.lower().endswith(".png"): return "image/png" + if path.lower().endswith(".tif"): return "image/tif" + if path.lower().endswith(".gif"): return "image/gif" + if path.lower().endswith(".jpeg"): return "image/jpeg" + if path.lower().endswith(".jpg"): return "image/jpeg" + if path.lower().endswith("svg"): return "image/svg+xml" + if path.lower().endswith(".pdf"): return "application/pdf" + if path.lower().endswith(".ps"): return "application/postscript" + if path.lower().endswith(".svx"): return "application/x-survex-svx" + if path.lower().endswith(".3d"): return "application/x-survex-3d" + if path.lower().endswith(".pos"): return "application/x-survex-pos" + if path.lower().endswith(".err"): return "application/x-survex-err" + if path.lower().endswith(".odt"): return "application/vnd.oasis.opendocument.text" + if path.lower().endswith(".ods"): return "application/vnd.oasis.opendocument.spreadsheet" return "" @login_required_if_public diff --git a/templates/cave_entrances.html b/templates/cave_entrances.html index cb58a0a..3a75a02 100644 --- a/templates/cave_entrances.html +++ b/templates/cave_entrances.html @@ -52,13 +52,13 @@ <dt>Bearings</dt><dd>{{ ent.entrance.bearings|safe }}</dd> {% endif %} {% if ent.entrance.exact_station %} - <dt>Exact Station</dt><dd>{{ ent.entrance.exact_station|safe }}</dd> + <dt>Exact Station</dt><dd>{{ ent.entrance.exact_station|safe }} {{ ent.exact_location.tag.y|safe }}, {{ ent.entrance.exact_location.x|safe }}, {{ ent.entrance.exact_location.z|safe }}m</dd> {% endif %} {% if ent.entrance.other_station %} <dt>Other Station</dt><dd>{{ ent.entrance.other_station|safe }} {% if ent.entrance.other_description %} - {{ ent.entrance.other_description|safe }} - {% endif %} + {% endif %} {{ ent.entrance.other_location.y|safe }}, {{ ent.entrance.other_location.x|safe }}, {{ ent.entrance.other_location.z|safe }}m </dd> {% endif %} </dl> @@ -67,7 +67,7 @@ actualurlpatterns = patterns('', url(r'^cave/(?P<cave_id>[^/]+)/(?P<year>\d\d\d\d)-(?P<qm_id>\d*)(?P<grade>[ABCDX]?)?$', views_caves.qm, name="qm"), - url(r'^prospectinguide/$', views_caves.prospecting), + url(r'^prospecting_guide/$', views_caves.prospecting), url(r'^logbooksearch/(.*)/?$', views_logbooks.logbookSearch), |