|
121
|
1 |
{% load static %} |
|
|
2 |
{% load i18n %} |
|
|
3 |
{% load thumbnail %} |
|
|
4 |
{# we suppose here that "img" has been defined #} |
|
|
5 |
<a href="{% url 'annotate_picture' image_id=img.id %}"> |
|
|
6 |
<div class="center-image"> |
|
|
7 |
{% with img.info.image_file as image %} |
|
|
8 |
{% if image %} |
|
|
9 |
{% if image|is_portrait %} |
|
|
10 |
{% thumbnail image "x225" format="PNG" crop="center" as im %} |
|
|
11 |
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/> |
|
|
12 |
{% empty %} |
|
|
13 |
<img src="{% static 'egonomy/img/empty.gif' %}" width="225" height="225" class="placeholder" /> |
|
|
14 |
{% endthumbnail %} |
|
|
15 |
{% else %} |
|
|
16 |
{% thumbnail image "225" format="PNG" crop="center" as im %} |
|
|
17 |
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/> |
|
|
18 |
{% empty %} |
|
|
19 |
<img src="{% static 'egonomy/img/empty.gif' %}" width=225" height="225" class="placeholder" /> |
|
|
20 |
{% endthumbnail %} |
|
|
21 |
{% endif %} |
|
|
22 |
{% else %} |
|
|
23 |
<img src="{% static 'egonomy/img/empty.gif' %}" width=225" height="225" class="placeholder" /> |
|
|
24 |
{% endif %} |
|
|
25 |
{% endwith %} |
|
|
26 |
</div> |
|
|
27 |
<div class="content"> |
|
|
28 |
<h3>{{ img.metadata.titre|default:_("No title") }}</h3> |
|
|
29 |
<p>{% trans "Author" %} : <strong>{{ img.metadata.auteur|default:_("Not documented") }}</strong></p> |
|
|
30 |
</div> |
|
|
31 |
</a> |
|
|
32 |
<div class="tools-2"> |
|
|
33 |
<ul class="clearfix"> |
|
126
|
34 |
<li><a class="tool twitter" href="#" title="{% trans 'Share on Twitter'%}"></a></li> |
|
|
35 |
<li><a class="tool facebook" href="#" title="{% trans 'Share on Facebook'%}"></a></li> |
|
159
|
36 |
{% if user.is_authenticated %} |
|
|
37 |
<li><a class="tool plus open-popin" href="#add-to-collection" title="{% trans 'Add to a collection'%}"></a></li> |
|
|
38 |
{% else %} |
|
|
39 |
<li><a class="tool plus" href="{% url 'login' %}" title="{% trans 'Log in to add to a collection' %}"></a></li> |
|
|
40 |
{% endif %} |
|
126
|
41 |
<li><a class="tool cut" href="{% url 'create_fragment' image_id=img.id %}" title="{% trans 'Create a fragment'%}"></a></li> |
|
121
|
42 |
</ul> |
|
|
43 |
</div> |