2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-19 12:27:10 +00:00

SPecial links for Lara

This commit is contained in:
2025-08-01 21:11:59 +02:00
parent 0bbb0a5173
commit 579389589b
3 changed files with 14 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ import settings
from troggle.core.models.caves import Cave
from troggle.core.models.logbooks import LogbookEntry # , PersonLogEntry
from troggle.core.models.survex import SurvexBlock, SurvexFile, SurvexPersonRole
from troggle.core.models.troggle import DataIssue, Expedition
from troggle.core.models.troggle import DataIssue, Expedition, Person
from troggle.core.models.wallets import YEAR_RANGE, Wallet, make_valid_date
from troggle.core.utils import (
get_cookie_max_age,
@@ -36,6 +36,7 @@ from troggle.core.views.caves import get_cave_leniently, getCave
from troggle.core.views.scans import caveifywallet, oldwallet
from troggle.core.views.uploads import WalletFilesForm
from troggle.parsers.scans import CONTENTSJSON
from troggle.parsers.people import who_is_this
"""Main wallet editing form, which includes scan file upload into the wallet
"""
@@ -868,11 +869,17 @@ def walletedit(request, path=None):
if not waldata["date"]: # either absent or empty string
waldata["date"] = date
persons = []
if no_people(waldata["people"]):
people = team
waldata["people"] = team
else:
people = waldata["people"] # text string
for person in waldata["people"]:
person_id = who_is_this(year, person)
print(f"walletedit: {person}, {person_id}")
persons.append(Person.objects.get(slug=person_id))
if empty_string(waldata["cave"]):
cave = caverefs # a list, potentially
@@ -965,6 +972,7 @@ def walletedit(request, path=None):
"complaints": complaints,
"caveobject": caveobject,
"people": people,
"persons": persons,
"peoplesize": str(len(str(people))),
"filesaved": filesaved,
"actual_saved": actual_saved,

View File

@@ -262,7 +262,7 @@ def ensure_users_are_persons():
# print(f" {p.user} {u=}")
def who_is_this(year, possibleid):
expo = Expedition.objects.filter(year=year)
expo = Expedition.objects.filter(year=year)[0]
personexpedition = GetPersonExpeditionNameLookup(expo)[possibleid.lower()]
if personexpedition:
return personexpedition.person

View File

@@ -266,7 +266,11 @@ and <em>also</em> the exported files in standard formats: svx, svg etc. See why
</form>
</div>
<span style="font-family: monospace; font-size: 150%; ">
{% for p in persons %}
<a href="/wallets/person/{{p}}">{{p}}</a>&nbsp;&nbsp;
{% endfor %}<p>
{% include 'onthisdate.html' %}
{% if metadataurl %}<span style="font-size: 70%; "><details><summary>
JSON <br>