{% extends "events/event_detail.html" %}
{% load i18n thumbnail %}

{% block title %}{% trans "Photos" %}: {{ event.name }}{% endblock %}

{% block opengraph %}
    <meta property="og:type" content="album" />
    <meta property="og:title" content="{{event.name}}" />
    <meta property="og:url" content="http://www.kasu.at{% url 'event-photo-list' event.pk %}" />
    <meta property="og:image" content="http://www.kasu.at{{ event.get_thumbnail.url }}" />
{% if event.description %}<meta property="og:description" content="{{event.description}}" />{% endif %}
{% endblock %}

{% block maincontent %}

{% for photo in photo_list %}
<div class="thumbnail">
    <a href="{% url 'event-photo' event.id photo.id %}"><img src="{{photo.image|thumbnail_url:'thumbnail'}}" alt=""/></a>
    {% if perms.events.delete_photo %}
    <a href="{% url 'delete-event-photo' photo.pk %}" class="button delete_image">
        <span class="fa fa-trash" aria-label="{% trans 'Delete' %}" title="{% trans 'Delete' %}"></span>
    </a>
    {% endif %}
</div>
{% endfor %}


{% if perms.events.add_photo %}
<form action="{% url 'event-photo-upload' event.id %}" method="post" enctype="multipart/form-data" class="grid_12">
 {% csrf_token %}
  <fieldset>
  <legend>Photos hochladen</legend>
  {% include "form.html"%}
  <p class="buttonbar">
    <button type="reset"><span class="fa fa-undo"></span> {% trans 'reset' %}</button>
    <button type="submit"><span class="fa fa-cloud-upload"></span> {% trans 'Upload' %}</button>
  </p>
 </fieldset>
 </form>
{% endif %}
{% endblock %}

{% block buttonbar %}{% endblock %}


