Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Primary heroguts template divided, heroguts homepage created #12827

Merged
merged 5 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% load wagtailcore_tags wagtailimages_tags static %}

<div id="hero">
<div class="banner tw-bg-black">
{% with banner=page.specific.get_banner %}
{% if banner %}
<picture>
<source media="(min-width: 1200px)" srcset="{% image_url banner "fill-4032x480" %}">
<source media="(min-width: 992px)" srcset="{% image_url banner "fill-2400x480" %}">
<source media="(min-width: 768px)" srcset="{% image_url banner "fill-1984x480" %}">
<source media="(min-width: 576px)" srcset="{% image_url banner "fill-1536x390" %}">
{# Fallback Image #}
<img src="{% image_url banner "fill-1536x390" %}" alt="" width="1536" height="390">
</picture>
{% else %}
<img src="{% static "_images/banner-black-white-marble.jpg" %}" alt="" width="" height="">
{% endif %}
{% endwith %}

<div class="container tw-dark banner-content">
<div class="row">
<div class="col-12 col-md-9 col-xl-8 mt-3 d-flex flex-column justify-content-end">
<h1 class="tw-h1-heading">{{ page.hero_headline }}</h1>
{% if page.show_hero_button and page.hero_button_text and page.hero_button_url %}
<div>
<a href="{{ page.hero_button_url }}" class="tw-btn-secondary text-wrap mt-3" id="homepage-hero-cta">{{ page.hero_button_text }}</a>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% if singleton_page == True %}
{% include "partials/intro_and_content_divider.html" with wrapper_class="d-md-none" %}
{% endif %}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,30 @@
<div class="banner tw-bg-black">
{% with banner=page.specific.get_banner %}
{% if banner %}
{% if homepage %}
<picture>
<source media="(min-width: 1200px)" srcset="{% image_url banner "fill-4032x480" %}">
<source media="(min-width: 992px)" srcset="{% image_url banner "fill-2400x480" %}">
<source media="(min-width: 768px)" srcset="{% image_url banner "fill-1984x480" %}">
<source media="(min-width: 576px)" srcset="{% image_url banner "fill-1536x390" %}">
{# Fallback Image #}
<img src="{% image_url banner "fill-1536x390" %}" alt="">
</picture>
{% else %}
<picture>
<source media="(min-width: 1200px)" srcset="{% image_url banner "fill-4032x1152" %}">
<source media="(min-width: 992px)" srcset="{% image_url banner "fill-2400x686" %}">
<source media="(min-width: 768px)" srcset="{% image_url banner "fill-1984x567" %}">
<source media="(min-width: 576px)" srcset="{% image_url banner "fill-1536x439" %}">
{# Fallback Image #}
<img src="{% image_url banner "fill-1536x439" %}" alt="">
</picture>
{% endif %}
<picture>
<source media="(min-width: 1200px)" srcset="{% image_url banner "fill-4032x1152" %}">
<source media="(min-width: 992px)" srcset="{% image_url banner "fill-2400x686" %}">
<source media="(min-width: 768px)" srcset="{% image_url banner "fill-1984x567" %}">
<source media="(min-width: 576px)" srcset="{% image_url banner "fill-1536x439" %}">
{# Fallback Image #}
<img src="{% image_url banner "fill-1536x439" %}" alt="">
</picture>
{% else %}
<img src="{% static "_images/banner-black-white-marble.jpg" %}" alt="">
{% endif %}
{% endwith %}

{% if homepage %}
<div class="container tw-dark banner-content">
<div class="row">
<div class="col-12 col-md-9 col-xl-8 mt-3 d-flex flex-column justify-content-end">
<h1 class="tw-h1-heading">{{ page.hero_headline }}</h1>
{% if page.show_hero_button and page.hero_button_text and page.hero_button_url %}
<div>
<a href="{{ page.hero_button_url }}" class="tw-btn-secondary text-wrap mt-3" id="homepage-hero-cta">{{ page.hero_button_text }}</a>
</div>
{% endif %}
</div>
</div>
</div>
{% endif %}
</div>

{% if not homepage %}
<div class="container">
<div class="row cutout-wrapper-row">
<div class="cutout col-12 col-lg-8 pt-4">
<h1 class="tw-h1-heading mb-0">{% if root.title %}{{ root.title }}{% elif page.header %}{{ page.header }}{% else %}{{ page.title }}{% endif %}</h1>
{% if page.intro %}
<p class="tw-body-large mt-3 mb-0">{{ page.intro }}</p>
{% endif %}
</div>
<div class="container">
<div class="row cutout-wrapper-row">
<div class="cutout col-12 col-lg-8 pt-4">
<h1 class="tw-h1-heading mb-0">{% if root.title %}{{ root.title }}{% elif page.header %}{{ page.header }}{% else %}{{ page.title }}{% endif %}</h1>
{% if page.intro %}
<p class="tw-body-large mt-3 mb-0">{{ page.intro }}</p>
{% endif %}
</div>
</div>
{% endif %}
</div>

{% if singleton_page == True %}
{% include "partials/intro_and_content_divider.html" with wrapper_class="d-md-none" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


{% block hero_guts %}
{% include "./fragments/primary_heroguts.html" with root=root page=page homepage=True %}
{% include "./fragments/homepage_heroguts.html" with root=root page=page homepage=True %}
{% endblock %}


Expand Down
Loading