src/pyams_skin/interfaces/__init__.py
changeset 155 cd3ab32436f0
parent 133 00dd94c59eb0
child 156 b8b688fc964e
equal deleted inserted replaced
154:9802f640c418 155:cd3ab32436f0
    20 
    20 
    21 # import packages
    21 # import packages
    22 from pyams_template.template import layout_config
    22 from pyams_template.template import layout_config
    23 from zope.interface import implementer, Interface, Attribute
    23 from zope.interface import implementer, Interface, Attribute
    24 from zope.configuration.fields import GlobalInterface
    24 from zope.configuration.fields import GlobalInterface
    25 from zope.schema import Text, TextLine, Choice, Int
    25 from zope.schema import Text, TextLine, Choice, Int, Bool
    26 
    26 
    27 from pyams_skin import _
    27 from pyams_skin import _
    28 
    28 
    29 
    29 
    30 class ISkin(Interface):
    30 class ISkin(Interface):
    51 
    51 
    52 
    52 
    53 class ISkinnable(Interface):
    53 class ISkinnable(Interface):
    54     """Skinnable content interface"""
    54     """Skinnable content interface"""
    55 
    55 
       
    56     can_inherit_skin = Attribute("Check if skin can be inherited")
       
    57 
       
    58     inherit_skin = Bool(title=_("Inherit parent skin?"),
       
    59                         description=_("Should we reuse parent skin?"),
       
    60                         required=True,
       
    61                         default=False)
       
    62 
       
    63     skin_parent = Attribute("Skin parent (local or inherited)")
       
    64 
       
    65     skin = Choice(title=_("Presentation skin"),
       
    66                   description=_("This skin will be used to handle presentation templates"),
       
    67                   vocabulary='PyAMS user skins')
       
    68 
    56     def get_skin(self, request=None):
    69     def get_skin(self, request=None):
    57         """Get skin matching this content"""
    70         """Get skin matching this content"""
    58 
    71 
    59 
    72 
    60 class IUserSkinnable(ISkinnable):
    73 class IUserSkinnable(ISkinnable):
    61     """User skinnable content interface"""
    74     """User skinnable content interface"""
    62 
       
    63     skin = Choice(title=_("Presentation skin"),
       
    64                   description=_("This skin will be used to handle presentation templates"),
       
    65                   vocabulary='PyAMS skins')
       
    66 
    75 
    67 
    76 
    68 @layout_config(template='templates/fullpage-layout.pt', layer=IPyAMSLayer)
    77 @layout_config(template='templates/fullpage-layout.pt', layer=IPyAMSLayer)
    69 class IFullPage(Interface):
    78 class IFullPage(Interface):
    70     """Full page marker interface"""
    79     """Full page marker interface"""