def get(self, spaceName, pageUrl): currentSpace = spaceservice.getSpace(spaceName) if currentSpace: currentUser = self.getCurrentUser() requestWrapper = RequestWrapper(currentUser, self.request) currentPage = spaceservice.getPage(currentSpace, pageUrl); pageRenderer = renderer.PageRenderer(currentPage, requestWrapper, self.response) themeTemplate = template.load(os.path.join('template','theme', currentSpace.theme.name + '.html')) self.response.out.write(themeTemplate.render(template.Context({'page': pageRenderer}))) if requestWrapper.uri: self.redirect(requestWrapper.uri) else: self.response.out.write(configuration.getMessage('space.not.found'))
def process(request, response): if request.currentUser.isGuestUser(): return "<a href='%s'>%s</a>" % (users.create_login_url(request.request.uri), configuration.getMessage('login')) else: return "<a href='%s'>%s</a>" % (users.create_logout_url("/"), configuration.getMessage('logout'))