{% extends "base.html" %}
{% load wagtailcore_tags wagtailimages_tags %}

{% block body_class %}template-{{ self.get_verbose_name|slugify }}{% endblock %}

{% block content %}

{% if articles|length is 1 %}

  <section id="news-details" class="article-index-page">
    <div class="container">
    {% for page in articles %}
      {% include 'home/page_content.html' %}
    {% endfor %}
    </div>
  </section>

{% else %}

  <section id="article-index" class="article-index-page">
    <div class="container">
    	<h2>{{ page.trans_title }}</h2>
    	<p class="lead">{{ page.trans_intro|richtext }}</p>
      <div class="article-body" role="main">
      {% for entry in articles %}
        <div class="item">
          <div class="article-caption">
            <h3><a href="{% pageurl entry %}">{{ entry.trans_title }}</a></h3>
            {{ entry.trans_intro|richtext }}
          </div>
        </div>
      {% endfor %}
      </div>
    </div><!-- /container -->
  </section>

{% endif %}

{% if subcategories %}
<section id="three" class="article-subcategories" class="wrapper align-center">
  <div class="container">
    <div class="row">
      {% for block in subcategories %}
      <article class="col-md-4">
				<a href="{% pageurl block %}">
          <header>
            <h4>{{ block.trans_title }}</h4>
          </header>
          <div class="image">
  					{% image block.feed_image fill-300x300 %}
  				</div>
        </a>
      </article>
      {% endfor %}
    </div>
  </div><!-- /container -->
</section>
{% endif %}
{% endblock %}
