Fix: remove responsive behavior in embed when there is no ratio available

pull/3083/head
Gagaro 2016-10-08 09:28:30 +02:00 zatwierdzone przez Matt Westcott
rodzic 49421e5a41
commit 1d33cc7838
4 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -9,6 +9,7 @@ Changelog
* Added `Page.get_admin_display_title` method to override how the title is displayed in the admin (Henk-Jan van Hasselaar)
* Fix: `AbstractForm` now respects custom `get_template` methods on the page model (Gagaro)
* Fix: Use specific page model for the parent page in the explore index (Gagaro)
* Fix: Remove responsive styles in embed when there is no ratio available (Gagaro)
1.7 (xx.xx.xxxx) - IN DEVELOPMENT

Wyświetl plik

@ -24,6 +24,7 @@ Bug fixes
* ``AbstractForm`` now respects custom ``get_template`` methods on the page model (Gagaro)
* Use specific page model for the parent page in the explore index (Gagaro)
* Remove responsive styles in embed when there is no ratio available (Gagaro)
Upgrade considerations

Wyświetl plik

@ -15,7 +15,7 @@ def embed_to_frontend_html(url):
if embed.width and embed.height:
ratio = str(embed.height / embed.width * 100) + "%"
else:
ratio = "0"
ratio = None
# Render template
return render_to_string('wagtailembeds/embed_frontend.html', {

Wyświetl plik

@ -1,3 +1,3 @@
<div style="padding-bottom: {{ ratio }};" class="responsive-object">
<div{% if not ratio is None %} style="padding-bottom: {{ ratio }};" class="responsive-object"{% endif %}>
{{ embed.html|safe }}
</div>