Пример #1
0
    def render_applicationNavigation(self, ctx, data):
        """
        Add primary application navigation to the given tag.

        @see L{xmantissa.webnav.applicationNavigation}
        """
        return applicationNavigation(ctx, self.translator,
                                     self.pageComponents.navigation)
Пример #2
0
    def render_applicationNavigation(self, ctx, data):
        """
        Add primary application navigation to the given tag.

        @see L{xmantissa.webnav.applicationNavigation}
        """
        return applicationNavigation(
            ctx, self.translator, self.pageComponents.navigation)
Пример #3
0
    def _renderAppNav(self, tabs, template=None):
        """
        Render application navigation and return the resulting tag.

        @param template: a Tag containing a template for navigation.
        """
        if template is None:
            template = tags.span[tags.div(pattern="app-tab"), tags.div(pattern="tab-contents")]
        ctx = context.WebContext(tag=template)
        request = FakeRequest()
        ctx.remember(request)
        return webnav.applicationNavigation(ctx, FakeTranslator(), tabs)
Пример #4
0
    def render_applicationNavigation(self, ctx, data):
        """
        For authenticated users, add primary application navigation to the
        given tag.  For unauthenticated users, remove the given tag from the
        output.

        @see L{xmantissa.webnav.applicationNavigation}
        """
        if self.username is None:
            return ''
        translator = self._getViewerPrivateApplication()
        return applicationNavigation(ctx, translator,
                                     translator.getPageComponents().navigation)
Пример #5
0
    def _renderAppNav(self, tabs, template=None):
        """
        Render application navigation and return the resulting tag.

        @param template: a Tag containing a template for navigation.
        """
        if template is None:
            template = tags.span[
                tags.div(pattern='app-tab'),
                tags.div(pattern='tab-contents')]
        ctx = context.WebContext(tag=template)
        request = FakeRequest()
        ctx.remember(request)
        return webnav.applicationNavigation(ctx, FakeTranslator(), tabs)
Пример #6
0
    def render_applicationNavigation(self, ctx, data):
        """
        For authenticated users, add primary application navigation to the
        given tag.  For unauthenticated users, remove the given tag from the
        output.

        @see L{xmantissa.webnav.applicationNavigation}
        """
        if self.username is None:
            return ''
        translator = self._getViewerPrivateApplication()
        return applicationNavigation(
            ctx,
            translator,
            translator.getPageComponents().navigation)