mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-19 17:57:08 +00:00
SPecial links for Lara
This commit is contained in:
@@ -17,7 +17,7 @@ import settings
|
|||||||
from troggle.core.models.caves import Cave
|
from troggle.core.models.caves import Cave
|
||||||
from troggle.core.models.logbooks import LogbookEntry # , PersonLogEntry
|
from troggle.core.models.logbooks import LogbookEntry # , PersonLogEntry
|
||||||
from troggle.core.models.survex import SurvexBlock, SurvexFile, SurvexPersonRole
|
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.models.wallets import YEAR_RANGE, Wallet, make_valid_date
|
||||||
from troggle.core.utils import (
|
from troggle.core.utils import (
|
||||||
get_cookie_max_age,
|
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.scans import caveifywallet, oldwallet
|
||||||
from troggle.core.views.uploads import WalletFilesForm
|
from troggle.core.views.uploads import WalletFilesForm
|
||||||
from troggle.parsers.scans import CONTENTSJSON
|
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
|
"""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
|
if not waldata["date"]: # either absent or empty string
|
||||||
waldata["date"] = date
|
waldata["date"] = date
|
||||||
|
|
||||||
|
persons = []
|
||||||
if no_people(waldata["people"]):
|
if no_people(waldata["people"]):
|
||||||
people = team
|
people = team
|
||||||
waldata["people"] = team
|
waldata["people"] = team
|
||||||
else:
|
else:
|
||||||
people = waldata["people"] # text string
|
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"]):
|
if empty_string(waldata["cave"]):
|
||||||
cave = caverefs # a list, potentially
|
cave = caverefs # a list, potentially
|
||||||
@@ -965,6 +972,7 @@ def walletedit(request, path=None):
|
|||||||
"complaints": complaints,
|
"complaints": complaints,
|
||||||
"caveobject": caveobject,
|
"caveobject": caveobject,
|
||||||
"people": people,
|
"people": people,
|
||||||
|
"persons": persons,
|
||||||
"peoplesize": str(len(str(people))),
|
"peoplesize": str(len(str(people))),
|
||||||
"filesaved": filesaved,
|
"filesaved": filesaved,
|
||||||
"actual_saved": actual_saved,
|
"actual_saved": actual_saved,
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ def ensure_users_are_persons():
|
|||||||
# print(f" {p.user} {u=}")
|
# print(f" {p.user} {u=}")
|
||||||
|
|
||||||
def who_is_this(year, possibleid):
|
def who_is_this(year, possibleid):
|
||||||
expo = Expedition.objects.filter(year=year)
|
expo = Expedition.objects.filter(year=year)[0]
|
||||||
personexpedition = GetPersonExpeditionNameLookup(expo)[possibleid.lower()]
|
personexpedition = GetPersonExpeditionNameLookup(expo)[possibleid.lower()]
|
||||||
if personexpedition:
|
if personexpedition:
|
||||||
return personexpedition.person
|
return personexpedition.person
|
||||||
|
|||||||
@@ -266,7 +266,11 @@ and <em>also</em> the exported files in standard formats: svx, svg etc. See why
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<span style="font-family: monospace; font-size: 150%; ">
|
<span style="font-family: monospace; font-size: 150%; ">
|
||||||
|
{% for p in persons %}
|
||||||
|
<a href="/wallets/person/{{p}}">{{p}}</a>
|
||||||
|
{% endfor %}<p>
|
||||||
{% include 'onthisdate.html' %}
|
{% include 'onthisdate.html' %}
|
||||||
{% if metadataurl %}<span style="font-size: 70%; "><details><summary>
|
{% if metadataurl %}<span style="font-size: 70%; "><details><summary>
|
||||||
JSON <br>
|
JSON <br>
|
||||||
|
|||||||
Reference in New Issue
Block a user