{% extends "egonomy_base.html" %}
{% load static %}
{% load i18n %}
{% load thumbnail %}
{% load navigation %}

{% block title %}{% trans "All fragments" %}{% endblock %}

{% block content %}
                <div class="fullwidth">
                    <div class="fullwidth">
                        <h2>{% trans "All fragments" %}</h2>
						{% if nb_pages %}<p>{% build_pagination nb_pages cur_page_nb "all_fragments" "contents_page clickable" %}</p>{% endif %}
                        <ul class="fullwidth">
                          {% for frg in results %}
                            <li class="subcol_all">
                              <a href="{% url 'view_fragment' fragment_pk=prg.pk %}">
                              <div class="center-image">
                                <div class="image-and-fragment">
                                 {% with frg.image.info.image_file as image %}
                                 {% if image %}
                                  {% if image|is_portrait %}
							 	    {% thumbnail image "x110" format="PNG" crop="center" as im %}
	                                  <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
	                                {% empty %}
	                                  <img src="{% static 'egonomy/img/empty.gif' %}" width="110" height="110" class="placeholder" />
	                                {% endthumbnail %}
	                              {% else %}
                                    {% thumbnail image "110" format="PNG" crop="center" as im %}
                                      <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
                                    {% empty %}
                                      <img src="{% static 'egonomy/img/empty.gif' %}" width=110" height="110" class="placeholder" />
                                    {% endthumbnail %}
	                              {% endif %}
	                             {% else %}
	                                  <img src="{% static 'egonomy/img/empty.gif' %}" width=110" height="110" class="placeholder" />
	                             {% endif %}
	                             {% endwith %}
	                                  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 1 1" preserveAspectRatio="none">
                                        <path d="{{ frg.coordinates }}" stroke="red" stroke-width=".02" fill="red" fill-opacity=".3" />
                                      </svg>
                                </div>
                             </div>
                             <h3>{{ frg.title }}</h3></a>
                             <p>{% trans "Annotated by" %} <strong>{{ frg.author }}</strong></p>
                            </li>
                          {% endfor %}
                        </ul>
                        {% if nb_pages %}<p>{% build_pagination nb_pages cur_page_nb "all_fragments" "contents_page clickable" %}</p>{% endif %}
                    </div>
                </div>
{% endblock %}

