src/egonomy/templates/egonomy_home.html
author cavaliet
Thu, 14 Feb 2013 16:40:41 +0100
changeset 40 599b9b82c750
parent 29 333d128cc1ae
child 51 d842aad55f81
permissions -rw-r--r--
enhance search results display

{% extends "egonomy_base.html" %}
{% load static %}
{% load i18n %}
{% load thumbnail %}

{% block title %}{% trans "Home" %}{% endblock %}

{% block content %}
                <div class="fullwidth">
                    <!-- Liste des dernières images annotées -->
                    <div class="column column-half">
                        <h2>{% trans "Last annotated pictures" %}
                            <span class="right"><a href="{% url 'all_pictures' %}" alt="{% trans "All pictures" %}">{% trans "All pictures" %}</a></span></h2>
                        <ul class="fullwidth">
                          {% for img in img_list %}
                            <li class="subcol subcol-half-fourth">
                                <a href="{% url 'annotate_picture' image_id=img.id %}">
                                <div class="center-image">
                                 {% with img.info.image_file as image %}
                                 {% if image %}
                                  {% if image|is_portrait %}
							 	    {% thumbnail image "x110" format="PNG" crop="center" as im %}
	                                  <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
	                                {% empty %}
	                                  <img src="{% static 'egonomy/img/empty.gif' %}" width="110" height="110" class="placeholder" />
	                                {% endthumbnail %}
	                              {% else %}
                                    {% thumbnail image "110" format="PNG" crop="center" as im %}
                                      <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
                                    {% empty %}
                                      <img src="{% static 'egonomy/img/empty.gif' %}" width=110" height="110" class="placeholder" />
                                    {% endthumbnail %}
	                              {% endif %}
	                             {% else %}
	                                  <img src="{% static 'egonomy/img/empty.gif' %}" width=110" height="110" class="placeholder" />
	                             {% endif %}
	                             {% endwith %}
                                </div>
                                <h3>{% if img.metadata.titre %}{{ img.metadata.titre }}{% else %}({% trans "No title" %}){% endif %}</h3></a>
                                <p>{% trans "Author" %}&nbsp;: <strong>{% if img.metadata.auteur %}{{ img.metadata.auteur }}{% else %}({% trans "Not documented" %}){% endif %}</strong></p>
                            </li>
                          {% endfor %}
                        </ul>
                    </div>
                    <!-- Liste des derniers fragments modifiés -->
                    <div class="column column-half">
                        <h2>{% trans "Last created fragments" %}
                            <span class="right"><a href="{% url 'all_fragments' %}" alt="{% trans "All fragments" %}">{% trans "All fragments" %}</a></span></h2>
                        <ul class="fullwidth">
                          {% for frg in fragment_list %}
                            <li class="subcol subcol-half-fourth">
                                <a href="{% url 'view_fragment' fragment_pk=frg.pk %}">
                                <div class="center-image">
                                    <div class="image-and-fragment">
                                     {% if frg.image %}
                                      {% with frg.image.info.image_file as image %}
		                              {% if image|is_portrait %}
		                               {% thumbnail image "x110" format="PNG" crop="center" as im %}
		                                <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
		                               {% empty %}
		                                <img src="{% static 'egonomy/img/empty.gif' %}" width="110" height="110" class="placeholder" />
		                               {% endthumbnail %}
		                              {% else %}
		                               {% thumbnail image "110" format="PNG" crop="center" as im %}
		                                <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
		                               {% empty %}
		                                <img src="{% static 'egonomy/img/empty.gif' %}" width=110" height="110" class="placeholder" />
		                               {% endthumbnail %}
		                              {% endif %}
		                              {% endwith %}
		                             {% else %}
		                                <img src="{% static 'egonomy/img/empty.gif' %}" width=110" height="110" class="placeholder" />
		                             {% endif %}
                                        <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 1 1" preserveAspectRatio="none">
                                            <path d="{{ frg.coordinates }}" stroke="red" stroke-width=".02" fill="red" fill-opacity=".3" />
                                        </svg>
                                    </div>
                                </div>
                                <h3>{{ frg.title }}</h3></a>
                                <h4>{% trans "Fragment from" %} <a href="{% url 'annotate_picture' image_id=frg.image.id %}">{% if frg.image.metadata.titre %}{{ frg.image.metadata.titre }}{% else %}({% trans "No title" %}){% endif %}</a></h4>
                                <p>{% trans "Annotated by" %} <strong>{{ frg.author }}</strong></p>
                            </li>
                          {% endfor %}
                        </ul>
                    </div>
                </div>
{% endblock %}