58 inherit_skin = Bool(title=_("Inherit parent skin?"), |
58 inherit_skin = Bool(title=_("Inherit parent skin?"), |
59 description=_("Should we reuse parent skin?"), |
59 description=_("Should we reuse parent skin?"), |
60 required=True, |
60 required=True, |
61 default=False) |
61 default=False) |
62 |
62 |
|
63 no_inherit_skin = Bool(title=_("Don't inherit parent skin?"), |
|
64 description=_("Should we override parent skin?"), |
|
65 required=True, |
|
66 default=True) |
|
67 |
63 skin_parent = Attribute("Skin parent (local or inherited)") |
68 skin_parent = Attribute("Skin parent (local or inherited)") |
64 |
69 |
65 skin = Choice(title=_("Custom graphic theme"), |
70 skin = Choice(title=_("Custom graphic theme"), |
66 description=_("This theme will be used to handle graphic design (colors and images)"), |
71 description=_("This theme will be used to handle graphic design (colors and images)"), |
67 vocabulary='PyAMS user skins', |
72 vocabulary='PyAMS user skins', |
68 required=False) |
73 required=False) |
69 |
74 |
70 @invariant |
75 @invariant |
71 def check_skin(self): |
76 def check_skin(self): |
72 if not (self.skin or self.inherit_skin): |
77 if self.no_inherit_skin and not self.skin: |
73 raise Invalid(_("You must select a custom skin or inherit from parent!")) |
78 raise Invalid(_("You must select a custom skin or inherit from parent!")) |
74 |
79 |
75 def get_skin(self, request=None): |
80 def get_skin(self, request=None): |
76 """Get skin matching this content""" |
81 """Get skin matching this content""" |
77 |
82 |