Skip to content

Commit

Permalink
Use hero title include. Add conditionals to include where no image se…
Browse files Browse the repository at this point in the history
…t. Workson wagtail-nest#15
  • Loading branch information
hminnovation committed Feb 27, 2017
1 parent 600bfc4 commit 2dda668
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
6 changes: 3 additions & 3 deletions bakerydemo/templates/base/form_page.html
Original file line number Diff line number Diff line change
@@ -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" %}

<div class="container">
<div class="row">
<div class="col-md-8">
<h1>{{ page.title }}</h1>

{% if page.intro %}
<p class="intro">{{ page.intro|richtext }}</p>
{% endif %}
Expand Down
10 changes: 8 additions & 2 deletions bakerydemo/templates/base/form_page_landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
{% load wagtailcore_tags %}

{% block content %}
<h1>{{ page.title }}</h1>
{% include "base/include/header-hero.html" %}

{{ page.thank_you_text|richtext }}
<div class="container form-page-thanks">
<div class="row">
<div class="col-md-7">
{{ page.thank_you_text|richtext }}
</div>
</div>
</div>
{% endblock content %}
23 changes: 23 additions & 0 deletions bakerydemo/templates/base/include/header-hero.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% load wagtailcore_tags wagtailimages_tags %}

{% if page.image %}
{% image page.image fill-1920x600 as image %}
<div class="container-fluid hero" style="background-image:url('{{ image.url }}')">
<div class="hero-gradient-mask"></div>
<div class="container">
<div class="row">
<div class="col-md-7">
<h1>{{ page.title }}</h1>
</div>
</div>
</div>
</div>
{% else %}
<div class="container">
<div class="row">
<div class="col-md-7">
<h1>{{ page.title }}</h1>
</div>
</div>
</div>
{% endif %}

0 comments on commit 2dda668

Please sign in to comment.