| author | cavaliet |
| Tue, 02 Jul 2013 13:16:00 +0200 | |
| changeset 212 | 2cca82dd0e79 |
| parent 175 | 8f6eef1d1fc8 |
| child 213 | 6655617f3d92 |
| permissions | -rw-r--r-- |
| 140 | 1 |
{% extends "egonomy_newbase.html" %} |
| 9 | 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 %} |
| 9 | 5 |
|
6 |
{% block title %}{% trans "Annotate a picture" %}{% endblock %} |
|
7 |
||
| 212 | 8 |
{% block css_page %} |
9 |
<link rel="stylesheet" href="{% static 'egonomy/css/slideshow.css' %}" /> |
|
10 |
{% endblock %} |
|
11 |
||
| 9 | 12 |
{% block content %} |
| 140 | 13 |
<div class="title-page"> |
14 |
<h2>{{ img.metadata.titre|default:_("No 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_pictures' %}?search={{ search }}"></a></li> |
|
21 |
{% endif %} |
|
| 140 | 22 |
</ul> |
23 |
<ul class="clearfix"> |
|
24 |
<li> |
|
25 |
<a class="icon cut" href="{% url 'create_fragment' image_id=img.id %}">{% trans "Create a fragment" %}</a> |
|
26 |
</li> |
|
27 |
<li> |
|
| 149 | 28 |
{% if user.is_authenticated %} |
| 168 | 29 |
<a class="icon plus open-popin additemtocollection" data-type="image" data-id="{{ img.id }}" href="#add-to-collection">{% trans "Add to a collection" %}</a> |
| 149 | 30 |
{% else %} |
| 159 | 31 |
<a class="icon plus" href="{% url 'login' %}?next={% url 'annotate_picture' image_id=img.id %}">{% trans "Add to a collection" %}</a> |
| 149 | 32 |
{% endif %} |
| 140 | 33 |
</li> |
34 |
<!--li> |
|
35 |
<form action="#"> |
|
36 |
<p> |
|
37 |
<input class="search-form" id="id_search" type="text" placeholder="Romantisme noir"> |
|
38 |
</p> |
|
39 |
</form> |
|
40 |
</li--> |
|
41 |
</ul> |
|
42 |
</div> |
|
43 |
<article class="edition"> |
|
44 |
<div class="slideshow box-edition"> |
|
45 |
<div class="image-wrap"> |
|
46 |
{% with img.info.image_file as image %} |
|
47 |
{% if image|is_portrait %} |
|
48 |
{% thumbnail image "x600" format="PNG" crop="center" as im %} |
|
49 |
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/> |
|
50 |
{% empty %} |
|
51 |
<img src="{% static 'egonomy/img/empty.gif' %}" width="600" height="600" class="placeholder" /> |
|
52 |
{% endthumbnail %} |
|
53 |
{% else %} |
|
54 |
{% thumbnail image "600" format="PNG" crop="center" as im %} |
|
55 |
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/> |
|
56 |
{% empty %} |
|
57 |
<img src="{% static 'egonomy/img/empty.gif' %}" width="600" height="600" class="placeholder" /> |
|
58 |
{% endthumbnail %} |
|
59 |
{% endif %} |
|
60 |
{% endwith %} |
|
| 9 | 61 |
</div> |
| 212 | 62 |
{% if search %} |
63 |
{% if index_search|add:1 > 1 %}{# i know it's weird but "if index_search > 0" doesn't work #} |
|
64 |
<div class="arrow-wrap left-arrow"> |
|
65 |
<a class="arrow" href="{% url 'picture_by_search' %}?search={{ search }}&index_search={{ index_search|add:-1 }}"></a> |
|
| 140 | 66 |
</div> |
| 212 | 67 |
{% endif %} |
| 140 | 68 |
<div class="arrow-wrap right-arrow"> |
| 212 | 69 |
<a class="arrow" href="{% url 'picture_by_search' %}?search={{ search }}&index_search={{ index_search|add:1 }}"></a> |
70 |
</div> |
|
71 |
{% endif %} |
|
| 140 | 72 |
<ul class="share"> |
73 |
<li><a title="Partager sur Twitter" href="#" class="tool twitter"></a></li> |
|
74 |
<li><a title="Partager sur Facebook" href="#" class="tool facebook"></a></li> |
|
75 |
</ul> |
|
76 |
</div> |
|
77 |
<div class="info box-edition"> |
|
78 |
<table> |
|
79 |
<tbody> |
|
| 9 | 80 |
<tr> |
| 15 | 81 |
<th>{% trans "Description" %} :</th> |
| 51 | 82 |
<td>{{ img.metadata.description|default:"" }}</td> |
| 9 | 83 |
</tr> |
84 |
<tr> |
|
| 15 | 85 |
<th>{% trans "Author" %} :</th> |
| 51 | 86 |
<td>{{ img.metadata.auteur|default:"" }}</td> |
| 9 | 87 |
</tr> |
88 |
<tr> |
|
| 15 | 89 |
<th>{% trans "Period" %} :</th> |
| 51 | 90 |
<td>{{ img.metadata.periode|default:"" }}</td> |
| 9 | 91 |
</tr> |
92 |
<tr> |
|
| 15 | 93 |
<th>{% trans "Production site" %} :</th> |
| 51 | 94 |
<td>{{ img.metadata.site|default:"" }}</td> |
| 9 | 95 |
</tr> |
96 |
<tr> |
|
| 15 | 97 |
<th>{% trans "Localization" %} :</th> |
| 104 | 98 |
<td>{{ img.metadata.localisation|default:"" }}</td> |
| 9 | 99 |
</tr> |
| 140 | 100 |
</tbody> |
101 |
</table> |
|
102 |
</div> |
|
103 |
<div class="box-edition"> |
|
104 |
<h3>{% trans "Keywords" %} :</h3> |
|
105 |
<ul class="list-key-search list-keywords clearfix"> |
|
| 175 | 106 |
{% for t in img.metadata.tag_list %} |
| 212 | 107 |
{% if t != "" %}<li><a class="box-shadow-2" href='{% url "all_pictures" %}?field=all&search="{{ t }}"'>{{ t }}</a></li>{% endif %} |
| 140 | 108 |
{% endfor %} |
109 |
</ul> |
|
| 9 | 110 |
</div> |
| 140 | 111 |
<div class="box-edition"> |
| 144 | 112 |
<h3>{% trans "Fragments from this picture" %} :</h3> |
113 |
{% if fragment_list %} |
|
| 140 | 114 |
<ul class="fullwidth clearfix"> |
115 |
{% for fragment in fragment_list %} |
|
116 |
<li class="subcol subcol-seventh"> |
|
117 |
<a href="{% url 'view_fragment' fragment_pk=fragment.pk %}"> |
|
118 |
<div class="center-image"> |
|
119 |
<div class="image-and-fragment"> |
|
120 |
{% include "partial/picture_and_red_fragment.html" %} |
|
| 9 | 121 |
</div> |
| 140 | 122 |
</div> |
123 |
<h3>{{ fragment.title }}</h3></a> |
|
124 |
<p>{% trans "Annotated by" %} <strong><a href="{% url 'user_fragments' username=fragment.author %}">{{ fragment.author }}</a></strong></p> |
|
125 |
</li> |
|
126 |
{% endfor %} |
|
127 |
</ul> |
|
| 144 | 128 |
{% else %} |
129 |
<p class="null">{% trans "No fragment" %}</p> |
|
130 |
{% endif %} |
|
| 9 | 131 |
</div> |
| 140 | 132 |
<div class="box-edition"> |
133 |
<h3>Collections liées à cette image :</h3> |
|
| 144 | 134 |
<p class="null">{% trans "No collection" %}</p> |
| 140 | 135 |
</div> |
136 |
</article> |
|
| 9 | 137 |
{% endblock %} |