mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2024-11-26 17:21:55 +00:00
[svn r8226] I initial work at adding caveareas. (Descirprion of parts of caves)
This commit is contained in:
parent
ca9188bf69
commit
af65239d6e
@ -363,6 +363,14 @@ class Entrance(models.Model):
|
||||
if f[0] == self.findability:
|
||||
return f[1]
|
||||
|
||||
class CaveArea(models.Model):
|
||||
description = models.TextField()
|
||||
name = models.CharField(max_length=200, unique = True)
|
||||
cave = models.ForeignKey('Cave')
|
||||
parentArea = models.ForeignKey('CaveArea')
|
||||
survexFile = models.CharField(max_length=200)
|
||||
|
||||
|
||||
class QM(models.Model):
|
||||
#based on qm.csv in trunk/expoweb/smkridge/204 which has the fields:
|
||||
#"Number","Grade","Area","Description","Page reference","Nearest station","Completion description","Comment"
|
||||
|
@ -27,6 +27,11 @@ def survexblock(request, survexpath):
|
||||
ftext = survexblock.text
|
||||
return render_to_response('survexblock.html', {'survexblock':survexblock, 'ftext':ftext, 'settings':settings })
|
||||
|
||||
def caveArea(request, name):
|
||||
cavearea = models.CaveArea.objects.get(name = name)
|
||||
cave = cavearea.cave
|
||||
return render_to_response('cavearea.html', {'cavearea': cavearea, 'cave': cave, 'settings':settings })
|
||||
|
||||
def caveSearch(request):
|
||||
query_string = ''
|
||||
found_entries = None
|
||||
|
@ -35,6 +35,8 @@
|
||||
|
||||
|
||||
<div id="content" >
|
||||
{% block contentheader %}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
REPLACE : The content
|
||||
{% endblock %}
|
||||
|
@ -1,31 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
{% extends "cavebase.html" %}
|
||||
{% load wiki_markup %}
|
||||
|
||||
{% block title %}{{ cave.official_name|wiki_to_html }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<table id="cavepage">
|
||||
<tr>
|
||||
<th id="kat_no">
|
||||
{% if cave.kataster_number %}
|
||||
{{ cave.kataster_number|wiki_to_html_short }}
|
||||
{% if cave.entrancelist %}
|
||||
- {{ cave.entrancelist|wiki_to_html_short }}
|
||||
{% endif %}
|
||||
{% if cave.unofficial_number %}
|
||||
<br />({{ cave.unofficial_number|wiki_to_html_short }})
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</th>
|
||||
<th id="name">
|
||||
{{ cave.official_name|wiki_to_html_short }}
|
||||
</th>
|
||||
<th id="status">
|
||||
{{ cave.kataster_code|wiki_to_html_short }}
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
{% if cave.entrances %}
|
||||
<h2>Entrances</h2>
|
||||
{% for ent in cave.entrances %}
|
||||
|
9
troggle/templates/cavearea.html
Normal file
9
troggle/templates/cavearea.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% extends "cavebase.html" %}
|
||||
{% load wiki_markup %}
|
||||
|
||||
{% block content %}
|
||||
{{ cavearea.description }}
|
||||
{{ cavearea.name }}
|
||||
{{ cavearea.parentArea }}
|
||||
{{ cavearea.survexFile }}
|
||||
{% endblock %}
|
28
troggle/templates/cavebase.html
Normal file
28
troggle/templates/cavebase.html
Normal file
@ -0,0 +1,28 @@
|
||||
{% extends "base.html" %}
|
||||
{% load wiki_markup %}
|
||||
|
||||
{% block title %}{{ cave.official_name|wiki_to_html }}{% endblock %}
|
||||
|
||||
{% block contentheader %}
|
||||
<table id="cavepage">
|
||||
<tr>
|
||||
<th id="kat_no">
|
||||
{% if cave.kataster_number %}
|
||||
{{ cave.kataster_number|wiki_to_html_short }}
|
||||
{% if cave.entrancelist %}
|
||||
- {{ cave.entrancelist|wiki_to_html_short }}
|
||||
{% endif %}
|
||||
{% if cave.unofficial_number %}
|
||||
<br />({{ cave.unofficial_number|wiki_to_html_short }})
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</th>
|
||||
<th id="name">
|
||||
{{ cave.official_name|wiki_to_html_short }}
|
||||
</th>
|
||||
<th id="status">
|
||||
{{ cave.kataster_code|wiki_to_html_short }}
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
@ -14,6 +14,7 @@ urlpatterns = patterns('',
|
||||
(r'^cave/(?P<cave_id>[^/]+)/?(?P<ent_letter>[^/])$', ent),
|
||||
#(r'^cave/(?P<cave_id>[^/]+)/edit/$', edit_cave),
|
||||
(r'^cavesearch', caveSearch),
|
||||
url(r'^cavearea', caveArea, name="caveArea"),
|
||||
|
||||
url(r'^survex/(.*?)\.index$', index, name="survexindex"),
|
||||
(r'^survex/(?P<survex_file>.*)\.svx$', svx),
|
||||
|
Loading…
Reference in New Issue
Block a user