forked from expo/troggle
Allow pages to be rendered when the body tag has attributes. Put an edit link on the homepage.
This commit is contained in:
parent
d75bad22de
commit
4c4b6ef11f
@ -56,7 +56,7 @@ def flatpage(request, path):
|
||||
if path.endswith(".htm") or path.endswith(".html"):
|
||||
html = o.read()
|
||||
|
||||
m = re.search(r"<head>(.*)</head>.*<body>(.*)</body>", html, re.DOTALL)
|
||||
m = re.search(r"<head>(.*)</head>.*<body[^>]*>(.*)</body>", html, re.DOTALL)
|
||||
if m:
|
||||
head, body = m.groups()
|
||||
else:
|
||||
|
@ -5,6 +5,8 @@
|
||||
<body{% if homepage %} id="homepage"{% endif %}>
|
||||
{{ body|safe }}
|
||||
|
||||
{% include "menu.html" %}
|
||||
{% if homepage %}{% if editable %}<a href="{% url editflatpage path %}">Edit</a>{% endif %}{%else %}{% include "menu.html" %}{% endif %}
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user