import zope.interface from z3c.pagelet.browser import BrowserPagelet from zope.viewlet.manager import ViewletManager, WeightOrderedViewletManager from quotationtool.skin import interfaces class DiagnosticsPagelet(BrowserPagelet): """ A pagelet that shows some diagnostic info on the running instance and calls the diagnostics viewlet manager that shows more info provided by viewlets in quotationtool.* packages. """ zope.interface.implements(interfaces.IDiagnosticsPagelet) DiagnosticsManager = ViewletManager('diagnostics', interfaces.IDiagnostics, bases=(WeightOrderedViewletManager, ))
import zope.interface from z3c.menu.ready2go.item import SiteMenuItem from zope.viewlet.manager import ViewletManager from z3c.menu.ready2go import ISiteMenu, IContextMenu from z3c.menu.ready2go.manager import MenuManager from z3c.menu.ready2go.interfaces import IMenuManager from quotationtool.skin.interfaces import IMainNav, ISubNavManager from quotationtool.skin.browser.nav import MainNavItem class ICategoriesContainerMainNavItem(zope.interface.Interface): pass class CategoriesContainerMainNavItem(MainNavItem): zope.interface.implements(ICategoriesContainerMainNavItem) class ICategorizationSubNav(ISubNavManager): pass CategorizationSubNav = ViewletManager('categorizationsubnav', ISiteMenu, bases=(MenuManager, )) ICategorizationSubNav.implementedBy(CategorizationSubNav)
class IBibliographyMainNavItem(zope.interface.Interface): """ A marker interface for the bibliography's item in the main navigation.""" pass class BibliographyMainNavItem(MainNavItem): """The bibliography navigation item in the main navigation.""" zope.interface.implements(IBibliographyMainNavItem) class IBibliographySubNav(ISubNavManager): """A manager for the bibliography subnavigation.""" BibliographySubNav = ViewletManager('bibliographysubnav', ISiteMenu, bases=(MenuManager, )) IBibliographySubNav.implementedBy(BibliographySubNav) class ISearchSubNavItem(zope.interface.Interface): pass class SearchSubNavItem(SiteMenuItem): zope.interface.implements(ISearchSubNavItem)
from zope.viewlet.manager import ViewletManager, WeightOrderedViewletManager from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile from zope.viewlet.viewlet import ViewletBase from z3c.searcher.interfaces import ISearchSession from quotationtool.search.interfaces import ISearchResultInfo SearchResultInfo = ViewletManager('searchresultinfo', ISearchResultInfo, bases=(WeightOrderedViewletManager, )) class ResultCountViewlet(ViewletBase): template = ViewPageTemplateFile('resultcount.pt') @property def filter_name(self): return getattr(self.__parent__, 'session_name', u'last') def render(self): return self.template() def count(self): session = ISearchSession(self.request) fltr = session.getFilter(self.filter_name) query = fltr.generateQuery() return len(query.searchResults())
import zope.interface import zope.component from zope.publisher.browser import BrowserView from zope.viewlet.manager import ViewletManager, WeightOrderedViewletManager from zope.viewlet.interfaces import IViewletManager from zope.contentprovider.interfaces import IContentProvider from quotationtool.skin import interfaces FlagsManager = ViewletManager('flags', interfaces.IFlags, bases = (WeightOrderedViewletManager,)) class FlagsView(BrowserView): def __call__(self): provider = zope.component.getMultiAdapter( (self.context, self.request, self), IContentProvider, name = 'flags') provider.update() return provider.render()
from zope.publisher.browser import BrowserView from z3c.pagelet.browser import BrowserPagelet from zope.viewlet.manager import ViewletManager, WeightOrderedViewletManager from quotationtool.bibliography import interfaces class DefaultView(BrowserView): def __call__(self): return u"NOT IMPLEMENTED - view 'bibliography' or 'citation' for %s" % unicode( self.context.__class__) class AddEntry(BrowserPagelet): """A pagelet that lets the user add an entry to the bibliography.""" AddEntryManager = ViewletManager('add-bibliographic-entry', interfaces.IAddEntryManager, bases=(WeightOrderedViewletManager, ))
import zope.interface import zope.component from zope.viewlet.manager import ViewletManager from z3c.menu.ready2go import ISiteMenu from z3c.menu.ready2go.manager import MenuManager from quotationtool.skin.interfaces import ISubNavManager from quotationtool.skin.browser.nav import MainNavItem class IExampleContainerMainNavItem(zope.interface.Interface): """ A marker interface for the bibliography's item in the main navigation.""" pass class ExampleContainerMainNavItem(MainNavItem): """The bibliography navigation item in the main navigation.""" zope.interface.implements(IExampleContainerMainNavItem) class IExampleContainerSubNav(ISubNavManager): """A manager for the bibliography subnavigation.""" ExampleContainerSubNav = ViewletManager('examplecontainersubnav', ISiteMenu, bases=(MenuManager, )) IExampleContainerSubNav.implementedBy(ExampleContainerSubNav)
import zope.interface from zope.viewlet.manager import ViewletManager from z3c.menu.ready2go import IContextMenu from z3c.menu.ready2go.manager import MenuManager from quotationtool.skin import interfaces ItemTabs = ViewletManager('itemtabs', IContextMenu, bases=(MenuManager, )) interfaces.IItemTabs.implementedBy(ItemTabs)
import zope.component from zope.viewlet.manager import ViewletManager from z3c.menu.ready2go import ISiteMenu from z3c.menu.ready2go.manager import MenuManager from z3c.menu.ready2go.item import SiteMenuItem from quotationtool.skin.interfaces import ISubNavManager from quotationtool.skin.browser.nav import MainNavItem class ICommentaryMainNavItem(zope.interface.Interface): """ A marker interface for the commentary's item in the main navigation.""" pass class CommentaryMainNavItem(MainNavItem): """The commentary navigation item in the main navigation.""" zope.interface.implements(ICommentaryMainNavItem) class ICommentarySubNav(ISubNavManager): """A manager for the commentary subnavigation.""" CommentarySubNav = ViewletManager('commentarysubnav', ISiteMenu, bases=(MenuManager, )) ICommentarySubNav.implementedBy(CommentarySubNav)
# The login and logout pages are defined in the subpackage # quotationtool.skin.browser.authetication. In this module we only # define extensions to the login form and other login related # components used in the skin. # # Extensions to the login form (e.g. a link to a signuo form) may be # registered for a viewlet manager that implements # quotationtool.skin.interfaces.ILoginFormExtensions from zope.viewlet.manager import ViewletManager, WeightOrderedViewletManager from z3c.menu.ready2go.item import SiteMenuItem from quotationtool.skin import interfaces LoginFormExtensions = ViewletManager( 'loginform_extensions', interfaces.ILoginFormExtensions, bases=(WeightOrderedViewletManager, ), ) class LoginMenuItem(SiteMenuItem): """A menu item with a link to the login form."""
import zope.interface import zope.component from zope.publisher.browser import BrowserView from zope.viewlet.manager import ViewletManager, WeightOrderedViewletManager from zope.viewlet.interfaces import IViewletManager from zope.contentprovider.interfaces import IContentProvider from quotationtool.skin import interfaces ItemActionsManager = ViewletManager('itemactions', interfaces.IItemActions, bases=(WeightOrderedViewletManager, ))
import zope.interface import zope.component from zope.viewlet.manager import ViewletManager from z3c.menu.ready2go import ISiteMenu from z3c.menu.ready2go.manager import MenuManager from z3c.menu.ready2go.item import SiteMenuItem from quotationtool.skin.interfaces import ISubNavManager from quotationtool.skin.browser.nav import MainNavItem class ISearchMainNavItem(zope.interface.Interface): """ A marker interface for the bibliography's item in the main navigation.""" pass class SearchMainNavItem(MainNavItem): """The bibliography navigation item in the main navigation.""" zope.interface.implements(ISearchMainNavItem) class ISearchSubNav(ISubNavManager): """A manager for the bibliography subnavigation.""" SearchSubNav = ViewletManager('searchsubnav', ISiteMenu, bases=(MenuManager, )) ISearchSubNav.implementedBy(SearchSubNav)
import zope.interface import zope.component from zope.viewlet.manager import ViewletManager from z3c.menu.ready2go import ISiteMenu from z3c.menu.ready2go.manager import MenuManager from quotationtool.skin.interfaces import ISubNavManager from quotationtool.skin.browser.nav import MainNavItem class IWorkFlowContainerMainNavItem(zope.interface.Interface): """ A marker interface for the workflow nav item in the main navigation.""" pass class WorkFlowContainerMainNavItem(MainNavItem): """The workflow navigation item in the main navigation.""" zope.interface.implements(IWorkFlowContainerMainNavItem) class IWorkFlowContainerSubNav(ISubNavManager): """A manager for the workflow subnavigation.""" WorkFlowContainerSubNav = ViewletManager('workflowcontainersubnav', ISiteMenu, bases=(MenuManager, )) IWorkFlowContainerSubNav.implementedBy(WorkFlowContainerSubNav)
class SimpleSearchViewlet(SearchViewlet): """A viewlet presenting a simple search form with only one search criterium. This viewlet is not registered. You can easily registered this one for which viewlet manager you want or derive an other class with an other search target by setting filterFactoryName, which can be set by ZCML. """ options_info = False filter_choice = False @property def query(self): """ Yield only one criterium.""" for factory in self.getCriteriaInOrder(): if not factory[0] in self.nonui_criteria: yield factory[0] break SearchFormExtensionManager = ViewletManager( 'searchform-extension', interfaces.ISearchFormExtension, bases=(WeightOrderedViewletManager, ))
from zope.viewlet.manager import ViewletManager, WeightOrderedViewletManager from quotationtool.skin import interfaces SidePanel = ViewletManager('sidepanel', interfaces.ISidePanel, bases = (WeightOrderedViewletManager,))
import zope.interface from zope.viewlet.manager import ViewletManager from z3c.menu.ready2go import ISiteMenu from z3c.menu.ready2go.manager import MenuManager from z3c.menu.ready2go.item import SiteMenuItem from quotationtool.skin import interfaces MainNav = ViewletManager('mainnav', ISiteMenu, bases = (MenuManager,)) interfaces.IMainNav.implementedBy(MainNav) class MainNavItem(SiteMenuItem): pass OtherNav = ViewletManager('othernav', ISiteMenu, bases = (MenuManager,)) interfaces.IOtherNav.implementedBy(OtherNav) class OtherNavItem(SiteMenuItem): pass
from zope.viewlet.manager import ViewletManager, WeightOrderedViewletManager from z3c.pagelet.browser import BrowserPagelet from quotationtool.bibliography import interfaces class ConfigPagelet(BrowserPagelet): """ Configure the bibliography.""" ConfigManager = ViewletManager('bibliography_configuration', interfaces.IConfigurationManager, bases = (WeightOrderedViewletManager,))
import zope.interface from z3c.menu.ready2go.item import SiteMenuItem from zope.viewlet.manager import ViewletManager from z3c.menu.ready2go import ISiteMenu, IContextMenu from z3c.menu.ready2go.manager import MenuManager from z3c.menu.ready2go.interfaces import IMenuManager from quotationtool.skin.interfaces import IMainNav, ISubNavManager from quotationtool.skin.browser.nav import MainNavItem class IAccountMainNavItem(zope.interface.Interface): pass class AccountMainNavItem(MainNavItem): zope.interface.implements(IAccountMainNavItem) class IAccountSubNav(ISubNavManager): pass AccountSubNav = ViewletManager( 'accountsubnav', ISiteMenu, bases = (MenuManager,)) IAccountSubNav.implementedBy(AccountSubNav)
from z3c.form import field, button from zope.viewlet.interfaces import IViewlet, IViewletManager from zope.app.component.hooks import getSite from zope.traversing.api import traverse from zope.viewlet.manager import ViewletManager, WeightOrderedViewletManager from zope.contentprovider.interfaces import IContentProvider from quotationtool.figuresng.interfaces import _, IExampleContainer class IExampleContainerAdds(IViewletManager): """ A viewlet manager for adds on the container view.""" ExampleContainerAdds = ViewletManager('examplecontainer-adds', IExampleContainerAdds, bases=(WeightOrderedViewletManager, )) example_id = zope.schema.TextLine( title=_('exampleid-field-title', u"ID"), required=False, ) example_id.__name__ = 'example_id' class ExampleByIdForm(ViewletForm): """ Get example by ID.""" label = _('examplebyidform-label', u"Display example by ID-number") zope.interface.implements(IViewlet)