{% extends "base.html" %}
{% load i18n comments %}

{% block maincontent %}
  {% for event in event_list %}
 {% get_comment_count for event as comment_count %}
 {% ifchanged %}<h3 class="grid_12">{{ event.start|date:'F Y' }}</h3>{% endifchanged %}
 <div style="float:left">
<a href="{% url 'event-photo-list' event.pk %}"><img src="{{ event.get_thumbnail.url }}" alt="" class="thumbnail"/></a>
<div class="grid_4" />
<h4><a href="{% url 'event-photo-list' event.pk %}">{{ event.name }}</a></h4>
<div class="info">
<img src="{{ STATIC_URL }}/icons/date.png" alt="{% trans 'Start' %}" title="{% trans 'Start' %}">
{{ event.start|date }}
{% if event.end %}
  {% trans "from" %} {{ event.start|time:'H:i' }} {% trans "to" %} {{ event.end|time:'H:i' }}
{% else %}
  {{ event.start|time:'H:i' }}
{% endif %}
</div>
{% if event.description %}<p>{{event.description}}</p>{% endif %}
<div class="info">
<img src="{{ STATIC_URL }}/icons/map.png" alt="{% trans 'Location' %}" title="{% trans 'Location' %}">
{{ event.location }}
<img src="{{ STATIC_URL }}/icons/comments.png" alt="{% trans 'Comments' %}" title="{% trans 'Comments' %}">
<a href="{{event.get_absolute_url}}#comments">{{ comment_count }} {% trans 'Comments' %}</a>
<img src="{{ STATIC_URL }}/icons/images.png" alt="{% trans 'Photos' %}" title="{% trans 'Photos' %}">
<a href="{% url 'event-photo-list' event.pk %}">{{ event.photo_count }} {% trans 'Photos' %}</a>
</div>
<p style="text-align:right">
  {% if perms.events.add_photo %}
  <a href="{% url 'event-photo-list' event.pk %}" class="button"><img src="{{ STATIC_URL }}icons/image_add.png" alt="{%trans "Upload" %}"></a>
  {% endif %}
</p>
</div></div>
{% endfor %}

<form method="post" enctype="multipart/form-data">
 {% csrf_token %}
  <fieldset class="grid_8 push_2">
  <legend>Photos hochladen</legend>
  {% include "form.html" %}
  <p class="buttonbar">
   <button type="submit">
   <img src="{{ STATIC_URL }}icons/drive_go.png" alt="" />
   {% trans "upload" %}
   </button>
  </p>
 </fieldset>
 </form>
{% endblock %}


