src/pyams_content/shared/news/zmi/properties.py
changeset 114 7799437055f1
parent 113 05caef75bac3
child 115 67a6a3b92612
equal deleted inserted replaced
113:05caef75bac3 114:7799437055f1
     1 #
       
     2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
       
     3 # All Rights Reserved.
       
     4 #
       
     5 # This software is subject to the provisions of the Zope Public License,
       
     6 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
       
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
       
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
       
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
       
    10 # FOR A PARTICULAR PURPOSE.
       
    11 #
       
    12 
       
    13 __docformat__ = 'restructuredtext'
       
    14 
       
    15 
       
    16 # import standard library
       
    17 
       
    18 # import interfaces
       
    19 from pyams_content.shared.news.interfaces import IWfNewsEvent
       
    20 from pyams_form.interfaces.form import IInnerSubForm
       
    21 from pyams_skin.layer import IPyAMSLayer
       
    22 
       
    23 # import packages
       
    24 from pyams_content.shared.common.zmi.properties import SharedContentPropertiesEditForm
       
    25 from pyams_utils.adapter import adapter_config
       
    26 from pyams_zmi.form import InnerAdminEditForm
       
    27 from z3c.form import field
       
    28 
       
    29 from pyams_content import _
       
    30 
       
    31 
       
    32 @adapter_config(name='publication',
       
    33                 context=(IWfNewsEvent, IPyAMSLayer, SharedContentPropertiesEditForm),
       
    34                 provides=IInnerSubForm)
       
    35 class NewsEventPropertiesEditForm(InnerAdminEditForm):
       
    36     """News event properties edit form extension"""
       
    37 
       
    38     legend = _("Publication settings")
       
    39     fieldset_class = 'bordered no-x-margin margin-y-10'
       
    40 
       
    41     fields = field.Fields(IWfNewsEvent).select('displayed_publication_date', 'push_end_date')