2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

Make 'bearings' a read-only field on entrances

This commit is contained in:
Philip Sargent 2023-11-18 13:27:08 +00:00
parent 76688695b8
commit 7a61bc47ea
4 changed files with 14 additions and 10 deletions

View File

@ -180,11 +180,11 @@ class EntranceForm(ModelForm):
required=False, required=False,
widget=HTMLarea(attrs={"height": "80%", "rows": 20, "placeholder": "Usually blank"}), widget=HTMLarea(attrs={"height": "80%", "rows": 20, "placeholder": "Usually blank"}),
) )
bearings = forms.CharField( # bearings = forms.CharField(
label="Bearings (obsolete)", # label="Bearings (obsolete)",
required=False, # required=False,
widget=HTMLarea(attrs={"height": "80%", "rows": 20, "placeholder": "Usually blank"}), # widget=HTMLarea(attrs={"height": "80%", "rows": 20, "placeholder": "Usually blank"}),
) # )
tag_station = forms.CharField( tag_station = forms.CharField(
required=False, required=False,
widget=forms.TextInput(attrs={"size": "50","placeholder": "e.g. 1623.t2035-zb-03a"}), widget=forms.TextInput(attrs={"size": "50","placeholder": "e.g. 1623.t2035-zb-03a"}),
@ -214,7 +214,8 @@ class EntranceForm(ModelForm):
exclude = ( exclude = (
"cached_primary_slug", "cached_primary_slug",
"filename", "filename",
"slug" "slug",
"bearings"
) )
def clean(self): def clean(self):

View File

@ -663,6 +663,7 @@ def edit_entrance(request, path="", caveslug=None, entslug=None):
{ {
"entform": entform, "entform": entform,
"cave": cave, "cave": cave,
"ent": entrance,
"entletter": entletter, "entletter": entletter,
"entletterform": entletterform, # is unset if not being used "entletterform": entletterform, # is unset if not being used
"entlettereditable": entlettereditable, "entlettereditable": entlettereditable,

View File

@ -2416,7 +2416,6 @@ def FindAndLoadSurvex():
print(f" - Number of Survex legs: {legsnumber:,}") print(f" - Number of Survex legs: {legsnumber:,}")
for f in svx_load.fixes: for f in svx_load.fixes:
# why are we seeing no *fixes from fixedpts/gps18.svx etc. ? They are parsed !
survexblock, name, altitude, comment = svx_load.fixes[f] survexblock, name, altitude, comment = svx_load.fixes[f]
s = survexblock s = survexblock
spath = s.parent.survexfile spath = s.parent.survexfile
@ -2431,9 +2430,9 @@ def FindAndLoadSurvex():
if comment: if comment:
# print(f"FIX {survexblock} {altitude} {comment}") # print(f"FIX {survexblock} {altitude} {comment}")
if re.match("(?i)[^s]*srtm[\s\S]*", comment.lower()): if re.match("(?i)[^s]*srtm[\s\S]*", comment.lower()):
print(f"SRTM {ff}.svx::{survexblock} - {spath}.svx - '{comment}'") print(f"SRTM {ff}.svx::{survexblock} - {spath}.svx - alt={altitude} '{comment}'")
if re.match("(?i)[^s]*radost[\s\S]*", comment.lower()): if re.match("(?i)[^s]*radost[\s\S]*", comment.lower()):
print(f"RDST {ff}.svx::{survexblock} - {spath}.svx - '{comment}'") print(f"RDST {ff}.svx::{survexblock} - {spath}.svx - alt={altitude} '{comment}'")
svx_load = None svx_load = None

View File

@ -40,7 +40,10 @@ at troggle/core/forms.py ass this uses a Django magic form creation thinggy. -->
{% else %} {% else %}
<table><tr><th>Entrance Letter</th><td>{{ entletter }}</td></table> <table><tr><th>Entrance Letter</th><td>{{ entletter }}</td></table>
{% endif %} {% endif %}
<table>{{ entform }}</table> <table>{{ entform }}
<tr><th><label for="id_bearings">Bearings (obsolete):</label></th><td>
{{ent.bearings|safe}}</td></tr>
</table>
<p><input type="submit" value="Submit" /></p> <p><input type="submit" value="Submit" /></p>
</form> </form>