{% extends 'iconolab_base.html' %}

{% load staticfiles %}
{% load thumbnail %}
{% load iconolab_tags %}
{% load humanize %}

{% block content %}
<table class="table">
  <thead>
    <th></th>
    <th>Auteur</th>
    <th>Titre</th>
    <th>Description</th>
    <th>Mots-clé</th>
    <th></th>
  </thead>
  <tbody>
  {% for revision in revisions %}
    <tr>
      <td>
        <div class="fragment-container" style="position: relative">
          {% thumbnail revision.annotation.image.media "100x100" crop=False as im %}
            <img v-el:small-image src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" />
            <svg width="{{ im.width }}" height="{{ im.height }}" version="1.1" style="position:absolute; top:0px; left: 0px">
              <g transform="matrix({% transform_matrix im_width=im.width im_height=im.height max_x=100 max_y=100 %})">
                <path d="{{ revision.fragment|clean_path }}" opacity="0.7" fill="orange"></path>
              </g>
            </svg>
          {% endthumbnail %}
        </div>
      </td>
      <td>{{ revision.author }}</td>
      <td>{{ revision.title }}</td>
      <td>{{ revision.description }}</td>
      <td>
        {% for tagging_info in revision.tagginginfo_set.all %}
          <p>
            <span class="label label-default"><i class="fa fa-tag"></i> {{ tagging_info.tag.label }}</span>
          </p>
        {% endfor %}
      </td>
      <td class="text-right">{{ revision.created|date:"d/m/Y H:i" }}</td>
    </tr>
  {% endfor %}
  </tbody>
</table>
{% endblock %}
