From a5abb515384c71b64d06505630aab50b4d388453 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 17 Jun 2022 15:58:23 +0100 Subject: [PATCH] Separate hero into its own file --- website/common/models.py | 2 + .../common/templates/common/content_page.html | 40 +------------------ website/common/templates/common/hero.html | 38 ++++++++++++++++++ 3 files changed, 42 insertions(+), 38 deletions(-) create mode 100644 website/common/templates/common/hero.html diff --git a/website/common/models.py b/website/common/models.py index fbcef34..88231de 100644 --- a/website/common/models.py +++ b/website/common/models.py @@ -8,6 +8,8 @@ from wagtail.models import Page class BasePage(Page): show_in_menus_default = True + HERO_IMAGE_SIZE = "width-1200" + class Meta: abstract = True diff --git a/website/common/templates/common/content_page.html b/website/common/templates/common/content_page.html index 1756e39..3f5fe6c 100644 --- a/website/common/templates/common/content_page.html +++ b/website/common/templates/common/content_page.html @@ -1,47 +1,11 @@ {% extends "wagtail_base.html" %} -{% load wagtailimages_tags %} - {% block content %} -{% if page.hero_image %} - -{% endif %} -
-
-
-
-

{{ page.title }}

- {% if page.subtitle %} -

{{ page.subtitle }}

- {% endif %} -
- -
- -
-
+{% include "common/hero.html" %}
{% lorem 10 p %}
+ {% endblock content %} diff --git a/website/common/templates/common/hero.html b/website/common/templates/common/hero.html new file mode 100644 index 0000000..a4c72b6 --- /dev/null +++ b/website/common/templates/common/hero.html @@ -0,0 +1,38 @@ +{% load wagtailimages_tags %} + +{% if page.hero_image %} + +{% endif %} + +
+
+
+
+

{{ page.title }}

+ {% if page.subtitle %} +

{{ page.subtitle }}

+ {% endif %} +
+ +
+
+