2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 11:49:50 +00:00

fixing undescended caves thinggy

This commit is contained in:
2025-07-28 22:16:50 +02:00
parent 5f2791816d
commit 51c9fe8839
4 changed files with 17 additions and 8 deletions

View File

@@ -109,7 +109,7 @@ class CaveForm(ModelForm):
exclude = ("filename", "url", "kataster_status")
field_order = ['unofficial_number', 'kataster_number', 'official_name', 'unexplored', 'underground_description', 'survey',
'underground_centre_line', 'explorers', 'equipment', 'notes', 'references', 'description_file', 'survex_file',
'explorers', 'equipment', 'notes', 'references', 'description_file', 'survex_file',
'areacode', 'subarea', 'length', 'depth', 'extent',
'kataster_code', 'kataster_status', 'fully_explored', 'non_public', 'identified_login', 'who_are_you']
@@ -155,11 +155,7 @@ class EntranceForm(ModelForm):
)
explorers = forms.CharField(required=False, widget=forms.TextInput(attrs={"size": "45"}))
# explorers = forms.CharField(required = False, widget=TinyMCE(attrs={'cols': 80, 'rows': 10}))
# map_description = forms.CharField(
# label="Map (is this used?)",
# required=False,
# widget=HTMLarea(attrs={"height": "80%", "rows": 20, "placeholder": "Enter text (using HTML)"}),
# )
location_description = forms.CharField(
label="Location",
required=False,

View File

@@ -197,6 +197,7 @@ def do_ARGE_cave(slug, caveid, areacode, svxid):
cave = Cave(
underground_description=commentary + line1 +line2 +line3 +passages +"</pre>",
unofficial_number="",
unexplored=False,
survex_file= f"{svxid}.svx",
url=url,
notes=default_note,
@@ -412,6 +413,7 @@ def getXML(text, itemname, minItems=1, maxItems=None, context=""):
def boolify(boolstrs):
return {
"": False,
"True": True,
"False": False,
"true": True,
@@ -829,6 +831,8 @@ def read_cave(filename, mvf=None, cave=None):
print(message)
non_public = getXMLmax1("non_public")
unexplored = True
unexplored = getXMLmax1("unexplored")
official_name = getXMLmax1("official_name")
kataster_code = getXMLmax1("kataster_code")
kataster_number = getXMLmax1("kataster_number")
@@ -886,6 +890,7 @@ def read_cave(filename, mvf=None, cave=None):
cave.areacode = areacode
cave.non_public=boolify(non_public)
cave.unexplored=boolify(unexplored)
cave.official_name=official_name[0]
cave.kataster_code=kataster_code[0]
if "+" in kataster_code[0]:

View File

@@ -17,6 +17,7 @@ the form documented at
<cave>
<non_public>{{ cave.non_public }}</non_public>
<unexplored>{{ cave.unexplored }}</unexplored>
<official_name>{{ cave.official_name|default_if_none:""|safe }}</official_name>
<area>{{cave.areacode |safe }}</area>

View File

@@ -3,6 +3,9 @@
{% block title %}
{% if cave.official_name or cave.kataster_number or cave.unofficial_number %}
Edit Cave - {{cave.official_name|safe}} - {{cave.kataster_number}}
{% if cave.unofficial_number %}
{{cave.unofficial_number|safe}}
{% endif %}
{% else %}
New Cave Creation Form
{% endif %}
@@ -13,7 +16,11 @@ New Cave Creation Form
{% endblock %}
{% block content %}
{% if cave.official_name or cave.kataster_number or cave.unofficial_number %}
<h1>Edit Cave - {{cave.official_name|safe}} {{cave.reference}}</h1>
<h1>Edit Cave - {{cave.official_name|safe}} {{cave.reference}}
{% if cave.unofficial_number %}
{{cave.unofficial_number|safe}}
{% endif %}
</h1>
<p>The fields on this form, two of which are vital, are documented explicitly on the page
<a href="/handbook/survey/caveentryfields.html">cave entry fields</a>
and these same fields appear in the alternative file upload process as described in