Beispiel #1
0
def page(pageName, title, type=""):
    """ Returns template
    to render given page inside shell.
    """
    if "withFilter" in type:
        handler.knowParsedFilter(web)

    def body(*args, **kwargs):
        body = getattr(RENDER, pageName)(*args, **kwargs)
        return RENDER.shell(body, title, type)
    return body
Beispiel #2
0
    def GET(self):
        input = web.input(path="/byty")
        path = input.path
        handler.knowParsedFilter(web)

        perColumn = 5
        localityColumns = []
        index = 0
        ncols = len(locality.LOCALITY_CHOICES) // perColumn
        if len(locality.LOCALITY_CHOICES) % perColumn != 0:
            ncols += 1
        for col in range(ncols):
            localityColumns.append([])
            for choice in locality.LOCALITY_CHOICES[index:index+perColumn]:
                localityColumns[-1].append((index, choice))
                index += 1

        print formatter.page("preferences", _(u"Preferences"))(
                path, localityColumns)