Ver código fonte

Extending form templates from base.html

David Ray 8 anos atrás
pai
commit
a5a4aac429

+ 10 - 14
bakerydemo/templates/base/form_page.html

@@ -1,15 +1,11 @@
+{% extends "base.html" %}
 {% load wagtailcore_tags %}
-<html>
-    <head>
-        <title>{{ page.title }}</title>
-    </head>
-    <body>
-        <h1>{{ page.title }}</h1>
-        {{ page.intro|richtext }}
-        <form action="{% pageurl page %}" method="POST">
-            {% csrf_token %}
-            {{ form.as_p }}
-            <input type="submit">
-        </form>
-    </body>
-</html>
+{% block content %}
+    {{ page.intro|richtext }}
+
+    <form action="{% pageurl page %}" method="POST">
+        {% csrf_token %}
+        {{ form.as_p }}
+        <input type="submit">
+    </form>
+{% endblock content %}

+ 6 - 9
bakerydemo/templates/base/form_page_landing.html

@@ -1,9 +1,6 @@
-<html>
-    <head>
-        <title>{{ page.title }}</title>
-    </head>
-    <body>
-        <h1>{{ page.title }}</h1>
-        <h2>Thanks for your submission!</h2>
-    </body>
-</html>
+{% extends "base.html" %}
+{% load wagtailcore_tags %}
+{% block content %}
+    <h1>{{ page.title }}</h1>
+    {{ page.thank_you_text|richtext }}
+{% endblock content %}