# HG changeset patch # User Thierry Florac # Date 1507876875 -7200 # Node ID dabf155776a9530c01cfbc213669b83bd6f417bb # Parent c9e2d01b0f8b444ccd1f147e0d8fbaca6894be88 Updated preview management diff -r c9e2d01b0f8b -r dabf155776a9 src/pyams_content/shared/imagemap/zmi/preview.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/zmi/preview.py Fri Oct 13 08:41:15 2017 +0200 @@ -0,0 +1,39 @@ +# +# 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_content.component.association.interfaces import IAssociationInfo +from pyams_content.shared.common.interfaces.zmi import IPreviewForm +from pyams_content.shared.imagemap.interfaces import IWfImageMap +from pyams_form.interfaces.form import IWidgetsSuffixViewletsManager +from pyams_skin.layer import IPyAMSLayer +from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION + +# import packages +from pyams_template.template import template_config +from pyams_viewlet.viewlet import viewlet_config + + +@viewlet_config(name='imagemap-preview', context=IWfImageMap, layer=IPyAMSLayer, + view=IPreviewForm, manager=IWidgetsSuffixViewletsManager, + permission=VIEW_SYSTEM_PERMISSION, weight=100) +@template_config(template='templates/preview.pt', layer=IPyAMSLayer) +class ImagemapPreview(object): + """Image map preview""" + + def get_item_info(self, item): + return IAssociationInfo(item, None) diff -r c9e2d01b0f8b -r dabf155776a9 src/pyams_content/shared/imagemap/zmi/summary.py --- a/src/pyams_content/shared/imagemap/zmi/summary.py Fri Oct 13 08:40:13 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +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_content.component.association.interfaces import IAssociationContainer, IAssociationInfo -from pyams_content.shared.common.interfaces.zmi import IInnerSummaryView -from pyams_content.shared.imagemap.interfaces import IWfImageMap -from pyams_form.interfaces.form import IInnerTabForm -from pyams_skin.layer import IPyAMSLayer -from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION - -# import packages -from pyams_content.shared.common.zmi.summary import SharedContentSummaryForm -from pyams_pagelet.pagelet import pagelet_config -from pyams_template.template import template_config -from pyams_utils.adapter import adapter_config -from pyams_zmi.form import InnerAdminDisplayForm -from zope.interface import implementer - -from pyams_content import _ - - -@adapter_config(name='imagemap-summary', - context=(IWfImageMap, IPyAMSLayer, SharedContentSummaryForm), - provides=IInnerTabForm) -class ImagemapSummary(InnerAdminDisplayForm): - """Image map summary view access tab""" - - weight = 20 - tab_label = _("Quick preview") - tab_target = 'imagemap-summary.html' - - -@pagelet_config(name='imagemap-summary.html', context=IWfImageMap, layer=IPyAMSLayer, - permission=VIEW_SYSTEM_PERMISSION) -@template_config(template='templates/summary.pt', layer=IPyAMSLayer) -@implementer(IInnerSummaryView) -class ImagemapSummaryView(object): - """Image map summary view""" - - def get_item_info(self, item): - return IAssociationInfo(item, None) diff -r c9e2d01b0f8b -r dabf155776a9 src/pyams_content/shared/imagemap/zmi/templates/preview.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/imagemap/zmi/templates/preview.pt Fri Oct 13 08:41:15 2017 +0200 @@ -0,0 +1,23 @@ +
+ + + + + + + + +
diff -r c9e2d01b0f8b -r dabf155776a9 src/pyams_content/shared/imagemap/zmi/templates/summary.pt --- a/src/pyams_content/shared/imagemap/zmi/templates/summary.pt Fri Oct 13 08:40:13 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -
-
- Image areas preview -
- - - - - - - - -
-
-