src/egonomy/templates/partial/picture_and_red_fragment.html
author Anthony Ly <anthonyly.com@gmail.com>
Thu, 13 Jun 2013 11:24:40 +0200
changeset 115 a88246833732
parent 79 2a51570e986b
permissions -rw-r--r--
setup integration header

{% load static %}
{% load thumbnail %}
{% if fragment.image %}
 {% with fragment.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="{{ fragment.coordinates }}" stroke="red" stroke-width=".02" fill="red" fill-opacity=".3" />
   </svg>