{% extends "core/base.jinja" %}

{% block script %}
  {{ super() }}
  <script src="{{ static('com/js/poster_list.js') }}"></script>
{% endblock %}


{% block title %}
  {% trans %}Poster{% endtrans %}
{% endblock %}

{% block content %}
  <div id="poster_list">

    <div id="title">
      <h3>{% trans %}Posters{% endtrans %}</h3>
      <div id="links" class="right">
        <a id="create" class="link" href="{{ url(app + ":poster_list") }}">{% trans %}Create{% endtrans %}</a>
        {% if app == "com" %}
          <a id="moderation" class="link" href="{{ url("com:poster_moderate_list") }}">{% trans %}Moderation{% endtrans %}</a>
        {% endif %}
      </div>
    </div>

    <div id="posters">

      {% if poster_list.count() == 0 %}
        <div id="no-posters">{% trans %}No posters{% endtrans %}</div>
      {% else %}

        {% for poster in poster_list %}
          <div class="poster">
            <div class="name">{{ poster.name }}</div>
            <div class="image"><img src="{{ poster.file.url }}"></img></div>
            <div class="dates">
              <div class="begin">{{ poster.date_begin | date("d/M/Y H:m") }}</div>
              <div class="end">{{ poster.date_end | date("d/M/Y H:m") }}</div>
            </div>
            <a class="edit" href="{{ url(poster_edit_url_name, poster.id) }}">{% trans %}Edit{% endtrans %}</a>
          </div>
        {% endfor %}

      {% endif %}

    </div>

    <div id="view"><div id="placeholder"></div></div>

  </div>
{% endblock %}



