|
175
|
1 |
{% load static %} |
|
|
2 |
{% load i18n %} |
|
|
3 |
{% load thumbnail %} |
|
|
4 |
<li class="item-masonry" data-keywords="{{ item.content_object.tag_list|join:',' }}"> |
|
|
5 |
<div class="curtain"></div> |
|
|
6 |
<div class="visuel-project"> |
|
|
7 |
{% ifequal item.content_type.model "fragment" %} |
|
|
8 |
{% with fragment=item.content_object %} |
|
196
|
9 |
<a href="{% url 'view_fragment' fragment_pk=fragment.pk %}"> |
|
175
|
10 |
<div class="center-image"> |
|
|
11 |
<div class="image-and-fragment square-fragment-177"> |
|
|
12 |
{% with image=fragment.image.info.image_file %} |
|
|
13 |
{% include "partial/fragment_only.html" %} |
|
|
14 |
{% endwith %} |
|
|
15 |
</div> |
|
|
16 |
</div> |
|
|
17 |
</a> |
|
|
18 |
<div class="tools toggle"> |
|
|
19 |
<div class="title-project"> |
|
|
20 |
<h3>{{ fragment.title }}</h3> |
|
|
21 |
<h4>{{ fragment.author }}</h4> |
|
|
22 |
</div> |
|
|
23 |
<ul class="clearfix"> |
|
|
24 |
<li><a class="tool twitter" href="#" title="{% trans 'Share on Twitter'%}"></a></li> |
|
|
25 |
<li><a class="tool facebook" href="#" title="{% trans 'Share on Facebook'%}"></a></li> |
|
|
26 |
<li>{% if user.is_authenticated %} |
|
|
27 |
<a class="tool plus open-popin additemtocollection" data-type="fragment" data-id="{{ fragment.pk }}" href="#add-to-collection" title="{% trans 'Add to a collection' %}"></a> |
|
|
28 |
{% else %} |
|
|
29 |
<a class="tool plus" href="{% url 'login' %}?next={% url 'view_fragment' fragment_pk=fragment.pk %}" title="{% trans 'Add to a collection' %}"></a> |
|
|
30 |
{% endif %}</li> |
|
|
31 |
<li><a class="tool cut" href="{% url 'create_fragment' image_id=fragment.image.id %}" title="{% trans 'Create a fragment'%}"></a></li> |
|
214
|
32 |
{% if user.is_authenticated %}{% ifequal col.author user %} |
|
|
33 |
<li><a class="tool trash" href="{% url 'remove_item' %}?collection_pk={{col.pk}}&item_pk={{item.pk}}&display=mosaic" onclick="return confirm('{% trans "Do you really want to remove this item from this collection ? Warning : this action est irreversible." %}')" title="{% trans 'Remove from this collection' %}" ></a></li> |
|
|
34 |
{% endifequal %}{% endif %} |
|
175
|
35 |
</ul> |
|
|
36 |
</div> |
|
|
37 |
<div class="content-project"> |
|
|
38 |
<div class="project-title"> |
|
|
39 |
{% if col.author == user %}<a class="tool edit toggle" href="#"></a>{% endif %} |
|
|
40 |
<h3>{{ fragment.title }}</h3> |
|
|
41 |
<h4>{{ fragment.author }}</h4> |
|
|
42 |
</div> |
|
199
|
43 |
<p>{{ item.description }}</p> |
|
175
|
44 |
</div> |
|
|
45 |
{% endwith %} |
|
|
46 |
{% else %} |
|
|
47 |
{% with img=item.content_object %} |
|
|
48 |
{% with img.info.image_file as image %} |
|
|
49 |
<a href="{% url 'annotate_picture' image_id=img.id %}"> |
|
|
50 |
{% if image %} |
|
|
51 |
{% thumbnail image "177" format="PNG" crop="center" as im %} |
|
|
52 |
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/> |
|
|
53 |
{% empty %} |
|
|
54 |
<img src="{% static 'egonomy/img/empty.gif' %}" width="177" height="117" class="placeholder" /> |
|
|
55 |
{% endthumbnail %} |
|
|
56 |
{% else %} |
|
|
57 |
<img src="{% static 'egonomy/img/empty.gif' %}" width="177" height="177" class="placeholder" /> |
|
|
58 |
{% endif %} |
|
|
59 |
</a> |
|
|
60 |
<div class="tools toggle"> |
|
|
61 |
<div class="title-project"> |
|
|
62 |
<h3>{{ img.metadata.titre }}</h3> |
|
|
63 |
<h4>{{ img.metadata.auteur }}</h4> |
|
|
64 |
</div> |
|
|
65 |
<ul class="clearfix"> |
|
|
66 |
<li><a class="tool twitter" href="#" title="{% trans 'Share on Twitter'%}"></a></li> |
|
|
67 |
<li><a class="tool facebook" href="#" title="{% trans 'Share on Facebook'%}"></a></li> |
|
|
68 |
<li>{% if user.is_authenticated %} |
|
|
69 |
<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> |
|
|
70 |
{% else %} |
|
199
|
71 |
<a class="tool plus" href="{% url 'login' %}?next={% url 'annotate_picture' image_id=img.id %}" title="{% trans 'Add to a collection' %}"></a> |
|
175
|
72 |
{% endif %}</li> |
|
|
73 |
<li><a class="tool cut" href="{% url 'create_fragment' image_id=img.id %}" title="{% trans 'Create a fragment'%}"></a></li> |
|
214
|
74 |
{% if user.is_authenticated %}{% ifequal col.author user %} |
|
|
75 |
<li><a class="tool trash" href="{% url 'remove_item' %}?collection_pk={{col.pk}}&item_pk={{item.pk}}&display=mosaic" onclick="return confirm('{% trans "Do you really want to remove this item from this collection ? Warning : this action est irreversible." %}')" title="{% trans 'Remove from this collection' %}" ></a></li> |
|
|
76 |
{% endifequal %}{% endif %} |
|
175
|
77 |
</ul> |
|
|
78 |
</div> |
|
|
79 |
<div class="content-project"> |
|
|
80 |
<div class="project-title"> |
|
|
81 |
{% if col.author == user %}<a class="tool edit toggle" href="#"></a>{% endif %} |
|
|
82 |
<h3>{{ img.metadata.titre }}</h3> |
|
|
83 |
<h4>{{ img.metadata.auteur }}</h4> |
|
|
84 |
</div> |
|
199
|
85 |
<p>{{ item.description }}</p> |
|
175
|
86 |
</div> |
|
|
87 |
{% endwith %} |
|
|
88 |
{% endwith %} |
|
|
89 |
{% endifequal %} |
|
|
90 |
</div> |
|
|
91 |
</li> |