{% extends "porticus/base.html" %}
{% load i18n thumbnail tagging_tags %}

{% block head_title %}{{ gallery_object.name }} - {{ block.super }}{% endblock %}

{% block porticus_content %}
<div class="row">
    <div class="gallery-detail-{{ gallery_object.id }}">
        <h3>{{ gallery_object.name }}</h3>
        {% if gallery_object.description %}
            <p>{{ gallery_object.description }}</p>
        {% endif %}

        <div class="album-grid-aside equal-heights">{% for album in album_list %}
        {% spaceless %}
            <div class="small-6 large-3 columns item equalized-item{% if forloop.last %} end{% endif %}">
            <a href="{% url 'porticus-album-detail' gallery_slug=gallery_object.slug album_slug=album.slug %}">
                <div class="large-6 columns thumb">
                    {% if album.image  %}
                        <img src="{% thumbnail album.image 105x80 crop %}" alt="">
                    {% endif %}
                </div>
                <div class="large-6 columns content">
                    <p>{{ album.name }}</p>
                </div>
            </a>
            </div>
        {% endspaceless %}
        {% endfor %}</div>
    </div>
        
    {% if is_paginated %}<ul class="pagination right">
        {% if page_obj.has_previous %}<li class="arrow"><a href="?page={{ page_obj.previous_page_number }}">&laquo;</a></li>{% endif %}
        {% for item in paginator.page_range %}
        <li{% if item == page_obj.number %} class="current"{% endif %}><a href="?page={{ item }}">{{ item }}</a></li>
        {% endfor %}
        {% if page_obj.has_next %}<li class="arrow"><a href="?page={{ page_obj.next_page_number }}">&raquo;</a></li>{% endif %}
    </ul>{% endif %}
</div>
{% endblock%}