# HG changeset patch # User Thierry Florac # Date 1528587998 -7200 # Node ID 4d1da9093bd684598548eb9d342f2afed7b8148b # Parent 4e15150a252184c742c58e9fd35813d316cd218e Moved "content" portlet to PyAMS_content package diff -r 4e15150a2521 -r 4d1da9093bd6 src/pyams_portal/portlets/content/__init__.py --- a/src/pyams_portal/portlets/content/__init__.py Tue Jun 05 14:58:17 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +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 .interfaces import IContentPortletSettings -from pyams_utils.interfaces import VIEW_PERMISSION - -# import packages -from pyams_portal.portlet import PortletSettings, Portlet, portlet_config -from zope.interface import implementer - -from pyams_portal import _ - - -CONTENT_PORTLET_NAME = 'pyams_portal.portlet.content' - - -@implementer(IContentPortletSettings) -class ContentPortletSettings(PortletSettings): - """Content portlet persistent settings""" - - -@portlet_config(permission=VIEW_PERMISSION) -class ContentPortlet(Portlet): - """Content portlet""" - - name = CONTENT_PORTLET_NAME - label = _("Context content") - - settings_class = ContentPortletSettings diff -r 4e15150a2521 -r 4d1da9093bd6 src/pyams_portal/portlets/content/interfaces.py --- a/src/pyams_portal/portlets/content/interfaces.py Tue Jun 05 14:58:17 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +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_portal.interfaces import IPortletSettings - -# import packages - - -class IContentPortletSettings(IPortletSettings): - """Content portlet settings interface""" diff -r 4e15150a2521 -r 4d1da9093bd6 src/pyams_portal/portlets/content/skin/__init__.py --- a/src/pyams_portal/portlets/content/skin/__init__.py Tue Jun 05 14:58:17 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -# -# Copyright (c) 2008-2018 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_portal.interfaces import IPortalContext, IPortletRenderer -from pyams_portal.portlets.content.interfaces import IContentPortletSettings -from pyams_skin.layer import IPyAMSLayer - -# import packages -from pyams_portal.portlet import PortletRenderer -from pyams_template.template import template_config -from pyams_utils.adapter import adapter_config -from zope.interface import Interface - -from pyams_portal import _ - - -@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, IContentPortletSettings), provides=IPortletRenderer) -@template_config(template='content.pt', layer=IPyAMSLayer) -class ContentPortletRenderer(PortletRenderer): - """Content portlet renderer""" - - label = _("Default content renderer") diff -r 4e15150a2521 -r 4d1da9093bd6 src/pyams_portal/portlets/content/skin/content.pt --- a/src/pyams_portal/portlets/content/skin/content.pt Tue Jun 05 14:58:17 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -

This is my context !!!

diff -r 4e15150a2521 -r 4d1da9093bd6 src/pyams_portal/portlets/content/zmi/__init__.py --- a/src/pyams_portal/portlets/content/zmi/__init__.py Tue Jun 05 14:58:17 2018 +0200 +++ /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='preview.pt', layer=IPyAMSLayer) -class ContentPortletPreviewer(PortletPreviewer): - """Content portlet previewer""" diff -r 4e15150a2521 -r 4d1da9093bd6 src/pyams_portal/portlets/content/zmi/preview.pt --- a/src/pyams_portal/portlets/content/zmi/preview.pt Tue Jun 05 14:58:17 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ - - This is my preview !! - -
- - - - -
-
-