summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Wenham <sam@wenhams.co.uk>2018-04-11 22:02:57 +0100
committerSam Wenham <sam@wenhams.co.uk>2018-04-11 22:02:57 +0100
commit789c33fcb6694544abb3991ccd3691a175216a55 (patch)
tree2cd893dd0bc7c99d41cb460f14d36f0c1e2e74ca
parent0ef4f7832c6b50c3921ff2629240404a77cdf33b (diff)
downloadtroggle-789c33fcb6694544abb3991ccd3691a175216a55.tar.gz
troggle-789c33fcb6694544abb3991ccd3691a175216a55.tar.bz2
troggle-789c33fcb6694544abb3991ccd3691a175216a55.zip
Upgrade to django 1.5, some functions have been changed
url in templates now requires quotes roung the first arg USE_TZ added
-rw-r--r--middleware.py2
-rw-r--r--profiles/views.py2
-rw-r--r--settings.py1
-rw-r--r--templates/base.html40
-rw-r--r--templates/cave.html4
-rw-r--r--templates/cave_entrances.html4
-rw-r--r--templates/caveindex.html2
-rw-r--r--templates/controlPanel.html6
-rw-r--r--templates/editfile.html8
-rw-r--r--templates/expedition.html6
-rw-r--r--templates/expowebbase.html16
-rw-r--r--templates/flatpage.html2
-rw-r--r--templates/frontpage.html2
-rw-r--r--templates/index.html18
-rw-r--r--templates/listdir.html6
-rw-r--r--templates/logbookentry.html2
-rw-r--r--templates/menu.html4
-rw-r--r--templates/pagenotfound.html2
-rw-r--r--templates/personexpedition.html2
-rw-r--r--templates/registration/activate.html4
-rw-r--r--templates/registration/activation_email.html2
-rw-r--r--templates/registration/activation_email.txt2
-rw-r--r--templates/registration/registration_form.html2
-rw-r--r--templates/survexblock.html6
-rw-r--r--templates/survexscansfolder.html2
-rw-r--r--templates/survexscansfolders.html2
-rw-r--r--templates/survey.html4
-rw-r--r--templates/svxcavesingle.html4
-rw-r--r--templates/svxfile.html2
-rw-r--r--templates/svxfilecavelist.html18
-rw-r--r--templates/svxfiledifflistonly.html2
-rw-r--r--templates/todo.html18
-rw-r--r--templates/tunnelfiles.html4
-rw-r--r--urls.py6
34 files changed, 104 insertions, 103 deletions
diff --git a/middleware.py b/middleware.py
index 15dd039..7c27500 100644
--- a/middleware.py
+++ b/middleware.py
@@ -19,7 +19,7 @@ class SmartAppendSlashMiddleware(object):
"""
# Check for a redirect based on settings.SMART_APPEND_SLASH
- host = http.get_host(request)
+ host = http.HttpRequest.get_host(request)
old_url = [host, request.path]
new_url = old_url[:]
# Append a slash if SMART_APPEND_SLASH is set and the resulting URL
diff --git a/profiles/views.py b/profiles/views.py
index dec1172..c9552ab 100644
--- a/profiles/views.py
+++ b/profiles/views.py
@@ -11,7 +11,7 @@ from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.shortcuts import render_to_response
from django.template import RequestContext
-from django.views.generic.list_detail import object_list
+from django.views.generic.list import ListView
from django import forms
from core.models import Person
diff --git a/settings.py b/settings.py
index 670c84c..fb045f9 100644
--- a/settings.py
+++ b/settings.py
@@ -18,6 +18,7 @@ MANAGERS = ADMINS
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
+USE_TZ = True
TIME_ZONE = 'Europe/London'
# Language code for this installation. All choices can be found here:
diff --git a/templates/base.html b/templates/base.html
index 8a3977e..11568af 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -22,9 +22,9 @@
{% if user.username %}
You are logged in as {{ user.username }}
{% if user.person %}(<a href="{{ user.person.get_absolute_url }}">{{ user.person }}</a>)
- {% else %}<a href={% url profiles_select_profile %}>sort your profile</a>
+ {% else %}<a href={% url "profiles_select_profile" %}>sort your profile</a>
{% endif %}.
- | <a href="{% url auth_logout %}">Log out</a> {% else %} <a href="{% url registration_register %}">Sign up</a> | <a href="{% url auth_login %}">Log in</a> {% endif %}
+ | <a href="{% url "auth_logout" %}">Log out</a> {% else %} <a href="{% url "registration_register" %}">Sign up</a> | <a href="{% url "auth_login" %}">Log in</a> {% endif %}
{% endblock%}
{% block editLink %}
@@ -32,17 +32,17 @@
</div>
</div>
<div class="toolbarlinks">
- <a href="{% url survexcaveslist %}">All Survex</a> |
- <a href="{% url surveyscansfolders %}">Scans</a> |
- <a href="{% url tunneldata %}">Tunneldata</a> |
- <a href="{% url survexcavessingle 107 %}">107</a> |
- <a href="{% url survexcavessingle 161 %}">161</a> |
- <a href="{% url survexcavessingle 204 %}">204</a> |
- <a href="{% url survexcavessingle 258 %}">258</a> |
- <a href="{% url survexcavessingle 264 %}">264</a> |
- <a href="{% url expedition 2014 %}">Expo2014</a> |
- <a href="{% url expedition 2015 %}">Expo2015</a> |
- <a href="{% url expedition 2016 %}">Expo2016</a> |
+ <a href="{% url "survexcaveslist" %}">All Survex</a> |
+ <a href="{% url "surveyscansfolders" %}">Scans</a> |
+ <a href="{% url "tunneldata" %}">Tunneldata</a> |
+ <a href="{% url "survexcavessingle" 107 %}">107</a> |
+ <a href="{% url "survexcavessingle" 161 %}">161</a> |
+ <a href="{% url "survexcavessingle" 204 %}">204</a> |
+ <a href="{% url "survexcavessingle" 258 %}">258</a> |
+ <a href="{% url "survexcavessingle" 264 %}">264</a> |
+ <a href="{% url "expedition" 2014 %}">Expo2014</a> |
+ <a href="{% url "expedition" 2015 %}">Expo2015</a> |
+ <a href="{% url "expedition" 2016 %}">Expo2016</a> |
<a href="/admin/">Django admin</a>
</div>
@@ -85,24 +85,24 @@
<li><a id="expoWebsiteLink" href="http://expo.survex.com">Expedition website</a></li>
</ul>
</li>
- <li><a href="{% url frontpage %}">Troggle front page</a></li>
- <li><a id="cavesLink" href="{% url caveindex %}">caves</a></li>
- <li><a id="caversLink" href="{% url personindex %}">cavers</a></li>
+ <li><a href="{% url "frontpage" %}">Troggle front page</a></li>
+ <li><a id="cavesLink" href="{% url "caveindex" %}">caves</a></li>
+ <li><a id="caversLink" href="{% url "personindex" %}">cavers</a></li>
<li><a href="#">expeditions</a>
<ul class="sub_menu">
<li><a id="expeditionsLink" href="{{ Expedition.objects.latest.get_absolute_url }}">newest</a></li>
- <li><a id="expeditionsLink" href="{% url expeditions %}">list all</a></li>
+ <li><a id="expeditionsLink" href="{% url "expeditions" %}">list all</a></li>
</ul>
</li>
- <li><a id="surveyBinderLink" href="{% url survey %}">survey binder</a></li>
+ <li><a id="surveyBinderLink" href="{% url "survey" %}">survey binder</a></li>
<li><a href="#">diversions</a>
<ul class="sub_menu">
- <li><a href="{% url stats %}">statistics</a></li>
+ <li><a href="{% url "stats" %}">statistics</a></li>
</ul>
</li>
<li><a href="#">admin</a>
<ul class="sub_menu">
- <li><a id="cuccLink" href="{% url controlpanel %}">Import / export data</a></li>
+ <li><a id="cuccLink" href="{% url "controlpanel" %}">Import / export data</a></li>
<li><a id="expoWebsiteLink" href="{{ settings.URL_ROOT }}admin">Troggle administration pages</a></li>
</ul>
<li class="toggleMenu"><a href="#">hide menu</a></li>
diff --git a/templates/cave.html b/templates/cave.html
index 5bd77f6..358ad89 100644
--- a/templates/cave.html
+++ b/templates/cave.html
@@ -36,7 +36,7 @@
{{ ent.entrance_letter|safe }}
{% if ent.entrance.name %}
{{ ent.entrance.name|safe }}
- {% endif %}<a href="{% url editentrance cave.slug ent.entrance.slug %}">Edit</a>
+ {% endif %}<a href="{% url "editentrance" cave.slug ent.entrance.slug %}">Edit</a>
<dl>
{% if ent.entrance.marking %}
<dt>Marking</dt><dd>{{ ent.entrance.marking_val|safe }}</dd>
@@ -96,7 +96,7 @@
</ul>
{% endif %}</p>
-<a href="{% url newentrance cave.slug %}">New Entrance</a>
+<a href="{% url "newentrance" cave.slug %}">New Entrance</a>
</div>
<div id="Description">
diff --git a/templates/cave_entrances.html b/templates/cave_entrances.html
index 5b70196..e3a571f 100644
--- a/templates/cave_entrances.html
+++ b/templates/cave_entrances.html
@@ -7,7 +7,7 @@
{{ ent.entrance_letter|safe }}
{% if ent.entrance.name %}
{{ ent.entrance.name|safe }}
- {% endif %}<a href="{% url editentrance cave.slug ent.entrance.slug %}">Edit</a>
+ {% endif %}<a href="{% url "editentrance" cave.slug ent.entrance.slug %}">Edit</a>
<dl>
{% if ent.entrance.marking %}
<dt>Marking</dt><dd>{{ ent.entrance.marking_val|safe }}</dd>
@@ -67,5 +67,5 @@
</ul>
{% endif %}</p>
-<a href="{% url newentrance cave.slug %}">New Entrance</a>
+<a href="{% url "newentrance" cave.slug %}">New Entrance</a>
</div>
diff --git a/templates/caveindex.html b/templates/caveindex.html
index fe141ed..d99f452 100644
--- a/templates/caveindex.html
+++ b/templates/caveindex.html
@@ -34,6 +34,6 @@
{% endfor %}
</ul>
-<a href="{% url newcave %}">New Cave</a>
+<a href="{% url "newcave" %}">New Cave</a>
{% endblock %}
diff --git a/templates/controlPanel.html b/templates/controlPanel.html
index 7d37887..327af13 100644
--- a/templates/controlPanel.html
+++ b/templates/controlPanel.html
@@ -68,7 +68,7 @@
</form>
</td>
<td>
- <form name="export" method="get" action="{% url downloadcavetab %}">
+ <form name="export" method="get" action="{% url "downloadcavetab" %}">
<p>Download a CAVETAB2.CSV file which is dynamically generated by Troggle.</p>
<input name="download_cavetab" type="submit" value="Download CAVETAB2.CSV" />
</form>
@@ -83,7 +83,7 @@
</td>
<td>
- <form name="export" method="get" action={% url downloadlogbook %}>
+ <form name="export" method="get" action={% url "downloadlogbook" %}>
<p>Download a logbook file which is dynamically generated by Troggle.</p>
<p>
@@ -120,7 +120,7 @@
</form>
</td>
<td>
- <form name="export" method="get" action={% url downloadsurveys %}>
+ <form name="export" method="get" action={% url "downloadsurveys" %}>
<p>Download a Surveys.csv file which is dynamically generated by Troggle.</p>
<input disabled name="download_surveys" type="submit" value="Download Surveys.csv" />
</form>
diff --git a/templates/editfile.html b/templates/editfile.html
index c420654..64f1fba 100644
--- a/templates/editfile.html
+++ b/templates/editfile.html
@@ -6,16 +6,16 @@
$(function() {
$("#id_date").datepicker({dateFormat: "yy-mm-dd"});
$("#id_cave").change(function() {
- $('#id_entrance').load('{% url get_entrances caveslug="" %}' + this.value);
+ $('#id_entrance').load('{% url "get_entrances" caveslug="" %}' + this.value);
});
$("#id_cave").change(function() {
- $('#id_qm').load('{% url get_qms caveslug="" %}' + this.value);
+ $('#id_qm').load('{% url "get_qms" caveslug="" %}' + this.value);
});
$("#id_expedition").change(function() {
- $('#id_logbookentry').load('{% url get_logbook_entries expeditionslug="" %}' + this.value);
+ $('#id_logbookentry').load('{% url "get_logbook_entries" expeditionslug="" %}' + this.value);
});
$("#id_expedition").change(function() {
- $('#id_person').load('{% url get_people expeditionslug="" %}' + this.value);
+ $('#id_person').load('{% url "get_people" expeditionslug="" %}' + this.value);
});
});
diff --git a/templates/expedition.html b/templates/expedition.html
index 4fab025..548dc4f 100644
--- a/templates/expedition.html
+++ b/templates/expedition.html
@@ -51,7 +51,7 @@ an "S" for a survey trip. The colours are the same for people on the same trip.
{% endfor %}
<br/>
{% for survexblock in persondayactivities.survexblocks %}
- <a href="{% url svx survexblock.survexfile.path %}" class="dayindexsurvex-{{survexblock.DayIndex}}">S</a>
+ <a href="{% url "svx" survexblock.survexfile.path %}" class="dayindexsurvex-{{survexblock.DayIndex}}">S</a>
{% endfor %}
</td>
{% else %}
@@ -67,7 +67,7 @@ an "S" for a survey trip. The colours are the same for people on the same trip.
<form action="" method="GET"><input type="submit" name="reload" value="Reload"></form>
<h3>Logbooks and survey trips per day</h3>
-<a href="{% url newLogBookEntry expeditionyear=expedition.year %}">New logbook entry</a>
+<a href="{% url "newLogBookEntry" expeditionyear=expedition.year %}">New logbook entry</a>
<table class="expeditionlogbooks">
<tr><th>Date</th><th>Logged trips</th><th>Surveys</th></tr>
{% regroup dateditems|dictsort:"date" by date as dates %}
@@ -78,7 +78,7 @@ an "S" for a survey trip. The colours are the same for people on the same trip.
{% if item.isLogbookEntry %}<a href="{{ item.get_absolute_url }}">{{item.title|safe}}</a><br/>{% endif %}
{% endfor %}</td>
<td>{% for item in date.list %}
- {% if item.isSurvexBlock %}<a href="{% url svx item.survexfile.path %}">{{item.name}}</a><br/>{% endif %}
+ {% if item.isSurvexBlock %}<a href="{% url "svx" item.survexfile.path %}">{{item.name}}</a><br/>{% endif %}
{% endfor %}</td>
</tr>
{% endfor %}
diff --git a/templates/expowebbase.html b/templates/expowebbase.html
index 5d5b424..becdb05 100644
--- a/templates/expowebbase.html
+++ b/templates/expowebbase.html
@@ -16,14 +16,14 @@
<li><a href="/indxal.htm">Cave index</a></li>
{% if cavepage %}
<ul>
-<li><a href="{% url survexcaveslist %}">All Survex</a></li>
-<li><a href="{% url surveyscansfolders %}">Scans</a></li>
-<li><a href="{% url tunneldata %}">Tunneldata</a></li>
-<li><a href="{% url survexcavessingle 161 %}">161</a></li>
-<li><a href="{% url survexcavessingle 204 %}">204</a></li>
-<li><a href="{% url survexcavessingle 258 %}">258</a></li>
-<li><a href="{% url expedition 2012 %}">Expo2012</a></li>
-<li><a href="{% url expedition 2013 %}">Expo2013</a></li>
+<li><a href="{% url "survexcaveslist" %}">All Survex</a></li>
+<li><a href="{% url "surveyscansfolders" %}">Scans</a></li>
+<li><a href="{% url "tunneldata" %}">Tunneldata</a></li>
+<li><a href="{% url "survexcavessingle" 161 %}">161</a></li>
+<li><a href="{% url "survexcavessingle" 204 %}">204</a></li>
+<li><a href="{% url "survexcavessingle" 258 %}">258</a></li>
+<li><a href="{% url "expedition" 2012 %}">Expo2012</a></li>
+<li><a href="{% url "expedition" 2013 %}">Expo2013</a></li>
<li><a href="/admin">Django admin</a></li>
</ul>
{% endif %}
diff --git a/templates/flatpage.html b/templates/flatpage.html
index 47863e3..2376159 100644
--- a/templates/flatpage.html
+++ b/templates/flatpage.html
@@ -3,5 +3,5 @@
{% block bodyattrs %}{% if homepage %} id="homepage"{% endif %}{% endblock %}
{% block body %}
{{ body|safe }}
-{% if homepage %}{% if editable %}<a href="{% url editflatpage path %}">Edit</a>{% endif %}{%else %}{% include "menu.html" %}{% endif %}
+{% if homepage %}{% if editable %}<a href="{% url "editflatpage" path %}">Edit</a>{% endif %}{%else %}{% include "menu.html" %}{% endif %}
{% endblock %}
diff --git a/templates/frontpage.html b/templates/frontpage.html
index 2c1456c..bad3ce5 100644
--- a/templates/frontpage.html
+++ b/templates/frontpage.html
@@ -57,7 +57,7 @@ Everyone is gearing up for the 2009 expedition; please see the link below for th
<h3>Troggle development</h3>
<p class="indent">
-Troggle is still under development. Check out the <a href="http://troggle.googlecode.com">development page</a> on google code, where you can file bug reports, make suggestions, and help develop the code. There is also an old todo list at <a href="{%url todo%}">here</a>.
+Troggle is still under development. Check out the <a href="http://troggle.googlecode.com">development page</a> on google code, where you can file bug reports, make suggestions, and help develop the code. There is also an old todo list at <a href="{%url "todo"%}">here</a>.
</p>
</div>
{% endblock content %}
diff --git a/templates/index.html b/templates/index.html
index c0974e8..614c180 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -8,14 +8,14 @@
<h2>The unfinished front page</h2>
<ul>
<li><b>About {{totallogbookentries}} logbook entries have been loaded</b></li>
- <li><b><a href="{% url personindex %}">List of People</a></b></li>
- <li><b><a href="{% url caveindex %}">List of Caves</a></b></li>
- <li><a href="{% url jgtfile aaaa %}">JGT list of files</a> (temporary simple file list and tunnel use)</li>
- <li><a href="{% url survey %}">Survey files</a></li>
- <li><a href="{% url svx all %}">Survex directory</a></li>
- <li><a href="{% url expedition 2008 %}">Expedition 2008</a></li>
- <li><a href="{% url expedition 2007 %}">Expedition 2007</a></li>
- <li><a href="{% url expedition 1992 %}">Expedition 1992</a> (earliest parsed)</li>
+ <li><b><a href="{% url "personindex" %}">List of People</a></b></li>
+ <li><b><a href="{% url "caveindex" %}">List of Caves</a></b></li>
+ <li><a href="{% url "jgtfile" aaaa %}">JGT list of files</a> (temporary simple file list and tunnel use)</li>
+ <li><a href="{% url "survey" %}">Survey files</a></li>
+ <li><a href="{% url "svx" all %}">Survex directory</a></li>
+ <li><a href="{% url "expedition" 2008 %}">Expedition 2008</a></li>
+ <li><a href="{% url "expedition" 2007 %}">Expedition 2007</a></li>
+ <li><a href="{% url "expedition" 1992 %}">Expedition 1992</a> (earliest parsed)</li>
</ul>
<h2>Further work</h2>
@@ -50,7 +50,7 @@
<ul id="expeditionlist">
{% for expedition in expeditions %}
<li>
- <a href="{% url expedition expedition.year %}">{{expedition.name}}</a>
+ <a href="{% url "expedition" expedition.year %}">{{expedition.name}}</a>
- <b>{{expedition.logbookentry_set.count}}</b> logbook entries
</li>
{% endfor %}
diff --git a/templates/listdir.html b/templates/listdir.html
index 7f83b5a..d220ea1 100644
--- a/templates/listdir.html
+++ b/templates/listdir.html
@@ -3,20 +3,20 @@
<h3>Files</h3>
<ul>
{% for lf in listdirfiles %}
-<li><a href="{% url jgtfile lf.0 %}">{{lf.1}}</a> ({{lf.2}} bytes)</li>
+<li><a href="{% url "jgtfile" lf.0 %}">{{lf.1}}</a> ({{lf.2}} bytes)</li>
{% endfor %}
</ul>
<h3>Upperdirectories</h3>
<ul>
{% for lf in upperdirs %}
-<li><a href="{% url jgtfile lf.0 %}">{{lf.1}}</a></li>
+<li><a href="{% url "jgtfile" lf.0 %}">{{lf.1}}</a></li>
{% endfor %}
</ul>
<h3>Subdirectories</h3>
<ul>
{% for lf in listdirdirs %}
-<li><a href="{% url jgtfile lf.0 %}">{{lf.1}}</a> ({{lf.2}} files)</li>
+<li><a href="{% url "jgtfile" lf.0 %}">{{lf.1}}</a> ({{lf.2}} files)</li>
{% endfor %}
</ul>
diff --git a/templates/logbookentry.html b/templates/logbookentry.html
index a3ffc3d..93ce32b 100644
--- a/templates/logbookentry.html
+++ b/templates/logbookentry.html
@@ -71,7 +71,7 @@
</div>
</div>
-{% if logbookentry.filename %}<a href="{% url editLogBookEntry expeditionyear=logbookentry.expedition.year pdate=logbookentry.date pslug=logbookentry.slug %}">Edit</a> <a href="{% url deleteLogBookEntry expeditionyear=logbookentry.expedition.year date=logbookentry.date slug=logbookentry.slug %}">Delete</a>{%endif%}
+{% if logbookentry.filename %}<a href="{% url "editLogBookEntry" expeditionyear=logbookentry.expedition.year pdate=logbookentry.date pslug=logbookentry.slug %}">Edit</a> <a href="{% url "deleteLogBookEntry" expeditionyear=logbookentry.expedition.year date=logbookentry.date slug=logbookentry.slug %}">Delete</a>{%endif%}
{% endblock %}
diff --git a/templates/menu.html b/templates/menu.html
index bea6067..c069de1 100644
--- a/templates/menu.html
+++ b/templates/menu.html
@@ -7,7 +7,7 @@
<li><a href="/indxal.htm">Caves</a></li>
<li><a href="/handbook/index.htm">Handbook</a></li>
<li><a href="/pubs.htm">Reports</a></li>
-{% if editable %}<li><a href="{% url editflatpage path %}" class="editlink"><strong>Edit this page</strong></a></li>{% endif %}
-{% if cave_editable %}<li><a href="{% url edit_cave cave_editable %}" class="editlink"><strong>Edit this cave</strong></a></li>{% endif %}
+{% if editable %}<li><a href="{% url "editflatpage" path %}" class="editlink"><strong>Edit this page</strong></a></li>{% endif %}
+{% if cave_editable %}<li><a href="{% url "edit_cave" cave_editable %}" class="editlink"><strong>Edit this cave</strong></a></li>{% endif %}
</ul>
{% endif %}
diff --git a/templates/pagenotfound.html b/templates/pagenotfound.html
index 03569de..4fdfe2a 100644
--- a/templates/pagenotfound.html
+++ b/templates/pagenotfound.html
@@ -2,6 +2,6 @@
{% block title %}Page not found {{ path }}{% endblock %}
{% block body %}
<h1>Page not found {{ path }}</h1>
-<a href="{%url editflatpage path %}">Create this page.</a>
+<a href="{%url "editflatpage" path %}">Create this page.</a>
{% include "menu.html" %}
{% endblock %}
diff --git a/templates/personexpedition.html b/templates/personexpedition.html
index b88f44e..30d071b 100644
--- a/templates/personexpedition.html
+++ b/templates/personexpedition.html
@@ -39,7 +39,7 @@
{% endif %}
{% if persondate.2 %}
- <td class="survexblock"><a href="{% url svx persondate.2.survexfile.path %}">{{persondate.2}}</a></td>
+ <td class="survexblock"><a href="{% url "svx" persondate.2.survexfile.path %}">{{persondate.2}}</a></td>
<td class="roles">
{% for survexpersonrole in persondate.2.survexpersonrole_set.all %}
{{survexpersonrole.nrole}}
diff --git a/templates/registration/activate.html b/templates/registration/activate.html
index 3f95a18..cf8e79a 100644
--- a/templates/registration/activate.html
+++ b/templates/registration/activate.html
@@ -12,11 +12,11 @@ New troggle account registered
{% if account %}
<p>
-Hello, {{ account }}! Your account is now activated. Now you can <a href="{%url auth_login%}">log in</a> with the password you chose. Use the links in the upper right to control this in the future.
+Hello, {{ account }}! Your account is now activated. Now you can <a href="{%url "auth_login"%}">log in</a> with the password you chose. Use the links in the upper right to control this in the future.
</p>
<p>
-If you have been on the expedition in the past, you already have a profile in the system; <a href={% url profiles_select_profile %}>click here </a> to find it and link it to your account. Otherwise, please <a href={% url profiles_create_profile %}> create yourself a new profile</a>.
+If you have been on the expedition in the past, you already have a profile in the system; <a href={% url "profiles_select_profile" %}>click here </a> to find it and link it to your account. Otherwise, please <a href={% url "profiles_create_profile" %}> create yourself a new profile</a>.
</p>
{% else %}
diff --git a/templates/registration/activation_email.html b/templates/registration/activation_email.html
index abb0ad1..3b82c60 100644
--- a/templates/registration/activation_email.html
+++ b/templates/registration/activation_email.html
@@ -2,7 +2,7 @@
<P>Glad you're joining the CUCC EXPO team! Please go to</P>
-<P><a href="{{ site }}{% url registration_activate activation_key %}">{{ site }}{% url registration_activate activation_key %}</a></P>
+<P><a href="{{ site }}{% url "registration_activate" activation_key %}">{{ site }}{% url "registration_activate" activation_key %}</a></P>
<P>to activate your account. Do this within {{ expiration_days }} days, or else you'll have to sign up again.</P>
diff --git a/templates/registration/activation_email.txt b/templates/registration/activation_email.txt
index 9b240c2..bce7fbe 100644
--- a/templates/registration/activation_email.txt
+++ b/templates/registration/activation_email.txt
@@ -2,7 +2,7 @@ Hello {{ form.user }},
Glad you're joining the CUCC EXPO team! Please go to
-{{ site }}{% url registration_activate activation_key %}
+{{ site }}{% url "registration_activate" activation_key %}
to activate your account. Do this within {{ expiration_days }} days, or else you'll have to sign up again.
diff --git a/templates/registration/registration_form.html b/templates/registration/registration_form.html
index f82c6cb..6c4a7f6 100644
--- a/templates/registration/registration_form.html
+++ b/templates/registration/registration_form.html
@@ -9,7 +9,7 @@ registration_form.html | {{ block.super }}
{% endblock %}
{% block content %}
-<form action="{% url registration_register %}" method="POST">{% csrf_token %}
+<form action="{% url "registration_register" %}" method="POST">{% csrf_token %}
{% for error in form.non_field_errors %}
<span style="color:red">{{ error }}</span>
{% endfor %}
diff --git a/templates/survexblock.html b/templates/survexblock.html
index c4c1066..b159956 100644
--- a/templates/survexblock.html
+++ b/templates/survexblock.html
@@ -8,7 +8,7 @@
{% block content %}
<h2>Survex Block {{survexblock.survexpath}}</h2>
-<p>Link to <a href="{% url svx survexblock.survexfile.path %}">{{survexblock.survexfile.path}}</a></p>
+<p>Link to <a href="{% url "svx" survexblock.survexfile.path %}">{{survexblock.survexfile.path}}</a></p>
<p>Needs duplicates removed from right hand column</p>
<p>Needs links to survex file presentation</p>
@@ -18,13 +18,13 @@
{% if survexblock.parent %}
<p>Survey block above:</p>
- <p class="indent"><a href="{% url survexblock survexblock.parent.survexpath %}">{{survexblock.parent.survexpath}}</a></p>
+ <p class="indent"><a href="{% url "survexblock" survexblock.parent.survexpath %}">{{survexblock.parent.survexpath}}</a></p>
{% endif %}
{% if survexblock.survexblock_set.all %}
<p>Survey blocks below:</p>
{% for survexblockdown in survexblock.survexblock_set.all %}
- <p class="indent"><a href="{% url survexblock survexblockdown.survexpath %}">{{survexblockdown.survexpath}}</a></p>
+ <p class="indent"><a href="{% url "survexblock" survexblockdown.survexpath %}">{{survexblockdown.survexpath}}</a></p>
{% endfor %}
{% endif %}
diff --git a/templates/survexscansfolder.html b/templates/survexscansfolder.html
index fe21916..339f639 100644
--- a/templates/survexscansfolder.html
+++ b/templates/survexscansfolder.html
@@ -25,7 +25,7 @@
<table>
{% for survexblock in survexscansfolder.survexblock_set.all %}
<tr>
- <td><a href="{% url svx survexblock.survexfile.path %}">{{survexblock}}</a></td>
+ <td><a href="{% url "svx" survexblock.survexfile.path %}">{{survexblock}}</a></td>
</tr>
{% endfor %}
</table>
diff --git a/templates/survexscansfolders.html b/templates/survexscansfolders.html
index 597bacf..187f3f0 100644
--- a/templates/survexscansfolders.html
+++ b/templates/survexscansfolders.html
@@ -15,7 +15,7 @@
<td>{{survexscansfolder.survexscansingle_set.all|length}}</td>
<td>
{% for survexblock in survexscansfolder.survexblock_set.all %}
- <a href="{% url svx survexblock.survexfile.path %}">{{survexblock}}</a>
+ <a href="{% url "svx" survexblock.survexfile.path %}">{{survexblock}}</a>
{% endfor %}
</td>
</tr>
diff --git a/templates/survey.html b/templates/survey.html
index 9dca0df..13a8800 100644
--- a/templates/survey.html
+++ b/templates/survey.html
@@ -24,11 +24,11 @@
});
function redirectSurvey(){
- window.location = "{% url survey %}" + '/' + document.getElementById("expeditionChooser").value + "%23" + document.getElementById("surveyChooser").value;
+ window.location = "{% url "survey" %}" + '/' + document.getElementById("expeditionChooser").value + "%23" + document.getElementById("surveyChooser").value;
}
function redirectYear(){
- window.location = "{% url survey %}" + '/' + document.getElementById("expeditionChooser").value + "%23";
+ window.location = "{% url "survey" %}" + '/' + document.getElementById("expeditionChooser").value + "%23";
}
</script>
diff --git a/templates/svxcavesingle.html b/templates/svxcavesingle.html
index 1d24466..ad5540f 100644
--- a/templates/svxcavesingle.html
+++ b/templates/svxcavesingle.html
@@ -29,9 +29,9 @@
{% endif %}
{% ifequal survexfile survexdirectory.primarysurvexfile %}
- <a href="{% url svx survexfile.path %}"><b>{{survexfile.path}}</b></a>
+ <a href="{% url "svx" survexfile.path %}"><b>{{survexfile.path}}</b></a>
{% else %}
- <a href="{% url svx survexfile.path %}">{{survexfile.path}}</a>
+ <a href="{% url "svx" survexfile.path %}">{{survexfile.path}}</a>
{% endifequal %}
</td>
</tr>
diff --git a/templates/svxfile.html b/templates/svxfile.html
index fbaacdd..e1ed097 100644
--- a/templates/svxfile.html
+++ b/templates/svxfile.html
@@ -62,7 +62,7 @@ $(document).ready(function()
{% if logmessage %}
{% if has_3d %}
-<p><a href="{% url threed title %}">3d file</a></p>
+<p><a href="{% url "threed" title %}">3d file</a></p>
{% else %}
<p><b>No 3d file</b></p>
{% endif %}
diff --git a/templates/svxfilecavelist.html b/templates/svxfilecavelist.html
index 52c8e83..2f80d46 100644
--- a/templates/svxfilecavelist.html
+++ b/templates/svxfilecavelist.html
@@ -12,23 +12,23 @@
<h2 id="cdir">Caves with subdirectories</h2>
{% for subdircave, cavefiles, subsurvdirs in subdircaves %}
-<h3>{{cavefiles.0.1}} - <a href="{% url survexcavessingle cavefiles.0.1 %}">dates and explorers</a></h3>
+<h3>{{cavefiles.0.1}} - <a href="{% url "survexcavessingle" cavefiles.0.1 %}">dates and explorers</a></h3>
<table>
<tr>
- <td><b><a href="{% url svx cavefiles.0.0 %}">{{cavefiles.0.1}}</a></b></td>
+ <td><b><a href="{% url "svx" cavefiles.0.0 %}">{{cavefiles.0.1}}</a></b></td>
<td>
{% for cavepath, cavename in cavefiles.1 %}
- <a href="{% url svx cavepath %}">{{cavename}}</a>
+ <a href="{% url "svx" cavepath %}">{{cavename}}</a>
{% endfor %}
</td>
</tr>
{% for primarycavefile, subcavefiles in subsurvdirs %}
<tr>
- <td><a href="{% url svx primarycavefile.0 %}">{{primarycavefile.1}}</a></td>
+ <td><a href="{% url "svx" primarycavefile.0 %}">{{primarycavefile.1}}</a></td>
<td>
{% for cavepath, cavename in subcavefiles %}
- <a href="{% url svx cavepath %}">{{cavename}}</a>
+ <a href="{% url "svx" cavepath %}">{{cavename}}</a>
{% endfor %}
</td>
</tr>
@@ -44,12 +44,12 @@
{% for primarycavefile, subcavefiles in multifilecaves %}
<tr>
<td>
- <a href="{% url survexcavessingle primarycavefile.1 %}">{{primarycavefile.1}}</a>
+ <a href="{% url "survexcavessingle" primarycavefile.1 %}">{{primarycavefile.1}}</a>
</td>
<td>
- <a href="{% url svx primarycavefile.0 %}">{{primarycavefile.1}}</a> -
+ <a href="{% url "svx" primarycavefile.0 %}">{{primarycavefile.1}}</a> -
{% for cavepath, cavename in subcavefiles %}
- <a href="{% url svx cavepath %}">{{cavename}}</a>
+ <a href="{% url "svx" cavepath %}">{{cavename}}</a>
{% endfor %}
</td>
</tr>
@@ -59,7 +59,7 @@
<h2 id="csing">Caves of one file</h2>
<p>
{% for cavepath, cavename in onefilecaves %}
- <a href="{% url svx cavepath %}">{{cavename}}</a>
+ <a href="{% url "svx" cavepath %}">{{cavename}}</a>
{% endfor %}
</p>
diff --git a/templates/svxfiledifflistonly.html b/templates/svxfiledifflistonly.html
index 835125b..7b0367a 100644
--- a/templates/svxfiledifflistonly.html
+++ b/templates/svxfiledifflistonly.html
@@ -6,7 +6,7 @@
{% if logmessage %}
{% if has_3d %}
-<p><a href="{% url threed title %}">3d file</a></p>
+<p><a href="{% url "threed" title %}">3d file</a></p>
{% else %}
<p><b>No 3d file</b></p>
{% endif %}
diff --git a/templates/todo.html b/templates/todo.html
index a678f50..7482b72 100644
--- a/templates/todo.html
+++ b/templates/todo.html
@@ -8,14 +8,14 @@
<h2>The unfinished front page</h2>
<ul>
<li><b>About {{totallogbookentries}} logbook entries have been loaded</b></li>
- <li><b><a href="{% url personindex %}">List of People</a></b></li>
- <li><b><a href="{% url caveindex %}">List of Caves</a></b></li>
- <li><a href="{% url jgtfile aaaa %}">JGT list of files</a> (temporary simple file list and tunnel use)</li>
- <li><a href="{% url survey %}">Survey files</a></li>
- <li><a href="{% url survexindex all %}">Survex directory</a></li>
- <li><a href="{% url expedition 2008 %}">Expedition 2008</a></li>
- <li><a href="{% url expedition 2007 %}">Expedition 2007</a></li>
- <li><a href="{% url expedition 1993 %}">Expedition 1993</a> (earliest parsed)</li>
+ <li><b><a href="{% url "personindex" %}">List of People</a></b></li>
+ <li><b><a href="{% url "caveindex" %}">List of Caves</a></b></li>
+ <li><a href="{% url "jgtfile" aaaa %}">JGT list of files</a> (temporary simple file list and tunnel use)</li>
+ <li><a href="{% url "survey" %}">Survey files</a></li>
+ <li><a href="{% url "survexindex" all %}">Survex directory</a></li>
+ <li><a href="{% url "expedition" 2008 %}">Expedition 2008</a></li>
+ <li><a href="{% url "expedition" 2007 %}">Expedition 2007</a></li>
+ <li><a href="{% url "expedition" 1993 %}">Expedition 1993</a> (earliest parsed)</li>
</ul>
<h2>Further work</h2>
@@ -52,7 +52,7 @@
<ul id="expeditionlist">
{% for expedition in expeditions %}
<li>
- <a href="{% url expedition expedition.year %}">{{expedition.name}}</a>
+ <a href="{% url "expedition" expedition.year %}">{{expedition.name}}</a>
- <b>{{expedition.logbookentry_set.count}}</b> logbook entries
</li>
{% endfor %}
diff --git a/templates/tunnelfiles.html b/templates/tunnelfiles.html
index caa3895..fbc74ea 100644
--- a/templates/tunnelfiles.html
+++ b/templates/tunnelfiles.html
@@ -11,7 +11,7 @@
<tr><th>File</th><th>Font</th><th>SurvexBlocks</th><th>Size</th><th>Paths</th><th>Scans folder</th><th>Scan files</th><th>Frames</th></tr>
{% for tunnelfile in tunnelfiles %}
<tr>
- <td><a href="{% url tunnelfile tunnelfile.tunnelpath %}">{{tunnelfile.tunnelpath}}</a></td>
+ <td><a href="{% url "tunnelfile" tunnelfile.tunnelpath %}">{{tunnelfile.tunnelpath}}</a></td>
<td>{{tunnelfile.bfontcolours}}</td>
<td></td>
<td>{{tunnelfile.filesize}}</td>
@@ -31,7 +31,7 @@
<td>
{% for rtunnelfile in tunnelfile.tunnelcontains.all %}
- <a href="{% url tunnelfile rtunnelfile.tunnelpath %}">{{rtunnelfile.tunnelpath}}</a>
+ <a href="{% url "tunnelfile" rtunnelfile.tunnelpath %}">{{rtunnelfile.tunnelpath}}</a>
{% endfor %}
</td>
diff --git a/urls.py b/urls.py
index 48c9ea4..c26c4dd 100644
--- a/urls.py
+++ b/urls.py
@@ -6,9 +6,9 @@ from core.views_other import *
from core.views_caves import *
from core.views_survex import *
from core.models import *
-from django.views.generic.create_update import create_object
+from django.views.generic.edit import UpdateView
from django.contrib import admin
-from django.views.generic.list_detail import object_list
+from django.views.generic.list import ListView
from django.contrib import admin
admin.autodiscover()
@@ -30,7 +30,7 @@ actualurlpatterns = patterns('',
#url(r'^person/(\w+_\w+)$', views_logbooks.person, name="person"),
url(r'^expedition/(\d+)$', views_logbooks.expedition, name="expedition"),
- url(r'^expeditions/?$', object_list, {'queryset':Expedition.objects.all(),'template_name':'object_list.html'},name="expeditions"),
+ url(r'^expeditions/?$', ListView, {'queryset':Expedition.objects.all(),'template_name':'object_list.html'},name="expeditions"),
url(r'^personexpedition/(?P<first_name>[A-Z]*[a-z]*)[^a-zA-Z]*(?P<last_name>[A-Z]*[a-z]*)/(?P<year>\d+)/?$', views_logbooks.personexpedition, name="personexpedition"),
url(r'^logbookentry/(?P<date>.*)/(?P<slug>.*)/?$', views_logbooks.logbookentry,name="logbookentry"),
url(r'^newlogbookentry/(?P<expeditionyear>.*)$', views_logbooks.newLogbookEntry, name="newLogBookEntry"),