src/egonomy/templates/egonomy_home.html
author cavaliet
Mon, 25 Feb 2013 13:54:58 +0100
changeset 67 a085d708c407
parent 51 d842aad55f81
child 79 2a51570e986b
permissions -rw-r--r--
user fragment page and enhance pertimm display.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     1
{% extends "egonomy_base.html" %}
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     2
{% load static %}
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     3
{% load i18n %}
17
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
     4
{% load thumbnail %}
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     5
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     6
{% block title %}{% trans "Home" %}{% endblock %}
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     7
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
     8
{% block content %}
20
8dd5b0f370fc search first step
cavaliet
parents: 18
diff changeset
     9
                <div class="fullwidth">
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    10
                    <!-- Liste des dernières images annotées -->
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    11
                    <div class="column column-half">
40
599b9b82c750 enhance search results display
cavaliet
parents: 29
diff changeset
    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
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    14
                        <ul class="fullwidth">
17
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    15
                          {% for img in img_list %}
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    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
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    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
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    23
	                                  <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    24
	                                {% empty %}
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    25
	                                  <img src="{% static 'egonomy/img/empty.gif' %}" width="110" height="110" class="placeholder" />
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    26
	                                {% endthumbnail %}
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    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
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    29
                                      <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    30
                                    {% empty %}
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    31
                                      <img src="{% static 'egonomy/img/empty.gif' %}" width=110" height="110" class="placeholder" />
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    32
                                    {% endthumbnail %}
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    33
	                              {% endif %}
18
ffd106d9b8e1 Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents: 17
diff changeset
    34
	                             {% else %}
17
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    35
	                                  <img src="{% static 'egonomy/img/empty.gif' %}" width=110" height="110" class="placeholder" />
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    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
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    38
                                </div>
51
d842aad55f81 clean default values in templates
cavaliet
parents: 40
diff changeset
    39
                                <h3>{{ img.metadata.titre|default:_("No title") }}</h3></a>
d842aad55f81 clean default values in templates
cavaliet
parents: 40
diff changeset
    40
                                <p>{% trans "Author" %}&nbsp;: <strong>{{ img.metadata.auteur|default:_("Not documented") }}</strong></p>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    41
                            </li>
17
38611b2c2782 upgrade home template with thumbnail.
cavaliet
parents: 15
diff changeset
    42
                          {% endfor %}
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    43
                        </ul>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    44
                    </div>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    45
                    <!-- Liste des derniers fragments modifiés -->
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    46
                    <div class="column column-half">
40
599b9b82c750 enhance search results display
cavaliet
parents: 29
diff changeset
    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
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    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
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    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
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    53
                                <div class="center-image">
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    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
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    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
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    76
                                        </svg>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    77
                                    </div>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    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
d842aad55f81 clean default values in templates
cavaliet
parents: 40
diff changeset
    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
a085d708c407 user fragment page and enhance pertimm display.
cavaliet
parents: 51
diff changeset
    81
                                <p>{% trans "Annotated by" %} <strong><a href="{% url 'user_fragments' username=frg.author %}">{{ frg.author }}</a></strong></p>
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    82
                            </li>
18
ffd106d9b8e1 Prepare template for real datas. Some fake datas temporary generated in views.
cavaliet
parents: 17
diff changeset
    83
                          {% endfor %}
9
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    84
                        </ul>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    85
                    </div>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    86
                </div>
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    87
{% endblock %}
aee87529a698 first views with empty templates
cavaliet
parents:
diff changeset
    88