From e85c386375898845a87885d1bad7e2c38c8f23b5 Mon Sep 17 00:00:00 2001 From: Martin Green Date: Mon, 8 Aug 2011 10:58:50 +0100 Subject: [PATCH] =Make a common base for expoweb pages. Ignore any header information in expoweb except titles. --- flatpages/views.py | 2 +- templates/dataformat/flatfile.html | 2 -- templates/editflatpage.html | 8 +++++--- templates/expobase.html | 13 +++++++++++++ templates/flatpage.html | 15 +++++---------- 5 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 templates/expobase.html diff --git a/flatpages/views.py b/flatpages/views.py index a080437..6279f4d 100644 --- a/flatpages/views.py +++ b/flatpages/views.py @@ -72,7 +72,7 @@ def flatpage(request, path): if re.search(r"iso-8859-1", html): body = unicode(body, "iso-8859-1") body.strip - return render_with_context(request, 'flatpage.html', {'editable': True, 'path': path, 'head': head, 'body': body, 'homepage': (path == "index.htm")}) + return render_with_context(request, 'flatpage.html', {'editable': True, 'path': path, 'title': title, 'body': body, 'homepage': (path == "index.htm")}) else: return HttpResponse(o.read(), mimetype=getmimetype(path)) diff --git a/templates/dataformat/flatfile.html b/templates/dataformat/flatfile.html index 048606e..07d03ca 100644 --- a/templates/dataformat/flatfile.html +++ b/templates/dataformat/flatfile.html @@ -1,9 +1,7 @@ {% autoescape off %} - {{ form.title }} - {{ form.html }} diff --git a/templates/editflatpage.html b/templates/editflatpage.html index 67290a7..547b94d 100644 --- a/templates/editflatpage.html +++ b/templates/editflatpage.html @@ -1,12 +1,14 @@ -{% extends "base.html" %} +{% extends "expobase.html" %} {% block title %}Edit {{ path }}{% endblock %} -{% block head %} +{% block extrahead %} {% load csrffaker %} {% endblock %} -{% block content %} +{% block body %} +

Edit {{ path }}

{% csrf_token %} {{form.as_p}}

+{% include "menu.html" %}
{% endblock %} diff --git a/templates/expobase.html b/templates/expobase.html new file mode 100644 index 0000000..0ef74c1 --- /dev/null +++ b/templates/expobase.html @@ -0,0 +1,13 @@ +{% autoescape off %} + + + +{% block title %}{% endblock %} + +{% block extrahead %}{% endblock %} + + +{% block body %}{% endblock %} + + +{% endautoescape %} diff --git a/templates/flatpage.html b/templates/flatpage.html index fddc69a..47863e3 100644 --- a/templates/flatpage.html +++ b/templates/flatpage.html @@ -1,12 +1,7 @@ - - -{{ head|safe }} - - +{% extends "expobase.html" %} +{% block title %}{{ title }}{% endblock %} +{% block bodyattrs %}{% if homepage %} id="homepage"{% endif %}{% endblock %} +{% block body %} {{ body|safe }} - {% if homepage %}{% if editable %}Edit{% endif %}{%else %}{% include "menu.html" %}{% endif %} - - - - +{% endblock %}