From 4d07292252e0800c2ba80cf18f5cf05230924188 Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Wed, 6 Jul 2022 22:07:04 +0100 Subject: [PATCH] Create a template hierarchy Fix #12 --- flangr/templates/base.html | 6 ++++++ flangr/templates/posts/post_detail.html | 5 +++-- flangr/templates/registration/login.html | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 flangr/templates/base.html diff --git a/flangr/templates/base.html b/flangr/templates/base.html new file mode 100644 index 0000000..0f1d64b --- /dev/null +++ b/flangr/templates/base.html @@ -0,0 +1,6 @@ + + + Flangr + + {% block content %}{% endblock content %} + diff --git a/flangr/templates/posts/post_detail.html b/flangr/templates/posts/post_detail.html index 7e93e44..57d573c 100644 --- a/flangr/templates/posts/post_detail.html +++ b/flangr/templates/posts/post_detail.html @@ -1,4 +1,5 @@ - +{% extends "base.html" %} +{% block content %} {% if object.title %}

{{ object.title }}

{% else %} @@ -16,4 +17,4 @@ {{ form }} - +{% endblock content %} diff --git a/flangr/templates/registration/login.html b/flangr/templates/registration/login.html index e69de29..09e9ce3 100644 --- a/flangr/templates/registration/login.html +++ b/flangr/templates/registration/login.html @@ -0,0 +1,4 @@ +{% extends "base.html" %} + +{% block content %} +{% endblock content %}