{% extends "base.html" %}
{% load wagtailcore_tags core_tags %}
{% wagtail_site as current_site %}
{% block content %}
{% get_translation tag as translated_tag %}
<div class="tags-page">
  <div class="banner">
    <div class="heading heading--hero">
      <h1 class="heading__title">{{translated_tag.title}}</h1>
    </div>
  </div>
  <div class="tags-page__wrapper">
    {% if object_list %}
      <ul class="teaser-stacklist">
        {% for article in object_list %}
          {% include "core/section_page-partials/section_article-teaser.html" with teaser_type="stacklist" %}
        {% endfor %}
      </ul>
    {% endif %}

    {% get_next_tag tag as next_tag %}
    {% get_articles_for_tag next_tag as articles %}
    {% if articles %}
      <div class="heading">
        <h1 class="heading__component">{{next_tag.title}}</h1>
      </div>
      <ul class="teaser-grid">
        {% for article in articles %}
            {% include "core/section_page-partials/section_article-teaser.html" with teaser_type="grid" %}
        {% endfor %}
      </ul>
      <a href="{% url 'tags_list' next_tag.slug %}" class="call-to-action_item call-to-action__item--paginate">
        {% trans "View all" %} {{next_tag}}
      </a>
    {% endif %}
    <a href="{{current_site.root_page.specific.url}}" class="call-to-action__item call-to-action__item--nav-back">
      {% trans "Back home" %}
    </a>
  </div>
</div>
{% endblock %}
