{% load endless i18n admin_static images_tags %}
<!DOCTYPE html>
<html lang='pt-br'>
  <head>
    <link rel="stylesheet" type="text/css" href="{% static 'admin/opps/images/css/bootstrap/css/bootstrap.min.css' %}" media="all"/>
  </head>
  <body>
    <div class="container-fluid">
      <div class="row-fluid">
      <div class="span12">
        <h2>{% trans 'Images' %}</h2>
        <form class="form-inline" method="get" action=".">
          <div class="span3">
            <label for="id_user">{% trans 'User' %}:</label>
            <select name="user" class="input-medium">
              <option value="">----</option>
              {% for user in users%}
              <option {% if user_id == user.id %}selected{% endif %} value="{{ user.id }}">{{ user.email }}</option>
              {% endfor %}
            </select>
          </div>
          <div class="span3">
            <label for="id_published">{% trans 'Published' %}:</label>
            <select name="published" class="input-medium">
              <option value="">----</option>
              <option {% if published == "1" %}selected{% endif %} value="1">Sim</option>
              <option {% if published == "0" %}selected{% endif %}value="0">Não</option>
            </select>
          </div>
          <div class="input-append">
            <input type="text" class="input-medium" name="q" />
            <button type="submit" class="btn">{% trans 'Search' %}</button>
          </div>
          <a class="btn btn-warning pull-right" href="{% url 'image_add' %}"><i class="icon-picture"></i>{% trans 'Add Image' %}</a>
        </form>
      </div>
      <div class="row-fluid">
        {% paginate 20 images %}
        <ul class="thumbnails">
          {% for image in images %}
          <li class="span3">
            <div class="thumbnail">
              <img src="{% image_url image.get_absolute_url width=80 height=80 %}" />
              <div class="caption">
                <p><b>{{ image.title }}</b></p>
                <a class="btn btn-primary" href="#" onclick="top.opps_editor_popup_selector('{% image_url image.get_absolute_url %}')">{% trans 'Insert on Editor' %}</a>
              </div>
            </div>
          </li>
          {% if forloop.counter|divisibleby:"4" and not forloop.last %}</ul><ul class="thumbnails">{% endif %}
          {% endfor %}
        </ul>
      </div>
      {% show_pages %}
      </div>
    </div>
  </body>
</html>
