2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-21 23:01:52 +00:00

mugshots on expo page

This commit is contained in:
Philip Sargent 2024-07-20 19:10:05 +02:00
parent bca1123d4d
commit 41fff1f3dd
2 changed files with 11 additions and 1 deletions

View File

@ -125,6 +125,10 @@ class Person(TroggleModel):
"""Boolean: is this person notable?"""
return self.notability() > Decimal(1) / Decimal(3)
def get_mugshot_url(self):
# insert code to extract src= url from the blub text
return f"/person/{self.slug}"
def surveyedleglength(self):
return sum([personexpedition.surveyedleglength() for personexpedition in self.personexpedition_set.all()])

View File

@ -49,7 +49,13 @@ an "<b>S</b>" for a survey trip. The colours of the "<b>T</b>" and "<b>S</b>" a
<td><a href="{{ personexpoday.personexpedition.get_absolute_url }}">{{personexpoday.personexpedition.person.fullname|safe}}</a></td>
<td>{% if personexpoday.personexpedition.person.mug_shot %}
<div align=right><a href="{{personexpoday.personexpedition.person.mug_shot}}">&#128515;</a></div>{% endif %}</td>
<div align=right><a href="{{personexpoday.personexpedition.person.mug_shot}}">&#128515;</a></div>
{% else %}
{% if personexpoday.personexpedition.person.blurb %}
<a href="{{personexpoday.personexpedition.person.get_mugshot_url}}">&#128513;</a>
{% endif %}
{% endif %}
</td>
{% for activities in personexpoday.personrow %}
{% if activities.personentries or activities.survexblocks %}