Removing need for an image rendition required by wagtail out the box, by reusing and shrinking another.

pull/1822/head
Dave Cranwell 2015-10-13 17:32:30 +01:00
rodzic 928bc0d25f
commit 575dc2fa81
3 zmienionych plików z 15 dodań i 4 usunięć

Wyświetl plik

@ -871,8 +871,19 @@ ul.inline li:first-child, li.inline:first-child{
}
.preview-image{
float:left;
margin-left:-($thumbnail-width);
margin-right:1em;
margin-left: -($thumbnail-width);
margin-right: 1em;
max-width: $thumbnail-width;
// Resize standard Wagtail thumbnail size (165x165) to 130 for space-saving purposes.
// We could request a 130x130 rendition, but that's just unnecessary and burdens installations
// where images are store off-site with higher rendering times.
img{
max-width: $thumbnail-width;
max-height: $thumbnail-width;
height: auto;
width: auto;
}
}
}
}

Wyświetl plik

@ -6,7 +6,7 @@
{% block chosen_state_view %}
<div class="preview-image">
{% if image %}
{% image image max-130x130 %}
{% image image max-165x165 %}
{% else %}
<img>
{% endif %}

Wyświetl plik

@ -19,7 +19,7 @@ def get_image_json(image):
helper function: given an image, return the json to pass back to the
image chooser panel
"""
preview_image = image.get_rendition('max-130x100')
preview_image = image.get_rendition('max-165x165')
return json.dumps({
'id': image.id,