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

{% 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_image|thumbnail_url:'thumbnail' }}" alt="" class="thumbnail"/></a>
<div class="grid_4" />
<h4><a href="{% url 'event-photo-list' event.pk %}">{{ event.name }}</a></h4>
<div class="info">
<span class="fa fa-calendar-o" title="{% trans 'Start' %}"></span>
{{ 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">
<span class="fa fa-map-marker" title="{% trans 'Location' %}"></span>
{{ event.location }}
<span class="fa fa-comments"  title="{% trans 'Comments' %}"></span>
<a href="{{event.get_absolute_url}}#comments">{{ comment_count }} {% trans 'Comments' %}</a>

    <span class="fa fa-camera-retro" title="{% trans 'Photos' %}"></span>
<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">
      <span class="fa fa-cloud-upload"></span>
      {%trans "Upload" %}</a>
  {% endif %}
</p>
</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">
   <span class="fa fa-cloud-upload"></span>
   {% trans "Upload" %}
   </button>
  </p>
 </fieldset>
 </form>
{% endblock %}


