src/egonomy/templates/partial/image_in_list.html
author cavaliet
Tue, 02 Jul 2013 13:16:00 +0200
changeset 212 2cca82dd0e79
parent 168 c90576d18319
child 213 6655617f3d92
permissions -rw-r--r--
add arrows and search management with pictures.

{% load static %}
{% load i18n %}
{% load thumbnail %}
{# we suppose here that "img" has been defined #}
<a href="{% url 'annotate_picture' image_id=img.id %}{% if search %}?search={{ search }}&index_search={{ offset_search|add:forloop.counter0 }}{% endif %}">
<div class="center-image">
{% with img.info.image_file as image %}
{% if image %}
 {% if image|is_portrait %}
   {% thumbnail image "x225" 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="225" height="225" class="placeholder" />
   {% endthumbnail %}
 {% else %}
   {% thumbnail image "225" 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=225" height="225" class="placeholder" />
   {% endthumbnail %}
 {% endif %}
{% else %}
     <img src="{% static 'egonomy/img/empty.gif' %}" width=225" height="225" class="placeholder" />
{% endif %}
{% endwith %}
</div>
<div class="content">
    <h3>{{ img.metadata.titre|default:_("No title") }}</h3>
    <p>{% trans "Author" %}&nbsp;: <strong>{{ img.metadata.auteur|default:_("Not documented") }}</strong></p>
</div>
</a>
<div class="tools-2">
    <ul class="clearfix">
        <li><a class="tool twitter" href="#" title="{% trans 'Share on Twitter'%}"></a></li>
        <li><a class="tool facebook" href="#" title="{% trans 'Share on Facebook'%}"></a></li>
      {% if user.is_authenticated %}
        <li><a class="tool plus open-popin additemtocollection" data-type="image" data-id="{{ img.id }}" href="#add-to-collection" title="{% trans 'Add to a collection'%}"></a></li>
      {% else %}
        <li><a class="tool plus" href="{% url 'login' %}" title="{% trans 'Log in to add to a collection' %}"></a></li>
      {% endif %}
        <li><a class="tool cut" href="{% url 'create_fragment' image_id=img.id %}" title="{% trans 'Create a fragment'%}"></a></li>
    </ul>
</div>