Merge branch 'davecranwell-unified-thumbnail-sizes'

This commit is contained in:
Matt Westcott 2015-10-13 22:46:15 +01:00
commit 657dd0e347
5 changed files with 17 additions and 4 deletions

View file

@ -20,6 +20,7 @@ Changelog
* Added spinner animations to long-running form submissions
* The EMBEDLY_KEY setting has been renamed to WAGTAILEMBEDS_EMBEDLY_KEY (Anurag Sharma)
* StreamField blocks are now added automatically, without showing the block types menu, if only one block type exists (Alex Gleason)
* Wagtail admin now standardises on a single thumbnail image size, to reduce the overhead of creating multiple renditions
* The `first_published_at` and `latest_revision_created_at` fields on page models are now available as filter fields on search queries
* Fix: Deleting a page permission from the groups admin UI does not immediately submit the form
* Fix: Wagtail userbar is shown on pages that do not pass a `page` variable to the template (e.g. because they override the `serve` method)

View file

@ -51,6 +51,7 @@ Minor features
* The EMBEDLY_KEY setting has been renamed to WAGTAILEMBEDS_EMBEDLY_KEY
* StreamField blocks are now added automatically, without showing the block types menu, if only one block type exists (Alex Gleason)
* The ``first_published_at`` and ``latest_revision_created_at`` fields on page models are now available as filter fields on search queries
* Wagtail admin now standardises on a single thumbnail image size, to reduce the overhead of creating multiple renditions
Bug fixes
~~~~~~~~~

View file

@ -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;
}
}
}
}

View file

@ -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 %}

View file

@ -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,