{% extends "main::container.html" %}

{% macro header_passage() %}
<header>
    <h1 class="entry-title">{{collections.current.title}}</h1>
    <h2 class="author vcard"><span class="fn">{{collections.current.author}}</span></h2>
    <p class="entry-summary"><small>{{collections.current.label}}, <i>{{collections.current.description}}</i></small></p>
    <span class='Z3988' title='{{collections.current.coins}}'></span>
</header>
{% endmacro %}

{% macro nav() %}
    {% if prev %}
    <a class="btn btn-xs btn-primary" href="{{url_for('.r_passage', objectId=objectId, subreference=prev) }}">
        <span class="glyphicon glyphicon-chevron-left"></span>
    </a>
    {% endif %}
    {% if next %}
    <a class="btn btn-xs btn-primary" href="{{url_for('.r_passage', objectId=objectId, subreference=next) }}">
        <span class="glyphicon glyphicon-chevron-right"></span>
    </a>
    {% endif %}
{% endmacro %}

{% macro default_footer() %}
    {% include "main::passage_footer.html" %}
{% endmacro %}

{% macro show_passage(text, header, navigation, footer) %}
<article class="hentry entry white">
        {{ header }}
    <nav>
        {{ navigation }}
    </nav>
    <section class="entry-content">
        {% if cache_active %}
            {% cache cache_time, cache_key %}{{ text_passage }} {% endcache %}
        {% else %}
            {{ text_passage }}
        {% endif %}
    </section>
    <footer>
      {{ footer }}
    </footer>
</article>
{% endmacro %}

{% block article %}
    {{ show_passage(text_passage, navigation=nav(), header=header_passage(), footer=default_footer()) }}
{% endblock %}

{% block metadata %}
{% endblock %}