- Timestamp:
- 22 Apr 2011, 11:26:35 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py
r5961 r5966 14 14 from waeup.sirp.interfaces import IWAeUPObject 15 15 from waeup.sirp.browser.interfaces import ITheme 16 from waeup.sirp.browser.theming import get_all_themes 16 from waeup.sirp.browser.theming import get_all_themes, WAeUPThemeGray1 17 17 18 18 grok.templatedir('templates') … … 99 99 grok.context(IWAeUPObject) 100 100 101 #: An instance of the default theme to use for the site layout 102 default_theme = WAeUPThemeGray1() 103 101 104 @property 102 105 def site(self): … … 127 130 128 131 def update(self): 129 theme_name = getattr(grok.getSite(), 'skin', 'gray waeup theme') 130 theme = getUtility(ITheme, name=theme_name) 132 """Include the resources required by the chosen skin/theme. 133 134 University instances provide a 'skin' attribute, that should 135 hold the internal name of a theme. 136 137 A theme in the waeup.sirp sense consists of a list of 138 CSS/JavaScript resources defined in the 139 :mod:`waeup.sirp.browser.resources` module. 140 141 If the context University object has no such attribute or the 142 set value is not a valid theme name, we pick 'gray waeup 143 theme' as default. 144 """ 145 theme_name = getattr(grok.getSite(), 'skin', '') 146 theme = queryUtility(ITheme, name=theme_name, 147 default=self.default_theme) 131 148 for resource in theme.getResources(): 132 149 resource.need()
Note: See TracChangeset for help on using the changeset viewer.