diff options
-rw-r--r-- | core/views_logbooks.py | 7 | ||||
-rw-r--r-- | templates/base.html | 3 | ||||
-rw-r--r-- | templates/core/expedition_list.html | 14 | ||||
-rw-r--r-- | templates/core/expeditions_json_list.html | 3 | ||||
-rw-r--r-- | templates/statistics.html | 10 | ||||
-rw-r--r-- | urls.py | 1 |
6 files changed, 14 insertions, 24 deletions
diff --git a/core/views_logbooks.py b/core/views_logbooks.py index c3cea1e..dcc26f8 100644 --- a/core/views_logbooks.py +++ b/core/views_logbooks.py @@ -84,9 +84,10 @@ def expedition(request, expeditionname): def get_absolute_url(self): return ('expedition', (expedition.year)) -class ExpeditionListView(ListView): # django thus expects a template called "expedition_list.html" -# from the name of the object not the name of the class. - model = Expedition +# replaced by statistics page +# class ExpeditionListView(ListView): # django thus expects a template called "expedition_list.html" +# # from the name of the object not the name of the class. + # model = Expedition class Expeditions_tsvListView(ListView): diff --git a/templates/base.html b/templates/base.html index 2a61aac..a8050e5 100644 --- a/templates/base.html +++ b/templates/base.html @@ -47,8 +47,7 @@ <a href="{% url "frontpage" %}">tasks to do </a> | <a id="cavesLink" href="{% url "caveindex" %}">caves</a> | <a id="caversLink" href="{% url "personindex" %}">people</a> | - <a id="expeditionsLink" href="{% url "expeditions" %}">all expeditions</a> | - <a href="{% url "stats" %}">statistics</a> | + <a href="{% url "stats" %}">expo statistics</a> | <a href="{% url "controlpanel" %}">import/export data</a> <a href="/admin/">Django admin</a> </div> diff --git a/templates/core/expedition_list.html b/templates/core/expedition_list.html deleted file mode 100644 index 15baa6b..0000000 --- a/templates/core/expedition_list.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "base.html" %} -{% load wiki_markup %} -{% load link %} - -{% block content %} -<h1>Expeditions</h1> -<ul> -{% for expedition in object_list %} - <li>{{ expedition.year }} - <a href="{{ expedition.get_absolute_url }}">{{ expedition.name }}</a></li> -{% empty %} - <li>No articles yet.</li> -{% endfor %} -</ul> -{% endblock %}
\ No newline at end of file diff --git a/templates/core/expeditions_json_list.html b/templates/core/expeditions_json_list.html index ad92206..a56c301 100644 --- a/templates/core/expeditions_json_list.html +++ b/templates/core/expeditions_json_list.html @@ -1,4 +1,5 @@ {% extends "baseapi.html" %} {% block content %}{ -{% for expedition in object_list %}{% if not forloop.last %}"{{expedition.year}}": ["{{expedition.name}}","{{expedition.get_absolute_url}}"],{% endif %}{% if forloop.last %}"{{expedition.year}}": ["{{expedition.name}}","{{expedition.get_absolute_url}}"]{% endif %} +{% for expedition in object_list %}{% if not forloop.last %}"{{expedition.year}}": + ["{{expedition.name}}","{{expedition.get_absolute_url}}"],{% endif %}{% if forloop.last %}"{{expedition.year}}": ["{{expedition.name}}","{{expedition.get_absolute_url}}"]{% endif %} {% endfor %} }{% endblock %}
\ No newline at end of file diff --git a/templates/statistics.html b/templates/statistics.html index d279f4f..790b745 100644 --- a/templates/statistics.html +++ b/templates/statistics.html @@ -5,7 +5,8 @@ {% block title %}Expo statistics{% endblock %} {% block content %} -<h1>Expo Statistics</h1> + +<h1>Expedition Statistics</h1> <p>{{ expoCount }} expeditions: {{ personCount }} people, {{ caveCount }} caves and {{ logbookEntryCount }} logbook entries. @@ -14,13 +15,13 @@ Total length: {{addupsurvexlength|stringformat:".1f"}} km adding up the total fo <p>These are uncorrected tape lengths which include pitches and duplicates but exclude splays or surface-surveys. <p> -This is work in progress (July 2020). +This is work in progress (March 2021). <table> <tr><th>Year</th><th>Survex<br>Survey<br>Blocks</th><th>Survex<br>Survey Legs</th><th>Total length<br>(m)</th></tr> {% for legs in legsbyexpo %} <tr> - <td>{{legs.0.year}}</td> + <td style="text-align:center"><a href="{{ legs.0.get_absolute_url }}">{{legs.0}}</a></td> <td style="text-align:center">{{legs.0.survexblock_set.all|length}}</td> <td style="text-align:center">{{legs.1.nsurvexlegs|rjust:"10"}} </td> <td style="text-align:right">{{legs.1.survexleglength}}</td> @@ -30,4 +31,7 @@ This is work in progress (July 2020). <p>One Survex Survey Block is one *begin/*end block of data in a survex file. Some files from other caving clubs may have a convention of using many more blocks per file than we do, e.g. if the file is exported from other software into survex format. + + + {% endblock %}
\ No newline at end of file @@ -66,7 +66,6 @@ actualurlpatterns = [ # url(r'^personform/(.*)$', personForm), url(r'^expedition/(\d+)$', views_logbooks.expedition, name="expedition"), - url(r'^expeditions/?$', views_logbooks.ExpeditionListView.as_view(), name="expeditions"), url(r'^api/expeditions_tsv$', views_logbooks.Expeditions_tsvListView.as_view()), url(r'^api/expeditions_json$', views_logbooks.Expeditions_jsonListView.as_view()), url(r'^personexpedition/(?P<first_name>[A-Z]*[a-z&;]*)[^a-zA-Z]*(?P<last_name>[A-Z]*[a-zA-Z&;]*)/(?P<year>\d+)/?$', views_logbooks.personexpedition, name="personexpedition"), |