mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-03-16 22:10:28 +00:00
Responsive emebed setting
This commit is contained in:
parent
7a92ca5ad9
commit
aefb0f9506
4 changed files with 7 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ Changelog
|
|||
* Add partial experimental support for nested InlinePanels (Matt Westcott, Sam Costigan, Andy Chosak, Scott Cranfill)
|
||||
* Added cache control headers when serving documents (Johannes Vogel)
|
||||
* Use `sensitive_post_parameters` on password reset form (Dan Braghis)
|
||||
* Add ``WAGTAIL_ENABLE_RESPONSIVE_EMBED`` setting to remove automatic addition of ``responsive-object`` around embeds (Kalob Taulien)
|
||||
* Fix: Rename documents listing column 'uploaded' to 'created' (LB (Ben Johnston))
|
||||
* Fix: Unbundle the l18n library as it was bundled to avoid installation errors which have been resolved (Matt Westcott)
|
||||
* Fix: Prevent error when comparing pages that reference a model with a custom primary key (Fidel Ramos)
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ Other features
|
|||
* Add partial experimental support for nested InlinePanels (Matt Westcott, Sam Costigan, Andy Chosak, Scott Cranfill)
|
||||
* Added cache control headers when serving documents (Johannes Vogel)
|
||||
* Use ``sensitive_post_parameters`` on password reset form (Dan Braghis)
|
||||
* Add ``WAGTAIL_ENABLE_RESPONSIVE_EMBED`` setting to remove automatic addition of ``responsive-object`` around embeds (Kalob Taulien)
|
||||
|
||||
|
||||
Bug fixes
|
||||
|
|
@ -124,7 +125,7 @@ New code:
|
|||
The ``get_document_model`` function should now be imported from ``wagtail.documents`` rather than ``wagtail.documents.models``. See :ref:`custom_document_model`.
|
||||
|
||||
|
||||
Removed ``Page`` and ``Site`` models from Django admin
|
||||
Removed ``Page`` and ``Site`` models from Django admin
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``Page`` and ``Site`` models are no longer editable through the Django admin backend. If required these models can be re-registered within your own project using `Django's ModelAdmin <https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#modeladmin-objects>`_:
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@ Wagtail includes embeds and images at their full width, which may overflow the b
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
It's possible to disable responsive embeds entirely by setting ``WAGTAIL_ENABLE_RESPONSIVE_EMBED = False`` in your settings. Normally, Wagtail wraps your embed links in a ``<div>`` element. If you decide to disable responsive embeds the ``<div>`` element around your embed will not be given a CSS class of ``responsive-object`` and there won't be an inline style in the same parent ``<div>`` element. This means the responsiveness of your embed is entirely up to you.
|
||||
|
||||
Internal links (tag)
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
|
@ -50,6 +51,8 @@ class Embed(models.Model):
|
|||
|
||||
@property
|
||||
def is_responsive(self):
|
||||
if not getattr(settings, 'WAGTAIL_ENABLE_RESPONSIVE_EMBED', True):
|
||||
return False
|
||||
return self.ratio is not None
|
||||
|
||||
def __str__(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue