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

90 lines
4.2 KiB
HTML
Raw Normal View History

2011-07-11 02:10:22 +01:00
{% extends "base.html" %}
2021-04-30 22:44:03 +01:00
{% block title %}Person {{personexpedition.person}} for {{personexpedition.expedition}}{% endblock %}
<!-- I am removing 'role' as a thing that troggle cares about.
This will remove the Class Role (but keep PersonRole)
and 1 foreign key role
If anyone really cares, they can always look in the original survex file
-->
2011-07-11 02:10:22 +01:00
{% block content %}
<h1>
2019-06-26 18:36:08 +01:00
<a href="{{personexpedition.person.get_absolute_url}}">{{personexpedition.person|safe}}</a> :
2011-07-11 02:10:22 +01:00
<a href="{{personexpedition.expedition.get_absolute_url}}">{{personexpedition.expedition}}</a>
</h1>
<p>{{message}}</p>
<p>{{personexpedition.surveyedleglength|stringformat:".1f"}} m surveyed this year.</p>
2011-07-11 02:10:22 +01:00
2022-03-18 02:49:45 +00:00
<p><b>Other years:&nbsp;</b>
2011-07-11 02:10:22 +01:00
{% for otherpersonexpedition in personexpedition.person.personexpedition_set.all %}
{% if otherpersonexpedition == personexpedition %}
2011-07-11 02:10:22 +01:00
| <b>{{otherpersonexpedition.expedition.year}}</b>
{% else %}
| <a href="{{otherpersonexpedition.get_absolute_url}}">{{ otherpersonexpedition.expedition.year }}</a>
{% endif %}
2011-07-11 02:10:22 +01:00
{% endfor %}
</p>
2022-03-18 02:49:45 +00:00
<p><b>Wallet status</b>
{% for otherpersonexpedition in personexpedition.person.personexpedition_set.all %}
| <a href="/expofiles/surveyscans/{{ otherpersonexpedition.expedition.year }}/{{personexpedition.person|safe}}.html">{{ otherpersonexpedition.expedition.year }}</a>
{% endfor %}
</p>
2011-07-11 02:10:22 +01:00
<h3>Table of all trips and surveys aligned by date</h3>
<div>
<table class="survexcontibutions">
<!--
<tr><th>Date</th><th colspan="2">Trips</th><th colspan="3">Surveys</th></tr> Remove 'role' -->
<tr><th>Date</th><th colspan="2">Trips</th><th colspan="2">Surveys</th></tr>
2011-07-11 02:10:22 +01:00
{% for persondate in personchronology %}
<tr>
<td class="date">{{persondate.0}}</td>
{% if persondate.1 %}
<td width="35%" class="trip"><a href="{{ persondate.1.logbook_entry.get_absolute_url }}">{{persondate.1.logbook_entry.title|safe}}</a></td>
<td><a href="{{ persondate.1.logbook_entry.cave.get_absolute_url }}"> {{persondate.1.logbook_entry.place|safe}}</a></td>
2011-07-11 02:10:22 +01:00
{% else %}
<td colspan="2"> </td>
{% endif %}
{% if persondate.2 %}
<td class="survexblock"><a href="{% url "svx" persondate.2.survexfile.path %}">{{persondate.2.name}}</a></td>
{%comment%}
<td class="roles" style="padding-right: 3px; text-align:right">
{% for survexpersonrole in persondate.2.survexpersonrole_set.all %}
{{survexpersonrole.nrole}}
{% endfor %}
</td>{%endcomment%}
<td style="text-align:right">
{{persondate.2.legslength|stringformat:".1f"}} m
</td>
2011-07-11 02:10:22 +01:00
{% else %}
<td colspan="3"> </td>
2011-07-11 02:10:22 +01:00
{% endif %}
</tr>
{% endfor %}
</table>
</div>
<div style="color: slategray; background-color:lightcyan">
2022-03-05 12:20:26 +00:00
<p>Horrible bug here but only when there is more than one survex block per day, or is there ?!
<p>WHat we thought was the bug:
e.g. see <a href="/personexpedition/Wookey/1999">Wookey 1999</a> where there are 3 eiscream survex blocks on 5th August.
it duplicates the entry but gets it wrong. The length from the first block is displayed twice but there should be 3 rows: eiscream, eiscream2, eiscream3.
2022-03-05 12:20:26 +00:00
<p>The interaction of django database query idioms with <a href="https://docs.djangoproject.com/en/1.11/ref/templates/api/">django HTML templating language</a> is a bit impenetrable here.
I blame Aaron Curtis who was too fond of being clever with the Django templating system
instead or writing it in python anyone could understand.<br>
- The template is in <var>troggle/templates/personexpedition.html</var>
<br>
- The code is in function <var>personexpedition()</var> which calls
<var>get_person_chronology()</var> in <var>troggle/core/views/logbooks.py</var>
<br>
- the connection between the two is made in the URL resolver in <var>troggle/urls.py</var>
<p>To be fixed!
2022-03-05 12:20:26 +00:00
<h3>What we now know</h3>
<p>The eiscream.svx file does indeed record 3 blocks: eiscream, eiscream2 & eiscream3. But (more) careful inspection shows that eiscream2 and eiscream3 are in
the year 2000, not in 1999. So they absolutely should not be shown here. So maybe everything is correct after all. (Well, apart from the duplication.)
</div>
2011-07-11 02:10:22 +01:00
{% endblock %}