Ejemplo n.º 1
0
 def update(self):
     self.gmentries = []
     self.globalmenu = getMultiAdapter(
         (self.view.context, self.request, self.view), IViewletManager,
         'globalmenu')
     self.globalmenu.update()
     self.globalmenu.template = uvclight.get_template(
         'globalmenu.cpt', __file__)
     self.personalmenu = getMultiAdapter(
         (self.view.context, self.request, self.view), IViewletManager,
         'personal')
     self.personalmenu.update()
     self.personalmenu.template = uvclight.get_template(
         'personalmenu.cpt', __file__)
     self.submenus = list()
     submenus = getAdapters(
         (self.context, self.request, self.view, self.globalmenu), ISubMenu)
     for name, submenu in submenus:
         submenu.update()
         submenu.template = uvclight.get_template('submenu.cpt', __file__)
         self.submenus.append(submenu)
     for entry in self.globalmenu.entries:
         self.gmentries.append(entry)
     self.gmentries += self.submenus
     setattr(self.globalmenu, 'gmentries', self.gmentries)
Ejemplo n.º 2
0
class Alerts(Viewlet):
    viewletmanager(Top)
    order(15)
    context(GateKeeper)
    layer(DefaultLayer)

    template = get_template('messages.pt', __file__)
Ejemplo n.º 3
0
class LoginAlerts(Viewlet):
    viewletmanager(Top)
    order(15)
    context(LoginRoot)
    layer(DefaultLayer)

    template = get_template('messages.pt', __file__)
Ejemplo n.º 4
0
class Unauthorized(Page):
    layer(DefaultLayer)
    template = get_template('unauthorized.pt', __file__)
    message = None

    def set_message(self, message):
        self.message = message
Ejemplo n.º 5
0
class FlashMessages(uvclight.Viewlet):
    uvclight.order(2)
    uvclight.layer(IVBGTheme)
    uvclight.viewletmanager(managers.IAboveContent)
    template = uvclight.get_template('flash.cpt', __file__)

    def update(self):
        self.messages = [msg.message for msg in receive()]
Ejemplo n.º 6
0
class GatekeeperIndex(Page):
    name('index')
    context(GateKeeper)
    layer(DefaultLayer)

    template = get_template('entrance.pt', __file__)

    def update(self):
        self.portals = list(self.context.get_portals(self.request))
Ejemplo n.º 7
0
class FlashMessages(uvclight.Viewlet):
    uvclight.viewletmanager(IAboveContent)
    template = uvclight.get_template('flashmessage.cpt', __file__)

    def update(self):
        messages = receive(None)
        if messages:
            self.messages = [msg for msg in receive(None)]
        else:
            self.messages = []
Ejemplo n.º 8
0
class GateLayout(Layout):
    context(Interface)
    layer(DefaultLayer)

    title = u"Gatekeeper"
    template = get_template('layout.pt', __file__)

    def __call__(self, content, **namespace):
        styles.need()
        namespace['user'] = self.request.environment.get('REMOTE_USER')
        namespace['gatekeeper_messages'] = list(receive())
        return Layout.__call__(self, content, **namespace)
Ejemplo n.º 9
0
class Layout(uvclight.Layout):
    uvclight.context(Interface)

    template = uvclight.get_template('layout.cpt', __file__)
    base = "/"

    def __call__(self, content, **ns):
        main_css.need()
        #        main_js.need()
        if 'view' in ns:
            self.title = getattr(ns['view'], 'title', u'KUVB')
        else:
            self.title = u'Fernlehrgang'
        return uvclight.Layout.__call__(self, content, **ns)
Ejemplo n.º 10
0
class AdminIndex(Page):
    name('index')
    context(AdminRoot)
    layer(DefaultLayer)

    template = get_template('admin.pt', __file__)

    def update(self):
        self.links = ({
            'title':
            _(u"Messages management", default="Messages management"),
            'url':
            get_absolute_url(self.context.messages, self.request),
        }, )
Ejemplo n.º 11
0
class GlobalNav(uvclight.Viewlet):
    uvclight.viewletmanager(MainNavigation)
    uvclight.context(interface.Interface)
    template = uvclight.get_template('globalnav.cpt', __file__)

    @property
    def title(self):
        site = uvclight.getSite()
        if site is not None:
            return site.title
        return u'Navigation'

    def update(self):
        self.gmentries = []
        self.globalmenu = getMultiAdapter(
            (self.view.context, self.request, self.view), IViewletManager,
            'globalmenu')
        self.globalmenu.update()
        self.globalmenu.template = uvclight.get_template(
            'globalmenu.cpt', __file__)
        self.personalmenu = getMultiAdapter(
            (self.view.context, self.request, self.view), IViewletManager,
            'personal')
        self.personalmenu.update()
        self.personalmenu.template = uvclight.get_template(
            'personalmenu.cpt', __file__)
        self.submenus = list()
        submenus = getAdapters(
            (self.context, self.request, self.view, self.globalmenu), ISubMenu)
        for name, submenu in submenus:
            submenu.update()
            submenu.template = uvclight.get_template('submenu.cpt', __file__)
            self.submenus.append(submenu)
        for entry in self.globalmenu.entries:
            self.gmentries.append(entry)
        self.gmentries += self.submenus
        setattr(self.globalmenu, 'gmentries', self.gmentries)
Ejemplo n.º 12
0
def global_template(context, request):
    return uvclight.get_template('globalmenu.cpt', __file__)
Ejemplo n.º 13
0
# -*- coding: utf-8 -*-

from uvclight import get_template
from zope.interface import Interface
from zope.schema import TextLine, Password
from zope.i18nmessageid import MessageFactory


_ = MessageFactory("gatekeeper")


timeout_template = get_template('timeout.pt', __file__)
unauthorized_template = get_template('unauthorized.pt', __file__)


class ILoginForm(Interface):
    """A simple login form interface.
    """
    login = TextLine(
        title=_(u"Username", default=u"Username"),
        required=True,
    )

    password = Password(
        title=_(u"Password", default=u"Password"),
        required=True,
    )

    back = TextLine(
        title=u"back",
        required=False,
Ejemplo n.º 14
0
class RGPDCK(uvclight.Viewlet):
    uvclight.viewletmanager(managers.IAboveContent)
    uvclight.order(00)
    uvclight.name('rgpdck')
    template = uvclight.get_template('rgpdck.cpt', __file__)
Ejemplo n.º 15
0
def usermenu_template(context, request):
    return uvclight.get_template('usermenu.cpt', __file__)
Ejemplo n.º 16
0
def nav_template(context, request):
    return uvclight.get_template('navtemplate.cpt', __file__)
Ejemplo n.º 17
0
 def template(self):
     template = "example_text.pt"
     if self.context.strategy == "fixed":
         template = "example_text_fixed.pt"
     return get_template(template, __file__)
Ejemplo n.º 18
0
def get_template(name):
    return uvclight.get_template(name, siguvtheme.resources.__file__)
Ejemplo n.º 19
0
 def panel(self):
     template = get_template('anon_index.pt', __file__)
     panel = template.macros['panel']
     return panel
Ejemplo n.º 20
0
def object_template(context, request):
    return uvclight.get_template('objectmenu.cpt', __file__)
Ejemplo n.º 21
0
class Timeout(Page):
    layer(DefaultLayer)
    template = get_template('timeout.pt', __file__)
Ejemplo n.º 22
0
def entry_template(context, request):
    """default template for a menu entry"""
    return uvclight.get_template("entry.cpt", __file__)
Ejemplo n.º 23
0
def menu_template(context, request):
    """default template for the menu"""
    return uvclight.get_template("menu.cpt", __file__)
Ejemplo n.º 24
0
def personalpanel_menu(context, request):
    return uvclight.get_template('personalpaneltemplate.pt', __file__)
Ejemplo n.º 25
0
class ContextualActions(Menu):
    name('contextual')
    template = get_template('contextual.pt', __file__)
Ejemplo n.º 26
0
def get_template(name):
    return uvclight.get_template(name, __file__)
Ejemplo n.º 27
0
def form_template(context, request):
    """default template for the menu"""
    return uvclight.get_template('form.cpt', __file__)
Ejemplo n.º 28
0
class NotFound(Page):
    layer(DefaultLayer)
    template = get_template('404.pt', __file__)