Added marker interface to preview views
authorThierry Florac <thierry.florac@onf.fr>
Mon, 28 May 2018 16:37:43 +0200
changeset 34 39403a095ad4
parent 33 c8d86f2bd778
child 35 04e1d062b5f4
Added marker interface to preview views
src/pyams_default_theme/component/paragraph/__init__.py
src/pyams_default_theme/page.py
--- a/src/pyams_default_theme/component/paragraph/__init__.py	Fri May 25 08:07:03 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/__init__.py	Mon May 28 16:37:43 2018 +0200
@@ -17,16 +17,19 @@
 
 # import interfaces
 from pyams_content.component.paragraph.interfaces import IBaseParagraph
+from pyams_content.features.preview.interfaces import IPreviewView
 from pyams_default_theme.layer import IPyAMSDefaultLayer
 from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION
 
 # import packages
 from pyams_default_theme.page import BaseIndexPage
 from pyams_pagelet.pagelet import pagelet_config
+from zope.interface import implementer
 
 
 @pagelet_config(name='preview.html', context=IBaseParagraph, layer=IPyAMSDefaultLayer,
                 permission=VIEW_SYSTEM_PERMISSION)
+@implementer(IPreviewView)
 class ParagraphPreviewPage(BaseIndexPage):
     """Paragraph preview page"""
 
--- a/src/pyams_default_theme/page.py	Fri May 25 08:07:03 2018 +0200
+++ b/src/pyams_default_theme/page.py	Mon May 28 16:37:43 2018 +0200
@@ -16,7 +16,7 @@
 # import standard library
 
 # import interfaces
-from pyams_content.features.preview.interfaces import IPreviewTarget
+from pyams_content.features.preview.interfaces import IPreviewTarget, IPreviewView
 from pyams_content.features.renderer.interfaces import IContentRenderer
 from pyams_default_theme.layer import IPyAMSDefaultLayer
 from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION
@@ -24,6 +24,7 @@
 # import packages
 from pyams_pagelet.pagelet import pagelet_config
 from pyams_template.template import layout_config, template_config
+from zope.interface import implementer
 
 
 @pagelet_config(name='', layer=IPyAMSDefaultLayer)
@@ -35,6 +36,7 @@
 
 @pagelet_config(name='preview.html', context=IPreviewTarget, layer=IPyAMSDefaultLayer,
                 permission=VIEW_SYSTEM_PERMISSION)
+@implementer(IPreviewView)
 class PreviewPage(BaseIndexPage):
     """Preview page"""