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

revised tables

This commit is contained in:
2025-07-31 12:25:53 +02:00
parent f76fd8ab65
commit c2c70e6a95
2 changed files with 34 additions and 20 deletions

View File

@@ -328,6 +328,23 @@ def stations(request):
return render(request, "stations.html", {"ents": ents, "gpsents": gpsents, "stations": stations, "year": current_expo()})
def old_key(p):
"""This function goes into a lexicographic sort function, and the values are strings,
but we want to sort numerically.
Skip people who have never been on expo.
"""
last = p.last()
if last:
if last.expedition:
# print(p,p.last().expedition)
return int(p.last().expedition.year)
else:
print(p,p.last())
else:
print(f"{p} never attended expo")
return 2050
def aliases(request, year):
"""Page which displays a list of all the person aliases in a specific year"""
@@ -338,12 +355,16 @@ def aliases(request, year):
personexpeditions = PersonExpedition.objects.filter(expedition=expo)
persons = list(Person.objects.all().order_by("last_name"))
oldpersons = persons
oldpersons.sort(key=old_key)
print(len(oldpersons))
aliases = GetPersonExpeditionNameLookup(expo)
aliasdict = {}
for i in sorted(aliases):
aliasdict[i] = aliases[i]
invert = {}
return render(
request,
@@ -352,8 +373,8 @@ def aliases(request, year):
"year": year,
"aliasdict": aliasdict,
"foreign_friends": foreign_friends,
"invert": invert,
"personexpeditions": personexpeditions,
"persons": persons,
"oldpersons": oldpersons,
},
)

View File

@@ -26,21 +26,24 @@ td {
{% endfor %}
</table>
<p>This is the list of people on expo this year.
<table>
<tr><th>who</th><th>aliases</th></tr>
{% for key, value in invert.items %}
<tr>
<td>{{key}}</td>
<td>{{value}}</td>
<tr><th>Person</th><th>mugshot</th><th>blurbfile</th></tr>
{% for pe in personexpeditions %}
<tr>
<td>{{pe.person}}</td>
<td>{% if pe.person.mugshot %}<a href="{{pe.person.mugshot}}">{{pe.person.mugshot}}</a>{% endif %}</td>
<td>{% if pe.person.blurbfile %}<a href="{{pe.person.blurbfile}}">{{pe.person.blurbfile}}</a>{% endif %}</td>
</tr>
{% endfor %}
</table>
<p>The aliases below are specified in the folk.csv file. Only one alias is possible in that format. The specified alias ('nickname')
is used in the table above to construct possible unambiguous identifiers.
is used in the table above to construct possible unambiguous identifiers. This is ordered by the date of last appearance on expo.
<table>
<tr><th>First</th><th>Last</th><th>Full name</th><th>Nickname</th><th>expo first</th><th>expo last</th></tr>
{% for p in persons %}
{% for p in oldpersons %}
<tr>
<td><b>{{p.first_name}}</b></td>
<td><b>{{p.last_name}}</b></td>
@@ -53,17 +56,7 @@ is used in the table above to construct possible unambiguous identifiers.
{% endfor %}
</table>
<p>This is the list of people on expo this year.
<table>
<tr><th>Person</th><th>mugshot</th><th>blurbfile</th></tr>
{% for pe in personexpeditions %}
<tr>
<td>{{pe.person}}</td>
<td>{% if pe.person.mugshot %}<a href="{{pe.person.mugshot}}">{{pe.person.mugshot}}</a>{% endif %}</td>
<td>{% if pe.person.blurbfile %}<a href="{{pe.person.blurbfile}}">{{pe.person.blurbfile}}</a>{% endif %}</td>
</tr>
{% endfor %}
</table>
<p>And these are people known to us, who appear as survex *team members or in logbook participant lists, but are not expo members
and so are not managed or reported: