summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Green <martin.speleo@gmail.com>2011-05-02 02:12:26 +0100
committerMartin Green <martin.speleo@gmail.com>2011-05-02 02:12:26 +0100
commit671e946c6d48f043c9a3949eee6cf7dd8826aa3e (patch)
treea4fe7a4407a98043c22eef928a40d6274efcc912
parent3928609c29e26f826302c733cfc4fcbf487bd7c5 (diff)
downloadtroggle-671e946c6d48f043c9a3949eee6cf7dd8826aa3e.tar.gz
troggle-671e946c6d48f043c9a3949eee6cf7dd8826aa3e.tar.bz2
troggle-671e946c6d48f043c9a3949eee6cf7dd8826aa3e.zip
settings.PUBLIC_SITE, login required if public for logbook entry, CRCF middleware
-rw-r--r--localsettingsserver.py2
-rw-r--r--localsettingsubuntu.py2
-rw-r--r--localsettingswindows.py1
-rw-r--r--settings.py1
-rw-r--r--templates/logbookentry.html7
-rw-r--r--templates/registration/login.html2
6 files changed, 12 insertions, 3 deletions
diff --git a/localsettingsserver.py b/localsettingsserver.py
index 208aed9..cd05178 100644
--- a/localsettingsserver.py
+++ b/localsettingsserver.py
@@ -16,6 +16,8 @@ SURVEY_SCANS = '/home/expo/expoimages/'
FILES = '/home/expo/expoimages'
EXPOWEB_URL = 'http://expo.survex.com/'
+PUBLIC_SITE = True
+
SURVEYS_URL = 'http://troggle.cavingexpedition.com/survey_scans/'
SVX_URL = 'http://framos.lawoftheland.co.uk/troggle/survex/'
diff --git a/localsettingsubuntu.py b/localsettingsubuntu.py
index c8800b9..991a77f 100644
--- a/localsettingsubuntu.py
+++ b/localsettingsubuntu.py
@@ -13,6 +13,8 @@ SURVEYS = '/home/goatchurch/tunnel/cucc/surveys'
EXPOWEB_URL = 'http://expo.survex.com/'
+PUBLIC_SITE = False
+
CAVERN = 'cavern'
EXPOWEB = '/home/goatchurch/expoweb/'
SURVEYS_URL = ''
diff --git a/localsettingswindows.py b/localsettingswindows.py
index 717167f..3b0447e 100644
--- a/localsettingswindows.py
+++ b/localsettingswindows.py
@@ -18,6 +18,7 @@ LOGFILE = EXPOWEB+'troggle\\parsing_log.txt'
PHOTOS = 'C:\\Expo\\expoweb\\photos'
URL_ROOT = 'http://127.0.0.1:8000'
+PUBLIC_SITE = False
TINY_MCE_MEDIA_ROOT = '/usr/share/tinymce/www/'
TINY_MCE_MEDIA_URL = URL_ROOT + 'tinymce_media/'
diff --git a/settings.py b/settings.py
index 9078f11..5a41239 100644
--- a/settings.py
+++ b/settings.py
@@ -63,6 +63,7 @@ MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
'troggle.middleware.SmartAppendSlashMiddleware'
)
diff --git a/templates/logbookentry.html b/templates/logbookentry.html
index 19b8a30..04229fb 100644
--- a/templates/logbookentry.html
+++ b/templates/logbookentry.html
@@ -5,7 +5,9 @@
{% block editLink %}<a href={{logbookentry.get_admin_url}}>Edit logbook entry {{logbookentry|wiki_to_html_short}}</a>{% endblock %}
{% block content %}
-<h2>{{logbookentry.title|safe}}</h2>
+{% block related %}{% endblock %}
+{% block nav %}{% endblock %}
+<h2>{{logbookentry.title}}</h2>
<div id="related">
<p><a href="{{ logbookentry.expedition.get_absolute_url }}">{{logbookentry.expedition.name}}</a></p>
@@ -69,6 +71,7 @@
</div>
</div>
-{% if logbookentry.filename %}<a href="{% url editlogbookentry year=logbookentry.year pdate=logbookentry.date pslug=logbookentry.slug %}">Edit</a> <a href="{% url deletelogbookentry year=logbookentry.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/registration/login.html b/templates/registration/login.html
index 04b5074..2d49395 100644
--- a/templates/registration/login.html
+++ b/templates/registration/login.html
@@ -6,7 +6,7 @@
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
-<form method="post" action=".">
+<form method="post" action=".">{% csrf_token %}
<table>
<tr><td>{{ form.username.label_tag }}</td><td>{{ form.username }}</td></tr>
<tr><td>{{ form.password.label_tag }}</td><td>{{ form.password }}</td></tr>