Sort people by notability

Better errors and tidy
Nicer date formats
This commit is contained in:
Sam Wenham 2019-04-02 02:04:38 +01:00
parent c4301cf6df
commit 05c5e26e99
5 changed files with 6 additions and 9 deletions

View File

@ -78,7 +78,7 @@ def EnterLogIntoDbase(date, place, title, text, trippeople, expedition, logtime_
""" saves a logbook entry and related persontrips """ """ saves a logbook entry and related persontrips """
trippersons, author = GetTripPersons(trippeople, expedition, logtime_underground) trippersons, author = GetTripPersons(trippeople, expedition, logtime_underground)
if not author: if not author:
print(" - Skipping logentry: " + title + " no author for entry") print(" - Skipping logentry: " + title + " - no author for entry")
return return
#tripCave = GetTripCave(place) #tripCave = GetTripCave(place)

View File

@ -174,9 +174,6 @@ def GetListDir(sdir):
ff = os.path.join(sdir, f) ff = os.path.join(sdir, f)
res.append((f, ff, os.path.isdir(ff))) res.append((f, ff, os.path.isdir(ff)))
return res return res
def LoadListScansFile(survexscansfolder): def LoadListScansFile(survexscansfolder):

View File

@ -69,7 +69,7 @@ an "S" for a survey trip. The colours are the same for people on the same trip.
{% regroup dateditems|dictsort:"date" by date as dates %} {% regroup dateditems|dictsort:"date" by date as dates %}
{% for date in dates %} {% for date in dates %}
<tr> <tr>
<td>{{date.grouper}}</td> <td>{{date.grouper|date:"D d M Y"}}</td>
<td>{% for item in date.list %} <td>{% for item in date.list %}
{% if item.isLogbookEntry %}<a href="{{ item.get_absolute_url }}">{{item.title|safe}}</a><br/>{% endif %} {% if item.isLogbookEntry %}<a href="{{ item.get_absolute_url }}">{{item.title|safe}}</a><br/>{% endif %}
{% endfor %}</td> {% endfor %}</td>

View File

@ -7,7 +7,7 @@
{% block related %}{% endblock %} {% block related %}{% endblock %}
{% block nav %}{% endblock %} {% block nav %}{% endblock %}
<h2>{{logbookentry.title}}</h2> <h2>{{logbookentry.title|safe}}</h2>
<div id="related"> <div id="related">
<p><a href="{{ logbookentry.expedition.get_absolute_url }}">{{logbookentry.expedition.name}}</a></p> <p><a href="{{ logbookentry.expedition.get_absolute_url }}">{{logbookentry.expedition.name}}</a></p>
@ -66,7 +66,7 @@
<div id="col1"> <div id="col1">
<div class="logbookentry"> <div class="logbookentry">
<b>{{logbookentry.date}}</b> <b>{{logbookentry.date|date:"D d M Y"}}</b>
{% if logbookentry.entry_type == "html" %} {% if logbookentry.entry_type == "html" %}
<p>{{logbookentry.text|safe}}</p> <p>{{logbookentry.text|safe}}</p>
{% else %} {% else %}

View File

@ -8,12 +8,12 @@
<h2>Notable expoers</h2> <h2>Notable expoers</h2>
<table class="searchable"> <table class="searchable">
<tr><th>Person</th><th>First</th><th>Last</th><th>Notability</th></tr> <tr><th>Person</th><th>First</th><th>Last</th><th>Notability</th></tr>
{% for person in notablepersons %} {% for person in notablepersons|dictsortreversed:"notability" %}
<tr> <tr>
<td><a href="{{ person.get_absolute_url }}">{{person|wiki_to_html_short}}</a></td> <td><a href="{{ person.get_absolute_url }}">{{person|wiki_to_html_short}}</a></td>
<td><a href="{{ person.first.get_absolute_url }}">{{ person.first.expedition.year }}</a></td> <td><a href="{{ person.first.get_absolute_url }}">{{ person.first.expedition.year }}</a></td>
<td><a href="{{ person.last.get_absolute_url }}">{{ person.last.expedition.year }}</a></td> <td><a href="{{ person.last.get_absolute_url }}">{{ person.last.expedition.year }}</a></td>
<td>{{person.notability}}</td> <td>{{person.notability|floatformat:2}}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>