Example #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)
Example #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)
Example #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)
Example #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'])
Example #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"])
Example #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)