mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-22 15:21:52 +00:00
allow editing ent letter if blank on many ent caves
This commit is contained in:
parent
bed663a031
commit
2c509d085e
@ -451,6 +451,8 @@ def edit_entrance(request, path="", caveslug=None, entslug=None):
|
|||||||
|
|
||||||
if caveAndEntrance.entranceletter == "" and cave.entrances().count() > 0 :
|
if caveAndEntrance.entranceletter == "" and cave.entrances().count() > 0 :
|
||||||
# this should not be blank on a multiple-entrance cave
|
# this should not be blank on a multiple-entrance cave
|
||||||
|
# but it doesn't trigger the entrnce letter form unless entletter has a value
|
||||||
|
|
||||||
entlettereditable = True
|
entlettereditable = True
|
||||||
|
|
||||||
print(f"{entlettereditable=}")
|
print(f"{entlettereditable=}")
|
||||||
@ -497,22 +499,26 @@ def edit_entrance(request, path="", caveslug=None, entslug=None):
|
|||||||
|
|
||||||
form = EntranceForm(instance=entrance)
|
form = EntranceForm(instance=entrance)
|
||||||
if entslug is None:
|
if entslug is None:
|
||||||
entletter = EntranceLetterForm()
|
entletterform = EntranceLetterForm()
|
||||||
print(f" Getting entletter from EntranceLetterForm")
|
# print(f" Getting entletter from EntranceLetterForm")
|
||||||
else:
|
else:
|
||||||
entletter = caveAndEntrance.entranceletter
|
entletter = caveAndEntrance.entranceletter
|
||||||
print(f"{entletter=}")
|
if entletter == "":
|
||||||
|
entletterform = EntranceLetterForm()
|
||||||
|
print(f" Blank value: getting entletter from EntranceLetterForm")
|
||||||
|
print(f"{entletter=} {entletterform=}")
|
||||||
else:
|
else:
|
||||||
form = EntranceForm()
|
entform = EntranceForm()
|
||||||
entletter = EntranceLetterForm()
|
entletterform = EntranceLetterForm()
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
"editentrance.html",
|
"editentrance.html",
|
||||||
{
|
{
|
||||||
"form": form,
|
"entform": form,
|
||||||
"cave": cave,
|
"cave": cave,
|
||||||
"entletter": entletter,
|
"entletter": entletter,
|
||||||
|
"entletterform": entletterform,
|
||||||
"entlettereditable": entlettereditable,
|
"entlettereditable": entlettereditable,
|
||||||
"path": path + "/",
|
"path": path + "/",
|
||||||
},
|
},
|
||||||
|
@ -18,11 +18,11 @@ so the Easting/Northing fields will be blank.
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{% if entlettereditable %}
|
{% if entlettereditable %}
|
||||||
<table>{{ entletter }}</table>
|
<table>{{ entletterform }}</table>
|
||||||
{% 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>{{ form }}</table>
|
<table>{{ entform }}</table>
|
||||||
<p><input type="submit" value="Submit" /></p>
|
<p><input type="submit" value="Submit" /></p>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user