{% load i18n thumbnail staticfiles %}

{% if type == 'slim' %}
{% thumbnail volume.cover 80x110 crop as volume_thumb %}
{% else %}
{% thumbnail volume.cover 120x150 as volume_thumb %}
{% endif %}

<div>
    <div class="well text-center volume-item volume-{{ type }}" style="background: white url({{ volume_thumb.url }}) center left no-repeat;">
        {% if request.user.is_authenticated %}
        <div data-pjax-container="v{{ volume.pk }}">
            {% include "manga/series/includes/volume-badges.html" %}
        </div>
        {% endif %}
        <div class="text-center volume-content">
            {% if show_name %}
            <div><strong><a href="{{ volume.series.get_absolute_url }}">{{ volume.series.name }}</a></strong></div>
            {% endif %}
            {% if type == 'slim' %}
            <a href="{{ volume.series.get_absolute_url }}">
                <h4 class="media-heading">
                  {% if show_language and volume.language %}
                  <img src="{% static "images/flags/"|add:volume.language.code|add:'.gif' code %}" />
                  {% endif %}
                  {{ volume }}
                </h4>
            </a>
            {% else %}
            <div class="volume-number">
                {% if show_language and volume.language %}
                <img src="{% static "images/flags/"|add:volume.language.code|add:'.gif' code %}" />
                {% endif %}
                {% if volume.number %}#{{ volume.number }}{% endif %}
                {% if volume.name %}{{ volume.name }}{% endif %}
            </div>
            {% endif %}
            {% if volume.collection and not volume.collection.default %}
            <div><span class="label label-primary">{{ volume.collection.name }}</span></div>
            {% endif %}
            {% if show_publisher %}
            <div><a href="{{ volume.publisher.get_absolute_url }}">{{ volume.publisher }}</a></div>
            {% endif %}
            {% if volume.release_date %}
            <div>{{ volume.release_date|date:"F Y" }}</div>
            {% endif %}
            {% if show_details %}
                {% if volume.pages %}
                <div>{% blocktrans with pages=volume.pages %}{{ pages }} pages{% endblocktrans %}</div>
                {% endif %}
            {% endif %}
        </div>
        {% if USER_IS_STAFF and USER_CONFIG.show_admin_links %}
            <div class="admin">
                <a class="btn btn-info btn-xs"
                   href="{% url 'admin:manga_volume_change' volume.pk %}">
                   {% trans "Edit in admin" %}</a>
            </div>
        {% endif %}
    </div>
</div>
