browser.layout - Layout

Basic layout components.

class waeup.kofa.browser.layout.KofaAction(label, style='', tooltip='', warning='', **options)[source]

Bases: grokcore.formlib.formlib.Action

__doc__ = None
__init__(label, style='', tooltip='', warning='', **options)[source]
__module__ = 'waeup.kofa.browser.layout'
render()[source]
class waeup.kofa.browser.layout.KofaAddFormPage(context, request)[source]

Bases: waeup.kofa.browser.layout.UtilityView, megrok.layout.components.AddForm

A megrok.layout.AddForm with additional methods.

__doc__ = 'A megrok.layout.AddForm with additional methods.\n '
__module__ = 'waeup.kofa.browser.layout'
template = <default_waeup_edit_form template in >
class waeup.kofa.browser.layout.KofaDisplayFormPage(context, request)[source]

Bases: waeup.kofa.browser.layout.UtilityView, megrok.layout.components.DisplayForm

A megrok.layout.DisplayForm with additional methods.

__doc__ = 'A megrok.layout.DisplayForm with additional methods.\n '
__module__ = 'waeup.kofa.browser.layout'
hide_hint = True
template = <default_waeup_display_form template in >
class waeup.kofa.browser.layout.KofaEditFormPage(context, request)[source]

Bases: waeup.kofa.browser.layout.UtilityView, megrok.layout.components.EditForm

A megrok.layout.EditForm with additional methods.

__doc__ = 'A megrok.layout.EditForm with additional methods.\n '
__module__ = 'waeup.kofa.browser.layout'
setUpWidgets(ignore_request=False)[source]
template = <default_waeup_edit_form template in >
class waeup.kofa.browser.layout.KofaFormPage(context, request)[source]

Bases: waeup.kofa.browser.layout.UtilityView, megrok.layout.components.Form

A megrok.layout.Form with additional methods.

__doc__ = 'A megrok.layout.Form with additional methods.\n '
__module__ = 'waeup.kofa.browser.layout'
setUpWidgets(ignore_request=False)[source]
class waeup.kofa.browser.layout.KofaLayout(request, context)[source]

Bases: waeup.kofa.browser.layout.UtilityView, megrok.layout.components.Layout

A megrok.layout.Layout with additional methods.

__doc__ = 'A megrok.layout.Layout with additional methods.\n '
__module__ = 'waeup.kofa.browser.layout'
class waeup.kofa.browser.layout.KofaPage(context, request)[source]

Bases: waeup.kofa.browser.layout.UtilityView, megrok.layout.components.Page

A megrok.layout page with additional methods.

__doc__ = 'A megrok.layout page with additional methods.\n '
__module__ = 'waeup.kofa.browser.layout'
class waeup.kofa.browser.layout.Messages(context, request)[source]

Bases: grok.components.View

Display messages of message receivers.

__doc__ = 'Display messages of message receivers.\n '
__module__ = 'waeup.kofa.browser.layout'
messages
waeup.kofa.browser.layout.NullValidator(*args, **kw)[source]

A validator that does not validate.

This is needed especially for cancel buttons. We don’t want data to be validated that will be thrown away in the next step.

You can use it with grok.action decorator like this:

@grok.action('Cancel', validator=NullValidator)
def cancel(self, **data):
  self.redirect(<whereever-you-go>)
class waeup.kofa.browser.layout.SiteLayout(request, context)[source]

Bases: waeup.kofa.browser.layout.KofaLayout

The general site layout.

__doc__ = ' The general site layout.\n '
__module__ = 'waeup.kofa.browser.layout'
course_cat_used
formatDate(dateobj)[source]
formatDatetime(datetimeobj)[source]
formatTZDate(datetimeobj)[source]
getAppAcronym()[source]
getAppTitle()[source]
getStudentName()[source]

Return the student name.

getUserId()[source]

Return id of current user.

getUserTitle()[source]

Return principal title of current user.

isApplicant()[source]
isAuthenticated()[source]

Return True if the calling user is authenticated.

isMaintenanceMode()[source]

Return True if portal is in maintenance mode.

isStudent()[source]
render()[source]
site
stafftemp = < template in >

An instance of the default theme to use for the site layout

studenttemp = < template in >
class waeup.kofa.browser.layout.UtilityView[source]

Bases: object

A view mixin with useful methods.

The pnav attribute (a number) tells, to which primary navigation tab a page declares to belong.

__dict__ = dict_proxy({'__module__': 'waeup.kofa.browser.layout', 'application_url': <function application_url at 0x2b7a06af0d70>, 'pnav': 0, 'title': u'', '__dict__': <attribute '__dict__' of 'UtilityView' objects>, 'flash': <function flash at 0x2b7a06af0de8>, '__weakref__': <attribute '__weakref__' of 'UtilityView' objects>, '__doc__': 'A view mixin with useful methods.\n\n The ``pnav`` attribute (a number) tells, to which primary\n navigation tab a page declares to belong.\n '})
__doc__ = 'A view mixin with useful methods.\n\n The ``pnav`` attribute (a number) tells, to which primary\n navigation tab a page declares to belong.\n '
__module__ = 'waeup.kofa.browser.layout'
__weakref__

list of weak references to the object (if defined)

application_url(name=None)[source]

Return the URL of the nearest site.

flash(message, type='success')[source]

Send a short message to the user.

pnav = 0
title = u''
class waeup.kofa.browser.layout.action(label, actions=None, **options)[source]

Bases: grokcore.formlib.formlib.action

__call__(success)[source]
__doc__ = None
__module__ = 'waeup.kofa.browser.layout'
class waeup.kofa.browser.layout.jsaction(label, actions=None, **options)[source]

Bases: grokcore.formlib.formlib.action

__call__(success)[source]
__doc__ = None
__module__ = 'waeup.kofa.browser.layout'
msg = u'Are you sure?'