{% extends 'layout.html' %}
{% load static %}

{% block content %}

<div class="grid-container">
    <div class="grid-x padding-top-1">
        {% if request.user.is_authenticated %}
            <div class="cell large-3 medium-4 small-12">
                <a class="button" href="{% url 'admin:gallery_album_add' %}">neues Album hinzufügen</a>
            </div>
        {% endif %}
    </div>

    <div class="grid-x">
        {% for album in albums %}
        <div class="cell large-2 medium-3 small-12" {% if album.status == album.DRAFT %}style="background-color:red;"{% endif %}>

            {% if album.status == "10" %}
                <a href="{% url 'draft-album' album.slug %}">               
            {% else %}
                <a href="{% url 'album' album.slug %}">
            {% endif %}
                    <img src="{{ album.thumbnail }}">
                    {{ album.title }}
                </a>

        </div>
        {% endfor %}
    </div>
</div>

{% endblock %}
