diff --git a/flatpages/views.py b/flatpages/views.py
index 8222421..43576b9 100644
--- a/flatpages/views.py
+++ b/flatpages/views.py
@@ -89,10 +89,10 @@ def flatpage(request, path):
menumatch = re.match(rb'(.*)
', body, re.DOTALL + re.IGNORECASE)
if menumatch:
has_menu = True
- #body, = menumatch.groups()
- if re.search(rb"iso-8859-1", html):
- body = str(body, "iso-8859-1")
- body.strip
+ body, = menumatch.groups()
+# if re.search(rb"iso-8859-1", html):
+# body = str(body, "iso-8859-1")
+# body.strip
return render(request, 'flatpage.html', {'editable': editable, 'path': path, 'title': title, 'body': body, 'homepage': (path == "index.htm"), 'has_menu': has_menu})
else:
return HttpResponse(o.read(), content_type=getmimetype(path))
@@ -137,8 +137,8 @@ def editflatpage(request, path):
linksmatch = re.match(r'(.*)(.*)', body, re.DOTALL + re.IGNORECASE)
if linksmatch:
body, links = linksmatch.groups()
- if re.search(r"iso-8859-1", html):
- body = str(body, "iso-8859-1")
+# if re.search(r"iso-8859-1", html):
+# body = str(body, "iso-8859-1")
else:
return HttpResponse("Page could not be split into header and body")
except IOError:
diff --git a/urls.py b/urls.py
index 3acb9d5..6492538 100644
--- a/urls.py
+++ b/urls.py
@@ -15,26 +15,24 @@ from flatpages import views as flatviews
admin.autodiscover()
-# type url probably means it's used.
-
# HOW DOES THIS WORK:
+# This is a "url dispatcher" - something needed by every web framework.
# url( ,
-# ,
-# )
+# , )
actualurlpatterns = [
-
url(r'^troggle$', views_other.frontpage, name="frontpage"),
url(r'^caves$', views_caves.caveindex, name="caveindex"),
- url(r'^indxal.htm$', views_caves.caveindex, name="caveindex"),
+ url(r'^indxal.htm$', views_caves.caveindex, name="caveindex"),
url(r'^people/?$', views_logbooks.personindex, name="personindex"),
url(r'^newqmnumber/?$', views_other.ajax_QM_number, ),
url(r'^lbo_suggestions/?$', logbook_entry_suggestions), #broken
- #(r'^person/(?P\d*)/?$', views_logbooks.person),
+# url(r'^person/(?P\d*)/?$', views_logbooks.person),
url(r'^person/(?P[A-Z]*[a-z\-\'&;]*)[^a-zA-Z]*(?P[a-z\-\']*[^a-zA-Z]*[A-Z]*[a-z\-&;]*)/?', views_logbooks.person, name="person"),
- #url(r'^person/(\w+_\w+)$', views_logbooks.person, name="person"),
-
+# url(r'^person/(\w+_\w+)$', views_logbooks.person, name="person"),
+# 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'^personexpedition/(?P[A-Z]*[a-z&;]*)[^a-zA-Z]*(?P[A-Z]*[a-zA-Z&;]*)/(?P\d+)/?$', views_logbooks.personexpedition, name="personexpedition"),
@@ -45,7 +43,7 @@ actualurlpatterns = [
url(r'^newfile', views_other.newFile, name="newFile"), # oddly broken, needs investigating more
url(r'^getEntrances/(?P.*)', views_caves.get_entrances, name = "get_entrances"), #works
- # e.g. /getEntrances/1623-161
+ # e.g. /getEntrances/1623-161
url(r'^getQMs/(?P.*)', views_caves.get_qms, name = "get_qms"), # no template "get_qms"?
url(r'^getPeople/(?P.*)', views_logbooks.get_people, name = "get_people"), # fails
url(r'^getLogBookEntries/(?P.*)', views_logbooks.get_logbook_entries, name = "get_logbook_entries"), #works
@@ -71,7 +69,6 @@ actualurlpatterns = [
#url(r'^cavesearch', caveSearch),
url(r'^prospecting_guide/$', views_caves.prospecting),
-
url(r'^logbooksearch/(.*)/?$', views_logbooks.logbookSearch),
url(r'^statistics/?$', views_statistics.stats, name="stats"),
@@ -88,9 +85,6 @@ actualurlpatterns = [
url(r'^accounts/', include('registration.backends.default.urls')),
url(r'^profiles/', include('profiles.urls')), # not used ? Delete this entire app then.
-# (r'^personform/(.*)$', personForm),
-
-
url(r'^survexblock/(.+)$', views_caves.survexblock, name="survexblock"),
url(r'^survexfile/(?P.*?)\.svx$', views_survex.svx, name="svx"),
url(r'^survexfile/(?P.*?)\.3d$', views_survex.threed, name="threed"),
@@ -111,11 +105,10 @@ actualurlpatterns = [
view_surveys.surveyscansingle, name="surveyscansingle"),
url(r'^tunneldata/$', view_surveys.tunneldata, name="tunneldata"),
+# url(r'^tunneldatainfo/(?P.+?\.xml)$', view_surveys.tunnelfileinfo, name="tunnelfileinfo"),
url(r'^tunneldataraw/(?P.+?\.xml)$', view_surveys.tunnelfile, name="tunnelfile"),
url(r'^tunneldataraw/(?P.+?\.xml)/upload$',view_surveys.tunnelfileupload, name="tunnelfileupload"),
-# url(r'^tunneldatainfo/(?P.+?\.xml)$', view_surveys.tunnelfileinfo, name="tunnelfileinfo"),
-
url(r'^prospecting/(?P[^.]+).png$', prospecting_image, name="prospecting_image"),
url(r'^expofiles/(?P.*)$', staticviews.serve,
@@ -124,19 +117,17 @@ actualurlpatterns = [
{'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
url(r'^site_media/(?P.*)$', staticviews.serve,
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
+# url(r'^troggle/media-admin/(?P.*)$', staticviews.serve,
+# {'document_root': settings.MEDIA_ADMIN_DIR, 'show_indexes':True}),
#url(r'^tinymce_media/(?P.*)$', staticviews.serve,
# {'document_root': settings.TINY_MCE_MEDIA_ROOT, 'show_indexes': True}),
#url(r'^photos/(?P.*)$', staticviews.serve,
# {'document_root': settings.PHOTOS_ROOT, 'show_indexes':True}),
-# url(r'^gallery/(?P.*)$', staticviews.serve,
+# url(r'^gallery/(?P.*)$', staticviews.serve,
# {'document_root': settings.PHOTOS_ROOT, 'show_indexes':True}),
-# don't know why this needs troggle/ in here. nice to get it out
- url(r'^troggle/media-admin/(?P.*)$', staticviews.serve,
- {'document_root': settings.MEDIA_ADMIN_DIR, 'show_indexes':True}),
url(r'^(.*)_edit$', flatviews.editflatpage, name="editflatpage"),
url(r'^(.*)$', flatviews.flatpage, name="flatpage"),
-
]
#Allow prefix to all urls