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

Add survex trips to logbook mentions

This commit is contained in:
Philip Sargent 2022-10-15 19:33:30 +03:00
parent 454c2c2830
commit 55ac98ebe1
2 changed files with 22 additions and 12 deletions

View File

@ -139,11 +139,13 @@ class Expeditions_jsonListView(ListView):
def person(request, first_name='', last_name='', ): def person(request, first_name='', last_name='', ):
try: try:
this_person = Person.objects.get(first_name = first_name, last_name = last_name) this_person = Person.objects.get(first_name = first_name, last_name = last_name)
return render(request,'person.html', {'person': this_person, })
except: except:
message = f'Person not found \'{first_name} {last_name}\' - possibly Scottish? (See our <a href="/handbook/troggle/namesredesign.html">Proposal to fix this</a>)' message = f'Person not found \'{first_name} {last_name}\' - possibly Scottish? (See our <a href="/handbook/troggle/namesredesign.html">Proposal to fix this</a>)'
return render(request, 'errors/generic.html', {'message': message}) return render(request, 'errors/generic.html', {'message': message})
return render(request,'person.html', {'person': this_person })
def get_person_chronology(personexpedition): def get_person_chronology(personexpedition):

View File

@ -16,17 +16,25 @@
<br class="clearfloat" /> <br class="clearfloat" />
<h3>{{person|safe}} has been on expo in the following years:</h3> <h3>{{person|safe}} has been on expo in the following years:</h3>
<p>
<ul>
{% for personexpedition in person.personexpedition_set.all %}
<li> <a href="{{ personexpedition.get_absolute_url }}">{{personexpedition.expedition.year}}</a>
<span style="padding-left:{{personexpedition.persontrip_set.all|length}}0px; background-color:red"></span>
{{personexpedition.persontrip_set.all|length}} trips
</li>
{% endfor %}
</ul>
</p>
<table>
<th>Expo</th><th>Logbook mentions</th><th>Survex trips</th>
{% for personexpedition in person.personexpedition_set.all %}
<tr>
<td> <a href="{{ personexpedition.get_absolute_url }}">{{personexpedition.expedition.year}}</a>
</td>
<td>
<span style="padding-left:{{personexpedition.persontrip_set.all|length}}0px; background-color:red"></span> &nbsp;
{{personexpedition.persontrip_set.all|length}}
</td>
<td>
<span style="padding-left:{{personexpedition.survexpersonrole_set.all|length}}0px; background-color:blue"></span> &nbsp;
{{personexpedition.survexpersonrole_set.all|length}}
</td>
</tr>
{% endfor %}
</table>
<h3>Surveys done</h3> <h3>Surveys done</h3>
Wallets and surveys mentioning <a href="/wallets/person/{{person}}">{{person}}</a><br> Wallets and surveys mentioning <a href="/wallets/person/{{person}}">{{person}}</a><br>