Changed images actions view from IImageWidget to IMediaWidget
authorThierry Florac <thierry.florac@onf.fr>
Tue, 06 Feb 2018 13:58:18 +0100
changeset 83 c7bbe8806b93
parent 82 a4450d2886bf
child 84 de9acbfb3a65
Changed images actions view from IImageWidget to IMediaWidget
src/pyams_file/zmi/image.py
--- a/src/pyams_file/zmi/image.py	Tue Feb 06 13:57:26 2018 +0100
+++ b/src/pyams_file/zmi/image.py	Tue Feb 06 13:58:18 2018 +0100
@@ -20,8 +20,8 @@
 from collections import OrderedDict
 
 # import interfaces
-from pyams_file.interfaces import IImage, IThumbnail, IResponsiveImage, IImageWidget, IFileModifierForm, IThumbnailer, \
-    IFileInfo, IThumbnailForm
+from pyams_file.interfaces import IImage, IThumbnail, IResponsiveImage, IFileModifierForm, IThumbnailer, \
+    IFileInfo, IThumbnailForm, IMediaWidget
 from pyams_form.interfaces.form import IWidgetsPrefixViewletsManager, IFormHelp
 from pyams_skin.interfaces.viewlet import IContextActions
 from pyams_skin.layer import IPyAMSLayer
@@ -54,7 +54,7 @@
 # Image crop
 #
 
-@viewlet_config(name='image.crop.action', context=IImage, layer=IPyAMSLayer, view=IImageWidget,
+@viewlet_config(name='image.crop.action', context=IImage, layer=IPyAMSLayer, view=IMediaWidget,
                 manager=IContextActions, weight=21)
 class ImageCropAction(FileModifierAction):
     """Image crop action"""
@@ -152,7 +152,7 @@
     crop = button.Button(name='crop', title=_("Select thumbnail"))
 
 
-@viewlet_config(name='image.thumb.square.action', context=IImage, layer=IPyAMSLayer, view=IImageWidget,
+@viewlet_config(name='image.thumb.square.action', context=IImage, layer=IPyAMSLayer, view=IMediaWidget,
                 manager=IContextActions, weight=60)
 class ImageSquareThumbnailAction(FileModifierAction):
     """Square thumbnail image selection"""
@@ -235,7 +235,7 @@
 # Image panoramic thumbnail selection
 #
 
-@viewlet_config(name='image.thumb.pano.action', context=IImage, layer=IAdminLayer, view=IImageWidget,
+@viewlet_config(name='image.thumb.pano.action', context=IImage, layer=IAdminLayer, view=IMediaWidget,
                 manager=IContextActions, weight=65)
 class ImagePanoThumbnailAction(FileModifierAction):
     """Panoramic thumbnail image selection"""
@@ -374,7 +374,7 @@
 #
 
 @viewlet_config(name='responsive-image.selection.xs.action', context=IResponsiveImage, layer=IAdminLayer,
-                view=IImageWidget, manager=IContextActions, weight=41)
+                view=IMediaWidget, manager=IContextActions, weight=41)
 class ResponsiveImageXsSelectionAction(FileModifierAction):
     """Responsive image XS selection"""
 
@@ -415,7 +415,7 @@
 #
 
 @viewlet_config(name='responsive-image.selection.sm.action', context=IResponsiveImage, layer=IAdminLayer,
-                view=IImageWidget, manager=IContextActions, weight=42)
+                view=IMediaWidget, manager=IContextActions, weight=42)
 class ResponsiveImageSmSelectionAction(FileModifierAction):
     """Responsive image SM selection"""
 
@@ -456,7 +456,7 @@
 #
 
 @viewlet_config(name='responsive-image.selection.md.action', context=IResponsiveImage, layer=IAdminLayer,
-                view=IImageWidget, manager=IContextActions, weight=43)
+                view=IMediaWidget, manager=IContextActions, weight=43)
 class ResponsiveImageMdSelectionAction(FileModifierAction):
     """Responsive image MD selection"""
 
@@ -497,7 +497,7 @@
 #
 
 @viewlet_config(name='responsive-image.selection.lg.action', context=IResponsiveImage, layer=IAdminLayer,
-                view=IImageWidget, manager=IContextActions, weight=44)
+                view=IMediaWidget, manager=IContextActions, weight=44)
 class ResponsiveImageLgSelectionAction(FileModifierAction):
     """Responsive image LG selection"""
 
@@ -538,7 +538,7 @@
 #
 
 @viewlet_config(name='display-all-thumbnails.action', context=IImage, layer=IAdminLayer,
-                view=IImageWidget, manager=IContextActions, weight=80)
+                view=IMediaWidget, manager=IContextActions, weight=80)
 class ImageThumbnailsDisplayAction(ToolbarActionItem):
     """Image thumbnails display action"""
 
@@ -599,7 +599,7 @@
 # Image resize
 #
 
-@viewlet_config(name='image.resize.action', context=IImage, layer=IPyAMSLayer, view=IImageWidget,
+@viewlet_config(name='image.resize.action', context=IImage, layer=IPyAMSLayer, view=IMediaWidget,
                 manager=IContextActions, weight=90)
 class ImageResizeAction(FileModifierAction):
     """Image resize action"""