def onegov_logo_behaviour(self): portal = getToolByName(self.context, 'portal_url').getPortalObject() url = "%s/++theme++plonetheme.onegov/images/logo_onegov.png" % \ portal.absolute_url() annotations = IAnnotations( self.context.restrictedTraverse(getNavigationRoot(self.context))) customstyles = annotations.get('onegov.customstyles', OOBTree({})) if 'img.logo' in customstyles and len(customstyles['img.logo']): url = replace_custom_keywords(customstyles['img.logo'], self.context) self.logo_tag = "<img src='%s' alt='%s Logo' />" % (url, portal.Title())
def onegov_logo_behaviour(self): portal = getToolByName(self.context, 'portal_url').getPortalObject() url = "%s/++theme++plonetheme.onegov/images/logo_onegov.png" % \ portal.absolute_url() annotations = IAnnotations(self.context.restrictedTraverse( getNavigationRoot(self.context))) customstyles = annotations.get('onegov.customstyles', OOBTree({})) if 'img.logo' in customstyles and len(customstyles['img.logo']): url = replace_custom_keywords(customstyles['img.logo'], self.context) self.logo_tag = "<img src='%s' alt='%s Logo' />" % ( url, portal.Title())
def generate_css(self): css = Scss() scss_input = ['@option style:compressed;'] # add variables scss_input.append(self.read_file('variables.scss')) # add overwritten variables scss_input.append(self.get_options().encode('utf8')) # add component files for scss_file in SCSS_FILES: scss_input.append(self.read_file(scss_file)) # add overwritten component files # for now its not possible to add custom styles styles = css.compile('\n'.join(scss_input)) styles = replace_custom_keywords(styles, self.context) return styles
def generate_css(self): css = Scss() scss_input = ['@option style:compressed;'] # add variables scss_input.append(self.read_file('variables.scss')) # add overwritten variables scss_input.append(self.get_options().encode('utf8')) # add component files registry = getUtility(ISCSSRegistry) for path in registry.get_files(self.context, self.request): with open(path, 'r') as file_: scss_input.append(file_.read()) # add overwritten component files # for now its not possible to add custom styles styles = css.compile('\n'.join(scss_input)) styles = replace_custom_keywords(styles, self.context) return styles
def customstyle_value(self, name): if name in self.customstyles and len(self.customstyles[name]): return replace_custom_keywords(self.customstyles[name], self.context) return None