{% load wagtailcore_tags wagtailimages_tags %}

{% if page.feed_image %}
<div class="image">
  {% image page.feed_image fill-940x400 class="img-responsive" %}
</div>
{% endif %}

<h1 class="title">{{ page.trans_title }}</h1>

<div class="lead">{{ page.trans_intro|richtext }}</div>

{% if page.date %}
<p class="date">{{ page.date }}</p>
{% endif %}

<!-- Main content -->
<div class="article-body" role="main">
{% for block in page.trans_body %}
  {% if block.block_type == 'heading' %}
    <h3>{{ block.value }}</h3>
  {% elif block.block_type == 'media' %}
    {% if block.value == 'gallery' %}
      {% include 'home/photo_gallery.html' %}
    {% endif %}
  {% elif block.block_type != 'info' %}
  <p class="block-{{ block.block_type }}">
    {% include_block block %}
  </p>
  {% endif %}
{% endfor %}
</div>

<!-- Infoblocks -->
<div class="row infoblocks">
  {% for block in page.trans_body %}
  {% if block.block_type == 'info' %}
  <article class="col-md-4">
    <div class="image">
      {% image block.value.photo fill-300x300 %}
    </div>
    <header>
      <h3>{{ block.value.title }}</h3>
    </header>
    {{ block.value.summary|richtext }}
    {% if block.value.action %}
    <footer>
      <a href="{{ block.value.url }}" class="btn btn-default">{{ block.value.action }}</a>
    </footer>
    {% endif %}
  </article>
  {% endif %}
  {% endfor %}
</div>
