src/pyams_content/shared/news/zmi/properties.py
changeset 0 7c0001cacf8e
child 16 8c652535a9a2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_content/shared/news/zmi/properties.py	Thu Oct 08 13:37:29 2015 +0200
@@ -0,0 +1,43 @@
+#
+# 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_content.shared.news.interfaces import IWfNewsEvent
+from pyams_form.interfaces.form import IInnerSubForm
+from pyams_skin.layer import IPyAMSLayer
+
+# import packages
+from pyams_content.shared.common.zmi.properties import SharedContentPropertiesEditForm
+from pyams_form.form import InnerEditForm
+from pyams_utils.adapter import adapter_config
+from z3c.form import field
+from zope.interface import implementer
+
+from pyams_content import _
+
+
+@adapter_config(name='publication',
+                context=(IWfNewsEvent, IPyAMSLayer, SharedContentPropertiesEditForm),
+                provides=IInnerSubForm)
+@implementer(IInnerSubForm)
+class NewsEventPropertiesEditForm(InnerEditForm):
+    """News event properties edit form extension"""
+
+    legend = _("Publication settings")
+    fieldset_class = 'bordered no-x-margin margin-y-10'
+
+    fields = field.Fields(IWfNewsEvent).select('displayed_publication_date', 'push_end_date')