Exemplo n.º 1
0
    def __init__(self, webapp, fragment, pageComponents, username):
        """
        Top-level container for Mantissa application views.

        @param webapp: a C{PrivateApplication}.
        @param fragment: The C{Element} or C{Fragment} to display as content.
        @param pageComponents a C{_PageComponent}.

        This page draws its HTML from the 'shell' template in the preferred
        theme for the store.  If loaded in a browser that does not support
        Athena, the page provided by the 'athena-unsupported' template will be
        displayed instead.

        @see: L{PrivateApplication.preferredTheme}
        """
        userStore = webapp.store
        siteStore = userStore.parent

        MantissaLivePage.__init__(self,
                                  ISiteURLGenerator(siteStore),
                                  getattr(fragment, 'iface', None),
                                  fragment,
                                  jsModuleRoot=None,
                                  docFactory=webapp.getDocFactory('shell'))
        _ShellRenderingMixin.__init__(self, webapp, pageComponents, username)
        _FragmentWrapperMixin.__init__(self, fragment, pageComponents)
        self.unsupportedBrowserLoader = (
            webapp.getDocFactory("athena-unsupported"))
Exemplo n.º 2
0
    def __init__(self, webapp, fragment, pageComponents, username):
        """
        Top-level container for Mantissa application views.

        @param webapp: a C{PrivateApplication}.
        @param fragment: The C{Element} or C{Fragment} to display as content.
        @param pageComponents a C{_PageComponent}.

        This page draws its HTML from the 'shell' template in the preferred
        theme for the store.  If loaded in a browser that does not support
        Athena, the page provided by the 'athena-unsupported' template will be
        displayed instead.

        @see: L{PrivateApplication.preferredTheme}
        """
        userStore = webapp.store
        siteStore = userStore.parent

        MantissaLivePage.__init__(
            self, ISiteURLGenerator(siteStore),
            getattr(fragment, 'iface', None),
            fragment,
            jsModuleRoot=None,
            docFactory=webapp.getDocFactory('shell'))
        _ShellRenderingMixin.__init__(self, webapp, pageComponents, username)
        _FragmentWrapperMixin.__init__(self, fragment, pageComponents)
        self.unsupportedBrowserLoader = (webapp
                                         .getDocFactory("athena-unsupported"))