forked from expo/troggle
edit this page working
This commit is contained in:
@@ -89,10 +89,10 @@ def flatpage(request, path):
|
||||
menumatch = re.match(rb'(.*)<ul id="links">', 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'(.*)(<ul\s+id="links">.*)', 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:
|
||||
|
||||
Reference in New Issue
Block a user