From 2dda668db2fcfec8a0c9c4ecc6c9d3db3931e592 Mon Sep 17 00:00:00 2001 From: Edd Baldry Date: Mon, 27 Feb 2017 22:20:52 +0000 Subject: [PATCH] Use hero title include. Add conditionals to include where no image set. Workson #15 --- bakerydemo/templates/base/form_page.html | 6 ++--- .../templates/base/form_page_landing.html | 10 ++++++-- .../templates/base/include/header-hero.html | 23 +++++++++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 bakerydemo/templates/base/include/header-hero.html diff --git a/bakerydemo/templates/base/form_page.html b/bakerydemo/templates/base/form_page.html index 940c0b4..9cccf4f 100644 --- a/bakerydemo/templates/base/form_page.html +++ b/bakerydemo/templates/base/form_page.html @@ -1,12 +1,12 @@ {% extends "base.html" %} -{% load wagtailcore_tags %} +{% load wagtailcore_tags navigation_tags wagtailimages_tags %} {% block content %} +{% include "base/include/header-hero.html" %} +
-

{{ page.title }}

- {% if page.intro %}

{{ page.intro|richtext }}

{% endif %} diff --git a/bakerydemo/templates/base/form_page_landing.html b/bakerydemo/templates/base/form_page_landing.html index 7bc5c6b..5e1c9b2 100644 --- a/bakerydemo/templates/base/form_page_landing.html +++ b/bakerydemo/templates/base/form_page_landing.html @@ -2,7 +2,13 @@ {% load wagtailcore_tags %} {% block content %} -

{{ page.title }}

+{% include "base/include/header-hero.html" %} - {{ page.thank_you_text|richtext }} +
+
+
+ {{ page.thank_you_text|richtext }} +
+
+
{% endblock content %} \ No newline at end of file diff --git a/bakerydemo/templates/base/include/header-hero.html b/bakerydemo/templates/base/include/header-hero.html new file mode 100644 index 0000000..6693be1 --- /dev/null +++ b/bakerydemo/templates/base/include/header-hero.html @@ -0,0 +1,23 @@ +{% load wagtailcore_tags wagtailimages_tags %} + +{% if page.image %} + {% image page.image fill-1920x600 as image %} +
+
+
+
+
+

{{ page.title }}

+
+
+
+
+{% else %} +
+
+
+

{{ page.title }}

+
+
+
+{% endif %}