Clean all_fragments template.
--- a/src/egonomy/static/egonomy/css/egonomy.css Wed Feb 27 18:43:52 2013 +0100
+++ b/src/egonomy/static/egonomy/css/egonomy.css Wed Feb 27 18:57:30 2013 +0100
@@ -242,6 +242,10 @@
position: relative; margin: 0 auto; display: inline-block;
}
+.little_square_fragment {
+ height: 110px; width: 110px;
+}
+
.center-image img {
display: inline-block;
}
--- a/src/egonomy/templates/egonomy_all_fragments.html Wed Feb 27 18:43:52 2013 +0100
+++ b/src/egonomy/templates/egonomy_all_fragments.html Wed Feb 27 18:57:30 2013 +0100
@@ -28,14 +28,11 @@
<li class="subcol subcol-eighth">
<a href="{% url 'view_fragment' fragment_pk=frg.pk %}">
<div class="center-image">
- <div class="image-and-fragment" style="width:110px; height:110px">
+ <div class="image-and-fragment little_square_fragment">
{% with frgmt=frg.object|default:frg %}{# frg.object in search case, frg otherwise #}
{% with image=frgmt.image.info.image_file %}
{% 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 }}" class="sub_svg_image"/-->
- <svg preserveAspectRatio="none" width="110px" height="110px" viewBox="{{ frgmt.viewbox_square }}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <svg preserveAspectRatio="none" width="100%" height="100%" viewBox="{{ frgmt.viewbox_square }}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<clipPath id="fragment-clip{{ frgmt.pk }}">
<path d="{{ frgmt.coordinates }}" />
@@ -44,9 +41,8 @@
<image xlink:href="{{ image.url }}" x="0" y="0" preserveAspectRatio="none" width="1" height="1" opacity=".3"/>
<image xlink:href="{{ image.url }}" x="0" y="0" preserveAspectRatio="none" width="1" height="1" clip-path="url(#fragment-clip{{ frgmt.pk }})"/>
</svg>
- {% empty %}
- <!--img src="{% static 'egonomy/img/empty.gif' %}" width="110" height="110" class="placeholder sub_svg_image" /-->
- <svg preserveAspectRatio="none" width="110" height="110" viewBox="0 0 1 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ {% else %}
+ <svg preserveAspectRatio="none" width="100%" height="100%" viewBox="0 0 1 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<clipPath id="fragment-clip{{ frgmt.pk }}">
<path d="{{ frgmt.coordinates }}" />
@@ -55,41 +51,6 @@
<image xlink:href="{% static 'egonomy/img/empty.gif' %}" x="0" y="0" preserveAspectRatio="none" width="1" height="1" opacity=".3"/>
<image xlink:href="{% static 'egonomy/img/empty.gif' %}" x="0" y="0" preserveAspectRatio="none" width="1" height="1" clip-path="url(#fragment-clip{{ frgmt.pk }})"/>
</svg>
- {% endthumbnail %}
- {% else %}
- {% thumbnail image "110" format="PNG" crop="center" as im %}
- <!--img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" class="sub_svg_image"/-->
- <svg preserveAspectRatio="none" width="110px" height="110px" viewBox="{{ frgmt.viewbox_square }}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
- <defs>
- <clipPath id="fragment-clip{{ frgmt.pk }}">
- <path d="{{ frgmt.coordinates }}" />
- </clipPath>
- </defs>
- <image xlink:href="{{ image.url }}" x="0" y="0" preserveAspectRatio="none" width="1" height="1" opacity=".3"/>
- <image xlink:href="{{ image.url }}" x="0" y="0" preserveAspectRatio="none" width="1" height="1" clip-path="url(#fragment-clip{{ frgmt.pk }})"/>
- </svg>
- {% empty %}
- <!--img src="{% static 'egonomy/img/empty.gif' %}" width="110" height="110" class="placeholder sub_svg_image" /-->
- <svg preserveAspectRatio="none" width="110" height="110" viewBox="0 0 1 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
- <defs>
- <clipPath id="fragment-clip{{ frgmt.pk }}">
- <path d="{{ frgmt.coordinates }}" />
- </clipPath>
- </defs>
- <image xlink:href="{% static 'egonomy/img/empty.gif' %}" x="0" y="0" preserveAspectRatio="none" width="1" height="1" clip-path="url(#fragment-clip{{ frgmt.pk }})"/>
- </svg>
- {% endthumbnail %}
- {% endif %}
- {% else %}
- <img src="{% static 'egonomy/img/empty.gif' %}" width="110" height="110" class="placeholder sub_svg_image" />
- <svg preserveAspectRatio="none" width="110" height="110" viewBox="0 0 1 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
- <defs>
- <clipPath id="fragment-clip{{ frgmt.pk }}">
- <path d="{{ frgmt.coordinates }}" />
- </clipPath>
- </defs>
- <image xlink:href="{% static 'egonomy/img/empty.gif' %}" x="0" y="0" preserveAspectRatio="none" width="1" height="1" clip-path="url(#fragment-clip{{ frgmt.pk }})"/>
- </svg>
{% endif %}
{% endwith %}
{% endwith %}