forked from expo/troggle
=Make a common base for expoweb pages. Ignore any header information in expoweb except titles.
This commit is contained in:
parent
c66ecc4d7f
commit
e85c386375
@ -72,7 +72,7 @@ def flatpage(request, path):
|
|||||||
if re.search(r"iso-8859-1", html):
|
if re.search(r"iso-8859-1", html):
|
||||||
body = unicode(body, "iso-8859-1")
|
body = unicode(body, "iso-8859-1")
|
||||||
body.strip
|
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:
|
else:
|
||||||
return HttpResponse(o.read(), mimetype=getmimetype(path))
|
return HttpResponse(o.read(), mimetype=getmimetype(path))
|
||||||
|
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
{% autoescape off %}
|
{% autoescape off %}
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
||||||
<title>{{ form.title }}</title>
|
<title>{{ form.title }}</title>
|
||||||
<link rel="stylesheet" type="text/css" href="css/main2.css" />
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{{ form.html }}
|
{{ form.html }}
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "expobase.html" %}
|
||||||
{% block title %}Edit {{ path }}{% endblock %}
|
{% block title %}Edit {{ path }}{% endblock %}
|
||||||
{% block head %}
|
{% block extrahead %}
|
||||||
{% load csrffaker %}
|
{% load csrffaker %}
|
||||||
<script src="{{ settings.TINY_MCE_MEDIA_URL }}tiny_mce.js" type="text/javascript"></script>
|
<script src="{{ settings.TINY_MCE_MEDIA_URL }}tiny_mce.js" type="text/javascript"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block body %}
|
||||||
|
<h1>Edit {{ path }}</h1>
|
||||||
<form action="" method="post">{% csrf_token %}
|
<form action="" method="post">{% csrf_token %}
|
||||||
{{form.as_p}}
|
{{form.as_p}}
|
||||||
<p><input type="submit" value="Submit" /></p>
|
<p><input type="submit" value="Submit" /></p>
|
||||||
|
{% include "menu.html" %}
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
13
templates/expobase.html
Normal file
13
templates/expobase.html
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{% autoescape off %}
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<title>{% block title %}{% endblock %}</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/main2.css" />
|
||||||
|
{% block extrahead %}{% endblock %}
|
||||||
|
</head>
|
||||||
|
<body {% block bodyattrs %}{% endblock %}>
|
||||||
|
{% block body %}{% endblock %}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
{% endautoescape %}
|
@ -1,12 +1,7 @@
|
|||||||
<html>
|
{% extends "expobase.html" %}
|
||||||
<head>
|
{% block title %}{{ title }}{% endblock %}
|
||||||
{{ head|safe }}
|
{% block bodyattrs %}{% if homepage %} id="homepage"{% endif %}{% endblock %}
|
||||||
</head>
|
{% block body %}
|
||||||
<body{% if homepage %} id="homepage"{% endif %}>
|
|
||||||
{{ body|safe }}
|
{{ body|safe }}
|
||||||
|
|
||||||
{% if homepage %}{% if editable %}<a href="{% url editflatpage path %}">Edit</a>{% endif %}{%else %}{% include "menu.html" %}{% endif %}
|
{% if homepage %}{% if editable %}<a href="{% url editflatpage path %}">Edit</a>{% endif %}{%else %}{% include "menu.html" %}{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
Loading…
Reference in New Issue
Block a user