コード例 #1
0
    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())
コード例 #2
0
ファイル: logo.py プロジェクト: FHNW/plonetheme.onegov
    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())
コード例 #3
0
    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
コード例 #4
0
    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
コード例 #5
0
    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
コード例 #6
0
    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
コード例 #7
0
ファイル: meta.py プロジェクト: seantis/plonetheme.onegov
 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
コード例 #8
0
ファイル: meta.py プロジェクト: plone-ve/plonetheme.onegov
 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