{% extends "events/event_detail.html" %}

{% load i18n %}

{% block title %}{{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 %}
 {% if perms.events.delete_photo %}
  {% for photo in photo_list %}
  <div class="thumbnail">
   <a href="{{photo.get_absolute_url}}"><img src="{{photo.thumbnail.url}}" alt=""/></a>
   <a href="{% url 'delete-event-photo' photo.pk %}" class="delete_image"><img src="{{STATIC_URL}}icons/delete.png" title="{% trans 'delete' %}"/></a>
  </div>
  {% endfor %}
 {% else %}
  {% for photo in photo_list %}
    <a href="{{photo.get_absolute_url}}" class="thumbnail"><img src="{{photo.thumbnail.url}}" alt=""/></a>
  {% endfor %}
 {% endif %}

{% if perms.events.add_photo %}
<br class="clear" />
<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"><img src="{{STATIC_URL}}icons/arrow_undo.png" alt="{% trans 'reset' %}" /> {% trans 'reset' %}</button>
  <button type="submit"><img src="{{STATIC_URL}}icons/image_add.png" alt="{% trans 'upload' %}" /> {% trans 'upload' %}</button>
  </p>
 </fieldset>
 </form>
{% endif %}
{% endblock %}

{% block buttonbar %}{% endblock %}


