Exemplo n.º 1
0
    def render_settingsLink(self, ctx, data):
        """
        Add the URL of the settings page to the given tag.

        @see L{xmantissa.webnav.settingsLink}
        """
        return settingsLink(self.translator, self.pageComponents.settings,
                            ctx.tag)
Exemplo n.º 2
0
    def render_settingsLink(self, ctx, data):
        """
        Add the URL of the settings page to the given tag.

        @see L{xmantissa.webnav.settingsLink}
        """
        return settingsLink(
            self.translator, self.pageComponents.settings, ctx.tag)
Exemplo n.º 3
0
 def render_settingsLink(self, ctx, data):
     """
     For authenticated users, add the URL of the settings page to the given
     tag.  For unauthenticated users, remove the given tag from the output.
     """
     if self.username is None:
         return ''
     translator = self._getViewerPrivateApplication()
     return settingsLink(translator,
                         translator.getPageComponents().settings, ctx.tag)
Exemplo n.º 4
0
 def test_settingsLink(self):
     """
     L{settingsLink} should add a link to the settings item supplied as a
     child of the tag supplied.
     """
     self.storeID = 123
     node = tags.span()
     tag = webnav.settingsLink(FakeTranslator(), self, node)
     self.assertEqual(tag.tagName, 'span')
     self.assertEqual(tag.children, ['/link/123'])
Exemplo n.º 5
0
 def test_settingsLink(self):
     """
     L{settingsLink} should add a link to the settings item supplied as a
     child of the tag supplied.
     """
     self.storeID = 123
     node = tags.span()
     tag = webnav.settingsLink(FakeTranslator(), self, node)
     self.assertEqual(tag.tagName, "span")
     self.assertEqual(tag.children, ["/link/123"])
Exemplo n.º 6
0
 def render_settingsLink(self, ctx, data):
     """
     For authenticated users, add the URL of the settings page to the given
     tag.  For unauthenticated users, remove the given tag from the output.
     """
     if self.username is None:
         return ''
     translator = self._getViewerPrivateApplication()
     return settingsLink(
         translator,
         translator.getPageComponents().settings,
         ctx.tag)