kopia lustrzana https://github.com/wagtail/wagtail
Removing need for an image rendition required by wagtail out the box, by reusing and shrinking another.
rodzic
928bc0d25f
commit
575dc2fa81
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -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,
|
||||
|
|
Ładowanie…
Reference in New Issue