Initial commit
This commit is contained in:
11
env/lib/python3.10/site-packages/wagtail/images/components.py
vendored
Normal file
11
env/lib/python3.10/site-packages/wagtail/images/components.py
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
from wagtail.admin.ui.fields import BaseFieldDisplay
|
||||
from wagtail.images.shortcuts import get_rendition_or_not_found
|
||||
|
||||
|
||||
class ImageDisplay(BaseFieldDisplay):
|
||||
rendition_spec = "max-400x400"
|
||||
|
||||
def render_html(self, parent_context):
|
||||
if self.value is None:
|
||||
return None
|
||||
return get_rendition_or_not_found(self.value, self.rendition_spec).img_tag()
|
||||
Reference in New Issue
Block a user