# HG changeset patch # User Thierry Florac # Date 1520762660 -3600 # Node ID 5f2a36c93535117e231fae5f7737a04dc7c3e2fa # Parent 5c9edb0450326decaea9bd2652f875eea471201d Reorganized ZMI modules diff -r 5c9edb045032 -r 5f2a36c93535 src/pyams_portal/portlets/content/__init__.py --- a/src/pyams_portal/portlets/content/__init__.py Sun Mar 11 11:03:46 2018 +0100 +++ b/src/pyams_portal/portlets/content/__init__.py Sun Mar 11 11:04:20 2018 +0100 @@ -19,7 +19,7 @@ from .interfaces import IContentPortletSettings from pyams_portal.interfaces import IPortletRenderer, IPortalContext from pyams_skin.layer import IPyAMSLayer -from pyams_utils.interfaces import PUBLIC_PERMISSION +from pyams_utils.interfaces import VIEW_PERMISSION # import packages from pyams_portal.portlet import PortletSettings, Portlet, PortletRenderer, portlet_config @@ -38,7 +38,7 @@ """Content portlet persistent settings""" -@portlet_config(permission=PUBLIC_PERMISSION) +@portlet_config(permission=VIEW_PERMISSION) class ContentPortlet(Portlet): """Content portlet""" diff -r 5c9edb045032 -r 5f2a36c93535 src/pyams_portal/portlets/content/zmi/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_portal/portlets/content/zmi/__init__.py Sun Mar 11 11:04:20 2018 +0100 @@ -0,0 +1,52 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_pagelet.interfaces import IPagelet +from pyams_portal.interfaces import IPortletPreviewer +from pyams_portal.portlets.content.interfaces import IContentPortletSettings +from pyams_skin.layer import IPyAMSLayer +from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION + +# import packages +from pyams_form.form import AJAXEditForm +from pyams_pagelet.pagelet import pagelet_config +from pyams_portal.portlet import PortletPreviewer +from pyams_portal.zmi.portlet import PortletSettingsEditor +from pyams_template.template import template_config +from pyams_utils.adapter import adapter_config +from zope.interface import Interface + + +@pagelet_config(name='properties.html', context=IContentPortletSettings, request_type=IPyAMSLayer, + permission=VIEW_SYSTEM_PERMISSION) +class ContentPortletSettingsEditor(PortletSettingsEditor): + """Content portlet settings editor""" + + settings = IContentPortletSettings + + +@adapter_config(name='properties.json', context=(IContentPortletSettings, IPyAMSLayer), provides=IPagelet) +class ContentPortletConfigurationAJAXEditor(AJAXEditForm, ContentPortletSettingsEditor): + """Content portlet settings editor, AJAX renderer""" + + +@adapter_config(context=(Interface, IPyAMSLayer, Interface, IContentPortletSettings), + provides=IPortletPreviewer) +@template_config(template='preview.pt', layer=IPyAMSLayer) +class ContentPortletPreviewer(PortletPreviewer): + """Content portlet previewer""" diff -r 5c9edb045032 -r 5f2a36c93535 src/pyams_portal/portlets/content/zmi/preview.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_portal/portlets/content/zmi/preview.pt Sun Mar 11 11:04:20 2018 +0100 @@ -0,0 +1,11 @@ + + This is my preview !! + +
+ + + + +
+
+
diff -r 5c9edb045032 -r 5f2a36c93535 src/pyams_portal/portlets/image/__init__.py --- a/src/pyams_portal/portlets/image/__init__.py Sun Mar 11 11:03:46 2018 +0100 +++ b/src/pyams_portal/portlets/image/__init__.py Sun Mar 11 11:04:20 2018 +0100 @@ -20,7 +20,7 @@ from pyams_file.interfaces import IResponsiveImage, DELETED_FILE from pyams_portal.interfaces import IPortalContext, IPortletRenderer from pyams_skin.layer import IPyAMSLayer -from pyams_utils.interfaces import PUBLIC_PERMISSION +from pyams_utils.interfaces import VIEW_PERMISSION # import packages from pyams_file.property import FileProperty @@ -52,7 +52,7 @@ alsoProvides(self._image, IResponsiveImage) -@portlet_config(permission=PUBLIC_PERMISSION) +@portlet_config(permission=VIEW_PERMISSION) class ImagePortlet(Portlet): """Image portlet""" diff -r 5c9edb045032 -r 5f2a36c93535 src/pyams_portal/portlets/image/zmi/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_portal/portlets/image/zmi/__init__.py Sun Mar 11 11:04:20 2018 +0100 @@ -0,0 +1,51 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_pagelet.interfaces import IPagelet +from pyams_portal.interfaces import IPortletPreviewer +from pyams_portal.portlets.image.interfaces import IImagePortletSettings +from pyams_skin.layer import IPyAMSLayer +from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION + +# import packages +from pyams_form.form import AJAXEditForm +from pyams_pagelet.pagelet import pagelet_config +from pyams_portal.portlet import PortletPreviewer +from pyams_portal.zmi.portlet import PortletSettingsEditor +from pyams_template.template import template_config +from pyams_utils.adapter import adapter_config +from zope.interface import Interface + + +@pagelet_config(name='properties.html', context=IImagePortletSettings, request_type=IPyAMSLayer, + permission=VIEW_SYSTEM_PERMISSION) +class ImagePortletSettingsEditor(PortletSettingsEditor): + """Image portlet settings editor""" + + settings = IImagePortletSettings + + +@adapter_config(name='properties.json', context=(IImagePortletSettings, IPyAMSLayer), provides=IPagelet) +class ImagePortletConfigurationAJAXEditor(AJAXEditForm, ImagePortletSettingsEditor): + """Image portlet settings editor, AJAX renderer""" + + +@adapter_config(context=(Interface, IPyAMSLayer, Interface, IImagePortletSettings), provides=IPortletPreviewer) +@template_config(template='preview.pt', layer=IPyAMSLayer) +class ImagePortletPreviewer(PortletPreviewer): + """Image portlet previewer""" diff -r 5c9edb045032 -r 5f2a36c93535 src/pyams_portal/portlets/image/zmi/preview.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_portal/portlets/image/zmi/preview.pt Sun Mar 11 11:04:20 2018 +0100 @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+ +
+ + + + +
+
+
diff -r 5c9edb045032 -r 5f2a36c93535 src/pyams_portal/zmi/portlets/__init__.py --- a/src/pyams_portal/zmi/portlets/__init__.py Sun Mar 11 11:03:46 2018 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -# -# Copyright (c) 2008-2015 Thierry Florac -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE. -# - -__docformat__ = 'restructuredtext' - - -# import standard library - -# import interfaces - -# import packages diff -r 5c9edb045032 -r 5f2a36c93535 src/pyams_portal/zmi/portlets/content.py --- a/src/pyams_portal/zmi/portlets/content.py Sun Mar 11 11:03:46 2018 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -# -# Copyright (c) 2008-2015 Thierry Florac -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE. -# - -__docformat__ = 'restructuredtext' - - -# import standard library - -# import interfaces -from pyams_pagelet.interfaces import IPagelet -from pyams_portal.interfaces import IPortletPreviewer -from pyams_portal.portlets.content.interfaces import IContentPortletSettings -from pyams_skin.layer import IPyAMSLayer -from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION - -# import packages -from pyams_form.form import AJAXEditForm -from pyams_pagelet.pagelet import pagelet_config -from pyams_portal.portlet import PortletPreviewer -from pyams_portal.zmi.portlet import PortletSettingsEditor -from pyams_template.template import template_config -from pyams_utils.adapter import adapter_config -from zope.interface import Interface - - -@pagelet_config(name='properties.html', context=IContentPortletSettings, request_type=IPyAMSLayer, - permission=VIEW_SYSTEM_PERMISSION) -class ContentPortletSettingsEditor(PortletSettingsEditor): - """Content portlet settings editor""" - - settings = IContentPortletSettings - - -@adapter_config(name='properties.json', context=(IContentPortletSettings, IPyAMSLayer), provides=IPagelet) -class ContentPortletConfigurationAJAXEditor(AJAXEditForm, ContentPortletSettingsEditor): - """Content portlet settings editor, AJAX renderer""" - - -@adapter_config(context=(Interface, IPyAMSLayer, Interface, IContentPortletSettings), - provides=IPortletPreviewer) -@template_config(template='templates/context-preview.pt', layer=IPyAMSLayer) -class ContentPortletPreviewer(PortletPreviewer): - """Content portlet previewer""" diff -r 5c9edb045032 -r 5f2a36c93535 src/pyams_portal/zmi/portlets/image.py --- a/src/pyams_portal/zmi/portlets/image.py Sun Mar 11 11:03:46 2018 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -# -# Copyright (c) 2008-2015 Thierry Florac -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE. -# - -__docformat__ = 'restructuredtext' - - -# import standard library - -# import interfaces -from pyams_pagelet.interfaces import IPagelet -from pyams_portal.interfaces import IPortletPreviewer, IPortalPage, IPortalTemplate, IPortalTemplateConfiguration -from pyams_portal.portlets.image.interfaces import IImagePortletSettings -from pyams_skin.layer import IPyAMSLayer -from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION - -# import packages -from pyams_form.form import AJAXEditForm -from pyams_pagelet.pagelet import pagelet_config -from pyams_portal.portlet import PortletPreviewer -from pyams_portal.zmi.portlet import PortletSettingsEditor -from pyams_template.template import template_config -from pyams_utils.adapter import adapter_config -from zope.interface import Interface - - -@pagelet_config(name='properties.html', context=IImagePortletSettings, request_type=IPyAMSLayer, - permission=VIEW_SYSTEM_PERMISSION) -class ImagePortletSettingsEditor(PortletSettingsEditor): - """Image portlet settings editor""" - - settings = IImagePortletSettings - - -@adapter_config(name='properties.json', context=(IImagePortletSettings, IPyAMSLayer), provides=IPagelet) -class ImagePortletConfigurationAJAXEditor(AJAXEditForm, ImagePortletSettingsEditor): - """Image portlet settings editor, AJAX renderer""" - - -@adapter_config(context=(Interface, IPyAMSLayer, Interface, IImagePortletSettings), provides=IPortletPreviewer) -@template_config(template='templates/image-preview.pt', layer=IPyAMSLayer) -class ImagePortletPreviewer(PortletPreviewer): - """Image portlet previewer""" diff -r 5c9edb045032 -r 5f2a36c93535 src/pyams_portal/zmi/portlets/templates/context-preview.pt --- a/src/pyams_portal/zmi/portlets/templates/context-preview.pt Sun Mar 11 11:03:46 2018 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -This is my preview !! diff -r 5c9edb045032 -r 5f2a36c93535 src/pyams_portal/zmi/portlets/templates/image-preview.pt --- a/src/pyams_portal/zmi/portlets/templates/image-preview.pt Sun Mar 11 11:03:46 2018 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
-
-
- -
- - - - -
-
-