summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-01-20 20:42:26 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2025-01-20 20:42:26 +0000
commit7769fa868efdd408ebcb5d527098915a9ee68006 (patch)
tree149912e4576534aaf0c9798519bf616a1cd6b049
parent1fcb2c520385209e0e90ac7e4a89a9057a25b1c2 (diff)
downloadtroggle-7769fa868efdd408ebcb5d527098915a9ee68006.tar.gz
troggle-7769fa868efdd408ebcb5d527098915a9ee68006.tar.bz2
troggle-7769fa868efdd408ebcb5d527098915a9ee68006.zip
new page listing people's ids
-rw-r--r--core/views/logbooks.py15
-rw-r--r--templates/people_ids.html30
2 files changed, 45 insertions, 0 deletions
diff --git a/core/views/logbooks.py b/core/views/logbooks.py
index 8b62368..d74b54a 100644
--- a/core/views/logbooks.py
+++ b/core/views/logbooks.py
@@ -48,6 +48,21 @@ def notablepersons(request):
request, "notablepersons.html", {"persons": persons, "pcols": pcols, "notablepersons": notablepersons}
)
+def people_ids(request):
+
+ persons = Person.objects.all()
+ # From what I can tell, "persons" seems to be the table rows, while "pcols" is the table columns. - AC 16 Feb 09
+ pcols = []
+ ncols = 4
+ nc = int((len(persons) + ncols - 1) / ncols)
+ for i in range(ncols):
+ pcols.append(persons[i * nc : (i + 1) * nc])
+
+
+ return render(
+ request, "people_ids.html", {"persons": persons, "pcols": pcols}
+ )
+
def expedition(request, expeditionname):
"""Returns a rendered page for one expedition, specified by the year e.g. '2019'.
diff --git a/templates/people_ids.html b/templates/people_ids.html
new file mode 100644
index 0000000..ae89337
--- /dev/null
+++ b/templates/people_ids.html
@@ -0,0 +1,30 @@
+{% extends "base.html" %}
+{% block title %}Person Index{% endblock %}
+
+{% block content %}
+<!-- people.html - this text visible because this template has been included -->
+
+
+<h2>All expoers</h2>
+<table class="searchable">
+<tr>
+{% for persons in pcols %}
+<td>
+
+<table>
+<tr><th>Person</th><th>troggle ID</th></tr>
+{% for person in persons %}
+<tr>
+ <td style="padding: 3px">{{person.fullname|safe}}</td>
+ <td style="padding: 3px"><a href="{{ person.get_absolute_url }}">{{person|safe}}</a></td>
+
+
+</tr>
+{% endfor %}
+</table>
+</td>
+{% endfor %}
+</tr>
+</table>
+
+{% endblock %}