src/pyams_content/component/paragraph/portlet/interfaces/__init__.py
changeset 930 814f7c5e04d1
child 948 6d3438907215
equal deleted inserted replaced
929:1440d627e103 930:814f7c5e04d1
       
     1 #
       
     2 # Copyright (c) 2008-2018 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 packages
       
    19 from zope.schema import Bool, Set, Choice, List
       
    20 
       
    21 from pyams_content import _
       
    22 # import interfaces
       
    23 from pyams_content.component.paragraph.interfaces import PARAGRAPH_FACTORIES_VOCABULARY
       
    24 from pyams_portal.interfaces import IPortletSettings
       
    25 
       
    26 
       
    27 class IParagraphContainerPortletSettings(IPortletSettings):
       
    28     """Paragraphs container portlet settings interface"""
       
    29 
       
    30     paragraphs = List(title=_("Selected paragraphs"),
       
    31                       description=_("List of selected paragraphs; an empty selection means that "
       
    32                                     "all paragraphs will be selectable by following filters; otherwise, "
       
    33                                     "this selection will have priority"),
       
    34                       value_type=Choice(vocabulary='PyAMS content paragraphs'),
       
    35                       required=False)
       
    36 
       
    37     factories = Set(title=_("Paragraph types"),
       
    38                     description=_("Select list of paragraph types you want to include; an empty "
       
    39                                   "selection means that all paragraphs types will be selected"),
       
    40                     required=False,
       
    41                     value_type=Choice(vocabulary=PARAGRAPH_FACTORIES_VOCABULARY))
       
    42 
       
    43     anchors_only = Bool(title=_("Anchors only?"),
       
    44                         description=_("If 'yes', only paragraphs set as 'anchors' will be selected"),
       
    45                         required=True,
       
    46                         default=False)