Moved "content" portlet to PyAMS_content package
authorThierry Florac <tflorac@ulthar.net>
Sun, 10 Jun 2018 01:46:38 +0200
changeset 94 4d1da9093bd6
parent 93 4e15150a2521
child 95 b4e5117061d3
Moved "content" portlet to PyAMS_content package
src/pyams_portal/portlets/content/__init__.py
src/pyams_portal/portlets/content/interfaces.py
src/pyams_portal/portlets/content/skin/__init__.py
src/pyams_portal/portlets/content/skin/content.pt
src/pyams_portal/portlets/content/zmi/__init__.py
src/pyams_portal/portlets/content/zmi/preview.pt
--- 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 <tflorac AT ulthar.net>
-# 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
--- 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 <tflorac AT ulthar.net>
-# 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"""
--- 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 <tflorac AT ulthar.net>
-# 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")
--- 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 @@
-<h3>This is my context !!!</h3>
--- 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 <tflorac AT ulthar.net>
-# 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"""
--- 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 @@
-<tal:var define="settings view.settings">
-	<tal:if condition="settings.visible">This is my preview !!</tal:if>
-	<tal:if condition="not settings.visible">
-		<div class="text-center padding-y-5">
-			<span class="fa-stack fa-lg">
-				<i class="fa fa-eye fa-stack-1x"></i>
-				<i class="fa fa-ban fa-stack-2x text-danger"></i>
-			</span>
-		</div>
-	</tal:if>
-</tal:var>