Pull out base template
authorDavid Kerkeslager <kerkeslager@gmail.com>
Wed, 1 Jul 2020 03:30:41 +0000 (23:30 -0400)
committerDavid Kerkeslager <kerkeslager@gmail.com>
Wed, 1 Jul 2020 03:30:41 +0000 (23:30 -0400)
txt_house/templates/base.html [new file with mode: 0644]
txt_house/templates/index.html

diff --git a/txt_house/templates/base.html b/txt_house/templates/base.html
new file mode 100644 (file)
index 0000000..1856c0d
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1"/>
+    <title>txt.house</title>
+  </head>
+
+  <body>
+    {% block body %}{% endblock %}
+  </body>
+</html>
index 8523976..fcd6fe9 100644 (file)
@@ -1,16 +1,9 @@
-<!DOCTYPE html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8"/>
-    <meta name="viewport" content="width=device-width, initial-scale=1"/>
-    <title>txt.house</title>
-  </head>
+{% extends 'base.html' %}
 
-  <body>
-    <form action='create' method='post'>
-      {% csrf_token %}
-      <textarea name='text'></textarea>
-      <input type='submit'></input>
-    </form>
-  </body>
-</html>
+{% block body %}
+<form action='create' method='post'>
+  {% csrf_token %}
+  <textarea name='text'></textarea>
+  <input type='submit'></input>
+</form>
+{% endblock %}