{% extends 'djiffy/base.html' %}

{% block page-subtitle %}{{ manifest.label }} | {% endblock %}

{% block content %}
<div class="container djifbook">
    <h1>{{ manifest.label }}</h1>

    <article class="djifbook">
        <div class="media">
            {% if manifest.thumbnail %}
                <div class="pull-left">
                    <a href="{{ manifest.canvases.first.get_absolute_url }}">
                    <img class="thumbnail media-object"
                        src="{{ manifest.thumbnail.image.thumbnail }}"/>
                    </a>
                </div>
            {% endif %}

            <div class="media-body">
                {#  metadata #}
                {% for field, value in manifest.metadata.items %}
                <p><strong>{{ field }}:</strong> {{ value|join:'; ' }}</p>
                {% endfor %}
                {% if manifest.canvases.exists %}  {# only relevant if a book ? #}
                 <meta property="schema:numberOfPages" content="{{ manifest.canvases.all.count }}"/>
                {% endif %}
            </div>
        </div>

    <div class="pages">
    {% for canvas in manifest.canvases.all %}
        {% include "djiffy/snippets/canvas_card.html" %}
    {% endfor %}
    </div>

</div>
{% endblock %}
