| author | cavaliet |
| Thu, 02 May 2013 14:40:12 +0200 | |
| changeset 111 | 741e46d64fdc |
| parent 110 | 4732fcfd3a76 |
| child 149 | af59627418e7 |
| permissions | -rw-r--r-- |
| 15 | 1 |
{% extends "egonomy_base.html" %} |
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 %} |
|
48
4c0838a3a8b6
add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents:
27
diff
changeset
|
5 |
{% load egonomy_thumbnail %} |
| 15 | 6 |
|
7 |
{% block title %}{% trans "View a fragment" %}{% endblock %} |
|
8 |
||
9 |
{% block content %} |
|
10 |
<div class="fullwidth"> |
|
11 |
<div class="column column-half"> |
|
|
18
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
15
diff
changeset
|
12 |
<h2>{{ fragment.title }}</h2> |
|
48
4c0838a3a8b6
add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents:
27
diff
changeset
|
13 |
<div class="center-image"> |
| 78 | 14 |
{% if fragment_only %} |
15 |
<div class="image-and-fragment large_square_fragment"> |
|
16 |
{% with fragment.image.info.image_file as image %} |
|
| 79 | 17 |
{% include "partial/fragment_only.html" %} |
| 78 | 18 |
{% endwith %} |
19 |
</div> |
|
20 |
{% else %} |
|
|
48
4c0838a3a8b6
add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents:
27
diff
changeset
|
21 |
<div class="image-and-fragment"> |
| 79 | 22 |
{% with 0.8 as ratio %} |
23 |
{% with "476" as w_size %} |
|
24 |
{% with "x600" as h_size %} |
|
25 |
{% include "partial/picture_and_fragment.html" %} |
|
26 |
{% endwith %} |
|
27 |
{% endwith %} |
|
28 |
{% endwith %} |
|
|
48
4c0838a3a8b6
add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents:
27
diff
changeset
|
29 |
</div> |
| 78 | 30 |
{% endif %} |
|
48
4c0838a3a8b6
add limit 600px height limit in template. Create templatetag to get image ratio.
cavaliet
parents:
27
diff
changeset
|
31 |
</div> |
| 15 | 32 |
</div> |
33 |
<div class="column column-half"> |
|
34 |
<form action="#"> |
|
35 |
<table class="image-metadata"> |
|
36 |
<tr> |
|
37 |
<th>{% trans "Source picture" %} :</th> |
|
| 51 | 38 |
<td><a href="{% url 'annotate_picture' image_id=fragment.image.id %}">{{ fragment.image.metadata.titre|default:_("No title") }}</a></td> |
| 15 | 39 |
</tr> |
40 |
<tr> |
|
|
18
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
15
diff
changeset
|
41 |
<th>{% trans "Fragment's description" %} :</th> |
|
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
15
diff
changeset
|
42 |
<td>{{ fragment.description }}</td> |
| 15 | 43 |
</tr> |
44 |
<tr> |
|
45 |
<th>{% trans "Users keywords" %}</th> |
|
|
27
daaafc916dc4
Debug in templates. All fragments page added. Language files updated.
cavaliet
parents:
25
diff
changeset
|
46 |
<td>{{ fragment.tags }}</td> |
| 15 | 47 |
</tr> |
48 |
<tr> |
|
49 |
<th>{% trans "Last modification" %} :</th> |
|
| 71 | 50 |
<td>{{ fragment.date_saved }} {% trans 'by' %} <strong><a href="{% url 'user_fragments' username=fragment.author %}">{{ fragment.author }}</a></strong></td> |
| 15 | 51 |
</tr> |
| 71 | 52 |
{% ifequal user fragment.author %} |
53 |
<tr> |
|
54 |
<th> </th> |
|
55 |
<td><a href="{% url 'create_fragment' image_id=fragment.image.id fragment_pk=fragment.pk %}" class="big-button">{% trans "Modify this fragment" %}</a></td> |
|
56 |
</tr> |
|
| 110 | 57 |
<tr> |
58 |
<th> </th> |
|
59 |
<td><a href="{% url 'delete_fragment' %}?fragment_pk={{fragment.pk}}" class="big-button" onclick="return confirm('{% trans "Do you really want to delete this fragment ? Warning : this action est irreversible." %}')">{% trans "Delete this fragment" %}</a></td> |
|
60 |
</tr> |
|
| 71 | 61 |
{% endifequal %} |
| 84 | 62 |
<tr> |
63 |
<th> </th> |
|
64 |
<td><a href="{% url 'create_fragment' image_id=fragment.image.id %}?duplicate={{fragment.pk}}" class="big-button">{% trans "Duplicate this fragment" %}</a></td> |
|
65 |
</tr> |
|
| 15 | 66 |
</table> |
67 |
</form> |
|
|
25
48614929b87a
Real sort on home. Real pict's fragment on other pages. Real links on intelligent pagination.
cavaliet
parents:
23
diff
changeset
|
68 |
<div class="fullwidth"> |
|
48614929b87a
Real sort on home. Real pict's fragment on other pages. Real links on intelligent pagination.
cavaliet
parents:
23
diff
changeset
|
69 |
<a href="{% url 'create_fragment' image_id=fragment.image.id %}" class="big-button">{% trans "Create a fragment" %}</a> |
|
48614929b87a
Real sort on home. Real pict's fragment on other pages. Real links on intelligent pagination.
cavaliet
parents:
23
diff
changeset
|
70 |
</div> |
| 78 | 71 |
<div class="fullwidth"> |
72 |
{% if fragment_only %} |
|
73 |
<a href="{% url 'view_fragment' fragment_pk=fragment.pk %}?fragment_only=0"> |
|
74 |
{% trans "See the fragment in its full picture" %} :<br/> |
|
75 |
<div class="image-and-fragment"> |
|
| 79 | 76 |
{% with 1 as ratio %} |
77 |
{% with "110" as w_size %} |
|
78 |
{% with "x110" as h_size %} |
|
79 |
{% include "partial/picture_and_fragment.html" %} |
|
| 78 | 80 |
{% endwith %} |
| 79 | 81 |
{% endwith %} |
82 |
{% endwith %} |
|
| 78 | 83 |
</div> |
84 |
</a> |
|
85 |
{% else %} |
|
86 |
<a href="{% url 'view_fragment' fragment_pk=fragment.pk %}"> |
|
87 |
{% trans "See the fragment only" %} :<br/> |
|
88 |
<div class="image-and-fragment little_square_fragment"> |
|
89 |
{% with image=fragment.image.info.image_file %} |
|
| 79 | 90 |
{% include "partial/fragment_only.html" %} |
| 78 | 91 |
{% endwith %} |
92 |
</div> |
|
93 |
</a> |
|
94 |
{% endif %} |
|
95 |
</div> |
|
| 15 | 96 |
</div> |
97 |
</div> |
|
98 |
<div class="fullwidth"> |
|
99 |
<div class="column column-full"> |
|
100 |
<h2>{% trans "Fragments from this picture" %}</h2> |
|
101 |
<ul class="fullwidth"> |
|
| 79 | 102 |
{% for fragment in fragment_list %} |
| 15 | 103 |
<li class="subcol subcol-eighth"> |
| 79 | 104 |
<a href="{% url 'view_fragment' fragment_pk=fragment.pk %}"> |
| 15 | 105 |
<div class="center-image"> |
106 |
<div class="image-and-fragment"> |
|
| 79 | 107 |
{% include "partial/picture_and_red_fragment.html" %} |
| 15 | 108 |
</div> |
109 |
</div> |
|
| 79 | 110 |
<h3>{{ fragment.title }}</h3></a> |
111 |
<p>{% trans "Annotated by" %} <strong><a href="{% url 'user_fragments' username=fragment.author %}">{{ fragment.author }}</a></strong></p> |
|
| 15 | 112 |
</li> |
|
18
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
15
diff
changeset
|
113 |
{% endfor %} |
| 15 | 114 |
</ul> |
115 |
</div> |
|
116 |
</div> |
|
117 |
{% endblock %} |
|
118 |