diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-10-15 19:33:30 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-10-15 19:33:30 +0300 |
commit | 55ac98ebe1b1898583309434475c25a73815066b (patch) | |
tree | bea9892eb38d14b65d96619d634516cef47cae54 | |
parent | 454c2c2830f0da5b1c482c875fee13ec1e1a66e1 (diff) | |
download | troggle-55ac98ebe1b1898583309434475c25a73815066b.tar.gz troggle-55ac98ebe1b1898583309434475c25a73815066b.tar.bz2 troggle-55ac98ebe1b1898583309434475c25a73815066b.zip |
Add survex trips to logbook mentions
-rw-r--r-- | core/views/logbooks.py | 6 | ||||
-rw-r--r-- | templates/person.html | 26 |
2 files changed, 21 insertions, 11 deletions
diff --git a/core/views/logbooks.py b/core/views/logbooks.py index f26a850..625575f 100644 --- a/core/views/logbooks.py +++ b/core/views/logbooks.py @@ -139,11 +139,13 @@ class Expeditions_jsonListView(ListView): def person(request, first_name='', last_name='', ): try: this_person = Person.objects.get(first_name = first_name, last_name = last_name) - return render(request,'person.html', {'person': this_person, }) 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>)' - 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): diff --git a/templates/person.html b/templates/person.html index 1216c60..d88b91b 100644 --- a/templates/person.html +++ b/templates/person.html @@ -16,17 +16,25 @@ <br class="clearfloat" /> <h3>{{person|safe}} has been on expo in the following years:</h3> -<p> -<ul> + +<table> +<th>Expo</th><th>Logbook mentions</th><th>Survex trips</th> {% 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> +<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> + {{personexpedition.persontrip_set.all|length}} + </td> + <td> + <span style="padding-left:{{personexpedition.survexpersonrole_set.all|length}}0px; background-color:blue"></span> + {{personexpedition.survexpersonrole_set.all|length}} + </td> +</tr> +{% endfor %} +</table> <h3>Surveys done</h3> Wallets and surveys mentioning <a href="/wallets/person/{{person}}">{{person}}</a><br> |