view MoinMoin/theme/modernized_cms.py @ 6106:b59ee217581c

remove MoinMoin.support.HeaderFixed assuming it is fixed in 2.7. no idea what the problem was, comments unhelpful.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 06 Sep 2016 01:52:01 +0200
parents 716dcfb00e8e
children
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - modernized_cms theme

    @copyright: 2009 MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.
"""

from MoinMoin.theme.modernized import Theme as ThemeBase

class Theme(ThemeBase):

    name = "modernized" # we tell that we are 'modernized', so we use its static data

    def onlyloggedin(method):
        """ decorator that returns empty string for not logged-in users,
            otherwise it calls the decorated method
        """
        return lambda self, *args, **kwargs: (
            self.request.user.valid and self.request.user.name and method(self, *args, **kwargs)
            or
            ''
            )

    interwiki = onlyloggedin(ThemeBase.interwiki)
    title = onlyloggedin(ThemeBase.title)
    username = onlyloggedin(ThemeBase.username)
    pageinfo = onlyloggedin(ThemeBase.pageinfo)
    editbar = onlyloggedin(ThemeBase.editbar)


def execute(request):
    return Theme(request)