Esempio n. 1
0
    def test_getInstalledThemes(self):
        """
        Test that only themes which belong to offerings installed on a
        particular store are returned by
        L{xmantissa.webtheme.getInstalledThemes}.
        """
        s = Store()
        self.assertEquals(getInstalledThemes(s), [])

        installOffering(s, baseOffering, {})

        installedThemes = getInstalledThemes(s)
        self.assertEquals(len(installedThemes), 1)
        self.failUnless(isinstance(installedThemes[0], MantissaTheme))
Esempio n. 2
0
    def test_getInstalledThemes(self):
        """
        Test that only themes which belong to offerings installed on a
        particular store are returned by
        L{xmantissa.webtheme.getInstalledThemes}.
        """
        s = Store()
        self.assertEquals(getInstalledThemes(s), [])

        installOffering(s, baseOffering, {})

        installedThemes = getInstalledThemes(s)
        self.assertEquals(len(installedThemes), 1)
        self.failUnless(isinstance(installedThemes[0], MantissaTheme))
Esempio n. 3
0
 def getHeadContent(self, req):
     """
     Retrieve a list of header content from all installed themes on the site
     store.
     """
     site = ixmantissa.ISiteURLGenerator(self.store)
     for t in getInstalledThemes(self.store):
         yield t.head(req, site)
Esempio n. 4
0
 def getHeadContent(self, req):
     """
     Retrieve a list of header content from all installed themes on the site
     store.
     """
     site = ixmantissa.ISiteURLGenerator(self.store)
     for t in getInstalledThemes(self.store):
         yield t.head(req, site)
Esempio n. 5
0
 def __init__(self, siteStore):
     """
     Create an L{_AnonymousWebViewer} for browsing a given site store.
     """
     WebViewerHelper.__init__(self,
                              SiteTemplateResolver(siteStore).getDocFactory,
                              lambda: getInstalledThemes(siteStore))
     self._siteStore = siteStore
Esempio n. 6
0
 def _preferredThemes(self):
     """
     Return a list of themes in the order of preference that this user has
     selected via L{PrivateApplication.preferredTheme}.
     """
     themes = getInstalledThemes(self.store.parent)
     _reorderForPreference(themes, self.preferredTheme)
     return themes
Esempio n. 7
0
 def _preferredThemes(self):
     """
     Return a list of themes in the order of preference that this user has
     selected via L{PrivateApplication.preferredTheme}.
     """
     themes = getInstalledThemes(self.store.parent)
     _reorderForPreference(themes, self.preferredTheme)
     return themes
Esempio n. 8
0
 def __init__(self, siteStore):
     """
     Create an L{_AnonymousWebViewer} for browsing a given site store.
     """
     WebViewerHelper.__init__(
         self,
         SiteTemplateResolver(siteStore).getDocFactory,
         lambda : getInstalledThemes(siteStore))
     self._siteStore = siteStore
Esempio n. 9
0
    def getPageComponents(self):
        navigation = getTabs(self.store.powerupsFor(INavigableElement))

        staticShellContent = IStaticShellContent(self.store, None)

        return _PageComponents(navigation, self.searchAggregator,
                               staticShellContent,
                               self.store.findFirst(PreferenceAggregator),
                               getInstalledThemes(self.store.parent))
Esempio n. 10
0
    def getPageComponents(self):
        navigation = getTabs(self.store.powerupsFor(INavigableElement))

        staticShellContent = IStaticShellContent(self.store, None)

        return _PageComponents(navigation,
                               self.searchAggregator,
                               staticShellContent,
                               self.store.findFirst(PreferenceAggregator),
                               getInstalledThemes(self.store.parent))