| author | cavaliet |
| Mon, 25 Feb 2013 13:54:58 +0100 | |
| changeset 67 | a085d708c407 |
| parent 51 | d842aad55f81 |
| child 79 | 2a51570e986b |
| permissions | -rw-r--r-- |
| 9 | 1 |
{% extends "egonomy_base.html" %} |
2 |
{% load static %} |
|
3 |
{% load i18n %} |
|
| 17 | 4 |
{% load thumbnail %} |
| 9 | 5 |
|
6 |
{% block title %}{% trans "Home" %}{% endblock %} |
|
7 |
||
8 |
{% block content %} |
|
| 20 | 9 |
<div class="fullwidth"> |
| 9 | 10 |
<!-- Liste des dernières images annotées --> |
11 |
<div class="column column-half"> |
|
| 40 | 12 |
<h2>{% trans "Last annotated pictures" %} |
|
25
48614929b87a
Real sort on home. Real pict's fragment on other pages. Real links on intelligent pagination.
cavaliet
parents:
23
diff
changeset
|
13 |
<span class="right"><a href="{% url 'all_pictures' %}" alt="{% trans "All pictures" %}">{% trans "All pictures" %}</a></span></h2> |
| 9 | 14 |
<ul class="fullwidth"> |
| 17 | 15 |
{% for img in img_list %} |
| 9 | 16 |
<li class="subcol subcol-half-fourth"> |
|
23
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
17 |
<a href="{% url 'annotate_picture' image_id=img.id %}"> |
| 9 | 18 |
<div class="center-image"> |
|
23
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
19 |
{% with img.info.image_file as image %} |
|
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
20 |
{% if image %} |
|
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
21 |
{% if image|is_portrait %} |
|
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
22 |
{% thumbnail image "x110" format="PNG" crop="center" as im %} |
| 17 | 23 |
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/> |
24 |
{% empty %} |
|
25 |
<img src="{% static 'egonomy/img/empty.gif' %}" width="110" height="110" class="placeholder" /> |
|
26 |
{% endthumbnail %} |
|
27 |
{% else %} |
|
|
23
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
28 |
{% thumbnail image "110" format="PNG" crop="center" as im %} |
| 17 | 29 |
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/> |
30 |
{% empty %} |
|
31 |
<img src="{% static 'egonomy/img/empty.gif' %}" width=110" height="110" class="placeholder" /> |
|
32 |
{% endthumbnail %} |
|
33 |
{% endif %} |
|
|
18
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
34 |
{% else %} |
| 17 | 35 |
<img src="{% static 'egonomy/img/empty.gif' %}" width=110" height="110" class="placeholder" /> |
36 |
{% endif %} |
|
|
23
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
37 |
{% endwith %} |
| 9 | 38 |
</div> |
| 51 | 39 |
<h3>{{ img.metadata.titre|default:_("No title") }}</h3></a> |
40 |
<p>{% trans "Author" %} : <strong>{{ img.metadata.auteur|default:_("Not documented") }}</strong></p> |
|
| 9 | 41 |
</li> |
| 17 | 42 |
{% endfor %} |
| 9 | 43 |
</ul> |
44 |
</div> |
|
45 |
<!-- Liste des derniers fragments modifiés --> |
|
46 |
<div class="column column-half"> |
|
| 40 | 47 |
<h2>{% trans "Last created fragments" %} |
|
27
daaafc916dc4
Debug in templates. All fragments page added. Language files updated.
cavaliet
parents:
25
diff
changeset
|
48 |
<span class="right"><a href="{% url 'all_fragments' %}" alt="{% trans "All fragments" %}">{% trans "All fragments" %}</a></span></h2> |
| 9 | 49 |
<ul class="fullwidth"> |
|
18
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
50 |
{% for frg in fragment_list %} |
| 9 | 51 |
<li class="subcol subcol-half-fourth"> |
|
23
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
52 |
<a href="{% url 'view_fragment' fragment_pk=frg.pk %}"> |
| 9 | 53 |
<div class="center-image"> |
54 |
<div class="image-and-fragment"> |
|
|
23
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
55 |
{% if frg.image %} |
|
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
56 |
{% with frg.image.info.image_file as image %} |
|
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
57 |
{% if image|is_portrait %} |
|
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
58 |
{% thumbnail image "x110" format="PNG" crop="center" as im %} |
|
18
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
59 |
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/> |
|
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
60 |
{% empty %} |
|
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
61 |
<img src="{% static 'egonomy/img/empty.gif' %}" width="110" height="110" class="placeholder" /> |
|
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
62 |
{% endthumbnail %} |
|
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
63 |
{% else %} |
|
23
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
64 |
{% thumbnail image "110" format="PNG" crop="center" as im %} |
|
18
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
65 |
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/> |
|
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
66 |
{% empty %} |
|
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
67 |
<img src="{% static 'egonomy/img/empty.gif' %}" width=110" height="110" class="placeholder" /> |
|
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
68 |
{% endthumbnail %} |
|
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
69 |
{% endif %} |
|
23
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
70 |
{% endwith %} |
|
18
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
71 |
{% else %} |
|
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
72 |
<img src="{% static 'egonomy/img/empty.gif' %}" width=110" height="110" class="placeholder" /> |
|
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
73 |
{% endif %} |
| 9 | 74 |
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 1 1" preserveAspectRatio="none"> |
|
23
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
75 |
<path d="{{ frg.coordinates }}" stroke="red" stroke-width=".02" fill="red" fill-opacity=".3" /> |
| 9 | 76 |
</svg> |
77 |
</div> |
|
78 |
</div> |
|
|
23
bb7819c8d7c2
first step user login/logout. Create fragment works. Views and templates adapted with real data model.
cavaliet
parents:
20
diff
changeset
|
79 |
<h3>{{ frg.title }}</h3></a> |
| 51 | 80 |
<h4>{% trans "Fragment from" %} <a href="{% url 'annotate_picture' image_id=frg.image.id %}">{{ frg.image.metadata.titre|default:_("No title") }}</a></h4> |
| 67 | 81 |
<p>{% trans "Annotated by" %} <strong><a href="{% url 'user_fragments' username=frg.author %}">{{ frg.author }}</a></strong></p> |
| 9 | 82 |
</li> |
|
18
ffd106d9b8e1
Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents:
17
diff
changeset
|
83 |
{% endfor %} |
| 9 | 84 |
</ul> |
85 |
</div> |
|
86 |
</div> |
|
87 |
{% endblock %} |
|
88 |