| author | cavaliet |
| Mon, 24 Feb 2014 18:22:07 +0100 | |
| changeset 256 | f4b443fcddc7 |
| parent 252 | b7486a56ad7d |
| child 260 | ebcc7a401ae9 |
| permissions | -rw-r--r-- |
| 149 | 1 |
{% extends "egonomy_newbase.html" %} |
| 15 | 2 |
{% load static %} |
3 |
{% load i18n %} |
|
|
18
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
15
diff
changeset
|
4 |
{% load thumbnail %} |
| 15 | 5 |
|
6 |
{% block title %}{% trans "View a fragment" %}{% endblock %} |
|
7 |
||
|
213
6655617f3d92
enhance arrows with pictures and and add arrows with fragments.
cavaliet
parents:
212
diff
changeset
|
8 |
{% block css_page %} |
|
6655617f3d92
enhance arrows with pictures and and add arrows with fragments.
cavaliet
parents:
212
diff
changeset
|
9 |
<link rel="stylesheet" href="{% static 'egonomy/css/slideshow.css' %}" /> |
|
6655617f3d92
enhance arrows with pictures and and add arrows with fragments.
cavaliet
parents:
212
diff
changeset
|
10 |
{% endblock %} |
|
6655617f3d92
enhance arrows with pictures and and add arrows with fragments.
cavaliet
parents:
212
diff
changeset
|
11 |
|
| 15 | 12 |
{% block content %} |
| 149 | 13 |
<div class="title-page"> |
14 |
<h2>{{ fragment.title }}</h2> |
|
15 |
</div> |
|
16 |
<div class="bar-tools clearfix"> |
|
17 |
<ul class="clearfix left"> |
|
| 212 | 18 |
<!--li><a class="go-to mosaic" href="#"></a></li--> |
19 |
{% if search %} |
|
20 |
<li><a class="go-to search" href="{% url 'all_fragments' %}?search={{ search }}"></a></li> |
|
21 |
{% endif %} |
|
| 149 | 22 |
</ul> |
23 |
<ul class="clearfix"> |
|
24 |
{% ifequal user fragment.author %} |
|
25 |
<li> |
|
26 |
<a class="icon edit" href="{% url 'create_fragment' image_id=fragment.image.id fragment_pk=fragment.pk %}">{% trans "Modify this fragment" %}</a> |
|
27 |
</li> |
|
28 |
<li> |
|
29 |
<a class="icon trash" href="{% url 'delete_fragment' %}?fragment_pk={{fragment.pk}}" onclick="return confirm('{% trans "Do you really want to delete this fragment ? Warning : this action est irreversible." %}')">{% trans "Delete this fragment" %}</a> |
|
30 |
</li> |
|
31 |
{% endifequal %} |
|
32 |
<li> |
|
33 |
<a class="icon copy" href="{% url 'create_fragment' image_id=fragment.image.id %}?duplicate={{fragment.pk}}">{% trans "Duplicate this fragment" %}</a> |
|
34 |
</li> |
|
35 |
<li> |
|
36 |
<a class="icon cut" href="{% url 'create_fragment' image_id=fragment.image.id %}">{% trans "Create a fragment" %}</a> |
|
37 |
</li> |
|
38 |
<li> |
|
39 |
{% if user.is_authenticated %} |
|
| 168 | 40 |
<a class="icon plus open-popin additemtocollection" data-type="fragment" data-id="{{ fragment.pk }}" href="#add-to-collection">{% trans "Add to a collection" %}</a> |
| 149 | 41 |
{% else %} |
| 159 | 42 |
<a class="icon plus" href="{% url 'login' %}?next={% url 'view_fragment' fragment_pk=fragment.pk %}">{% trans "Add to a collection" %}</a> |
| 149 | 43 |
{% endif %} |
44 |
</li> |
|
45 |
<!--li> |
|
46 |
<a class="icon save" href="#">Enregistrer sous</a> |
|
47 |
</li> |
|
48 |
<li> |
|
| 15 | 49 |
<form action="#"> |
| 149 | 50 |
<p> |
51 |
<input class="search-form" id="id_search" type="text" placeholder="Romantisme noir"> |
|
52 |
</p> |
|
| 15 | 53 |
</form> |
| 149 | 54 |
</li--> |
55 |
</ul> |
|
56 |
</div> |
|
57 |
<article class="edition"> |
|
58 |
<div class="slideshow box-edition"> |
|
59 |
<div class="image-wrap"> |
|
| 252 | 60 |
<a draggable="true" data-title="{{ fragment.title }}" |
61 |
data-description="{% trans 'Fragment from' %} {{ fragment.image.metadata.titre|default:_('No title') }} {% trans 'Annotated by' %} {{ fragment.author }}" |
|
62 |
href="{% url 'view_fragment' fragment_pk=fragment.pk %}"> |
|
| 149 | 63 |
{% if fragment_only %} |
64 |
<div class="image-and-fragment square-fragment-600"> |
|
65 |
{% with fragment.image.info.image_file as image %} |
|
66 |
{% include "partial/fragment_only.html" %} |
|
67 |
{% endwith %} |
|
68 |
</div> |
|
69 |
{% else %} |
|
70 |
<div class="image-and-fragment"> |
|
71 |
{% with 0.99 as ratio %} |
|
72 |
{% with "600" as w_size %} |
|
73 |
{% with "x600" as h_size %} |
|
74 |
{% include "partial/picture_and_fragment.html" %} |
|
75 |
{% endwith %} |
|
76 |
{% endwith %} |
|
77 |
{% endwith %} |
|
|
25
48614929b87a
Real sort on home. Real pict's fragment on other pages. Real links on intelligent pagination.
cavaliet
parents:
23
diff
changeset
|
78 |
</div> |
| 149 | 79 |
{% endif %} |
| 252 | 80 |
</a> |
| 149 | 81 |
</div> |
|
213
6655617f3d92
enhance arrows with pictures and and add arrows with fragments.
cavaliet
parents:
212
diff
changeset
|
82 |
{% if search %} |
|
6655617f3d92
enhance arrows with pictures and and add arrows with fragments.
cavaliet
parents:
212
diff
changeset
|
83 |
{% if index_search > 0 %} |
| 149 | 84 |
<div class="arrow-wrap left-arrow"> |
|
213
6655617f3d92
enhance arrows with pictures and and add arrows with fragments.
cavaliet
parents:
212
diff
changeset
|
85 |
<a class="arrow" href="{% url 'fragment_by_search' %}?search={{ search }}&index_search={{ index_search|add:-1 }}"></a> |
| 149 | 86 |
</div> |
|
213
6655617f3d92
enhance arrows with pictures and and add arrows with fragments.
cavaliet
parents:
212
diff
changeset
|
87 |
{% endif %} |
|
6655617f3d92
enhance arrows with pictures and and add arrows with fragments.
cavaliet
parents:
212
diff
changeset
|
88 |
{% if index_search|add:1 < nb_results %} |
| 149 | 89 |
<div class="arrow-wrap right-arrow"> |
|
213
6655617f3d92
enhance arrows with pictures and and add arrows with fragments.
cavaliet
parents:
212
diff
changeset
|
90 |
<a class="arrow" href="{% url 'fragment_by_search' %}?search={{ search }}&index_search={{ index_search|add:1 }}"></a> |
| 149 | 91 |
</div> |
|
213
6655617f3d92
enhance arrows with pictures and and add arrows with fragments.
cavaliet
parents:
212
diff
changeset
|
92 |
{% endif %} |
|
6655617f3d92
enhance arrows with pictures and and add arrows with fragments.
cavaliet
parents:
212
diff
changeset
|
93 |
{% endif %} |
| 149 | 94 |
<ul class="share"> |
95 |
<li><a title="Partager sur Twitter" href="#" class="tool twitter"></a></li> |
|
96 |
<li><a title="Partager sur Facebook" href="#" class="tool facebook"></a></li> |
|
97 |
</ul> |
|
98 |
</div> |
|
99 |
<div class="info box-edition clearfix"> |
|
100 |
<table class="edition-table-left"> |
|
101 |
<tbody> |
|
102 |
<tr> |
|
103 |
<th>{% trans "Source picture" %} :</th> |
|
104 |
<td><a href="{% url 'annotate_picture' image_id=fragment.image.id %}">{{ fragment.image.metadata.titre|default:_("No title") }}</a></td> |
|
105 |
</tr> |
|
106 |
<tr> |
|
107 |
<th>{% trans "Fragment's title" %} :</th> |
|
108 |
<td>{{ fragment.title }}</td> |
|
109 |
</tr> |
|
110 |
<tr> |
|
111 |
<th>{% trans "Fragment's description" %} :</th> |
|
112 |
<td>{{ fragment.description }}</td> |
|
113 |
</tr> |
|
114 |
<tr> |
|
115 |
<th>{% trans "Last modification" %} :</th> |
|
116 |
<td>{{ fragment.date_saved }} {% trans 'by' %} <strong><a href="{% url 'user_fragments' username=fragment.author %}">{{ fragment.author }}</a></strong></td> |
|
117 |
</tr> |
|
118 |
</tbody> |
|
119 |
</table> |
|
120 |
<table class="edition-table-right"> |
|
121 |
<tbody> |
|
122 |
{% if fragment_only %} |
|
123 |
<tr><th><a href="{% url 'view_fragment' fragment_pk=fragment.pk %}?fragment_only=0">{% trans "See the fragment in its full picture" %} :</a></th></tr> |
|
124 |
<tr><td><a href="{% url 'view_fragment' fragment_pk=fragment.pk %}?fragment_only=0"> |
|
125 |
<div class="image-and-fragment"> |
|
126 |
{% with 1 as ratio %} |
|
127 |
{% with "110" as w_size %} |
|
128 |
{% with "x110" as h_size %} |
|
129 |
{% include "partial/picture_and_fragment.html" %} |
|
130 |
{% endwith %} |
|
131 |
{% endwith %} |
|
132 |
{% endwith %} |
|
133 |
</div></a> |
|
134 |
</td></tr> |
|
| 78 | 135 |
</a> |
| 149 | 136 |
{% else %} |
137 |
<tr><th><a href="{% url 'view_fragment' fragment_pk=fragment.pk %}">{% trans "See the fragment only" %} :</a></th></tr> |
|
138 |
<tr><td><a href="{% url 'view_fragment' fragment_pk=fragment.pk %}"> |
|
139 |
<div class="image-and-fragment square-fragment-110"> |
|
| 78 | 140 |
{% with image=fragment.image.info.image_file %} |
| 79 | 141 |
{% include "partial/fragment_only.html" %} |
| 78 | 142 |
{% endwith %} |
| 149 | 143 |
</div></a> |
144 |
</td></tr> |
|
| 78 | 145 |
</a> |
| 149 | 146 |
{% endif %} |
147 |
</tbody> |
|
148 |
</table> |
|
149 |
</div> |
|
150 |
<div class="box-edition"> |
|
151 |
<table> |
|
152 |
<tbody> |
|
153 |
<tr> |
|
|
237
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
154 |
<th class="va-top">{% trans "Fragment's keywords" %} :</th> |
| 149 | 155 |
<td> |
156 |
<ul class="list-key-search no-before list-keywords clearfix"> |
|
| 256 | 157 |
{% for t in fragment.tag_list_linked %} |
158 |
{% if t.label != "" %} |
|
159 |
{% if t.url != "" %} |
|
160 |
<li> |
|
161 |
<span class="box-shadow-2 clean-linked-list"> |
|
162 |
<a data-tag="{{ t.label }}" href='{% url "all_fragments" %}?field=all&search="{{ t.label }}"'>{{ t.label }}</a> |
|
163 |
<a href="{{ t.url }}" target="_blank"><span class="logo_wikipedia"> </span></a> |
|
164 |
</span> |
|
165 |
</li> |
|
166 |
{% else %} |
|
167 |
<li><a data-tag="{{ t.label }}" class="box-shadow-2" href='{% url "all_fragments" %}?field=all&search="{{ t.label }}"'>{{ t.label }}</a></li> |
|
168 |
{% endif %} |
|
169 |
{% endif %} |
|
| 149 | 170 |
{% endfor %} |
171 |
</ul> |
|
172 |
</td> |
|
173 |
</tr> |
|
174 |
</tbody> |
|
175 |
</table> |
|
| 15 | 176 |
</div> |
| 149 | 177 |
<div class="box-edition"> |
178 |
<h3>{% trans "Fragments from this picture" %} :</h3> |
|
179 |
{% if fragment_list %} |
|
180 |
<ul class="fullwidth clearfix"> |
|
181 |
{% for fragment in fragment_list %} |
|
182 |
<li class="subcol subcol-seventh"> |
|
183 |
<a href="{% url 'view_fragment' fragment_pk=fragment.pk %}"> |
|
184 |
<div class="center-image"> |
|
185 |
<div class="image-and-fragment"> |
|
186 |
{% include "partial/picture_and_red_fragment.html" %} |
|
| 15 | 187 |
</div> |
| 149 | 188 |
</div> |
189 |
<h3>{{ fragment.title }}</h3></a> |
|
190 |
<p>{% trans "Annotated by" %} <strong><a href="{% url 'user_fragments' username=fragment.author %}">{{ fragment.author }}</a></strong></p> |
|
191 |
</li> |
|
192 |
{% endfor %} |
|
193 |
</ul> |
|
194 |
{% else %} |
|
195 |
<p class="null">{% trans "No fragment" %}</p> |
|
196 |
{% endif %} |
|
| 15 | 197 |
</div> |
| 149 | 198 |
<div class="box-edition"> |
|
237
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
199 |
<h3>{% trans "Collections including this fragment" %} :</h3> |
|
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
200 |
{% if related_collections %} |
|
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
201 |
<ul class="fullwidth clearfix"> |
|
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
202 |
{% for c in related_collections %} |
|
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
203 |
<li class="subcol subcol-seventh"> |
|
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
204 |
<a href="{% url 'view_collection' collection_pk=c.pk %}"> |
|
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
205 |
<h3>{{ c.title }}</h3></a> |
|
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
206 |
<p>{% trans "by" %} <strong><a href="{% url 'user_collections' username=c.author %}">{{ c.author }}</a></strong></p> |
|
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
207 |
</li> |
|
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
208 |
{% endfor %} |
|
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
209 |
</ul> |
|
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
210 |
{% else %} |
| 149 | 211 |
<p class="null">{% trans "No collection" %}</p> |
|
237
923b5823ef15
collections in fragment and image page. debug delete fragment.
cavaliet
parents:
213
diff
changeset
|
212 |
{% endif %} |
| 149 | 213 |
</div> |
214 |
</article> |
|
| 15 | 215 |
{% endblock %} |