# HG changeset patch # User tflorac@dagon.home # Date 1541952695 -3600 # Node ID 3535b212a7a5a41a87c0bdab184af06016aed5f6 # Parent 1d23601f3db1262142cd5e0b09865522bf67598d Added banner thumbnail diff -r 1d23601f3db1 -r 3535b212a7a5 src/pyams_file/image.py --- a/src/pyams_file/image.py Wed Oct 24 16:34:49 2018 +0200 +++ b/src/pyams_file/image.py Sun Nov 11 17:11:35 2018 +0100 @@ -206,6 +206,16 @@ return round(ratio * thumb_size[0]), round(ratio * thumb_size[1]) +@adapter_config(name='banner', context=IImage, provides=IThumbnailer) +class ImageBannerThumbnailer(ImageRatioThumbnailer): + """Image banner thumbnail adapter""" + + label = _("Banner thumbnail") + weight = 8 + + ratio = (5, 1) + + class ResponsiveImageThumbnailer(ImageSelectionThumbnailer): """Responsive image thumbnailer""" diff -r 1d23601f3db1 -r 3535b212a7a5 src/pyams_file/zmi/image.py --- a/src/pyams_file/zmi/image.py Wed Oct 24 16:34:49 2018 +0200 +++ b/src/pyams_file/zmi/image.py Sun Nov 11 17:11:35 2018 +0100 @@ -459,6 +459,54 @@ # +# Image banner thumbnail selection +# + +@viewlet_config(name='image.thumb.banner.action', context=IImage, layer=IAdminLayer, view=IMediaWidget, + manager=IContextActions, weight=70) +class ImageBannerThumbnailAction(FileModifierAction): + """Banner thumbnail image selection""" + + _label = _("Select banner thumbnail...") + + @property + def label(self): + return '