def template(req, path, data): config = WikiPage.get_config() user = get_cur_user() data['is_local'] = req.host_url.startswith('http://localhost') data['is_mobile'] = is_mobile(req) data['user'] = user data['preferences'] = UserPreferences.get_by_user(user) if user is not None else None data['users'] = users data['cur_url'] = req.url data['config'] = config data['app'] = {'version': main.VERSION} return JINJA.get_template('templates/%s' % path).render(data)
def template(req, path, data): config = WikiPage.get_config() user = get_cur_user() data['is_local'] = req.host_url.startswith('http://localhost') data['is_mobile'] = is_mobile(req) data['user'] = user data['preferences'] = UserPreferences.get_by_user( user) if user is not None else None data['users'] = users data['cur_url'] = req.url data['config'] = config data['app'] = {'version': main.VERSION} return JINJA.get_template('templates/%s' % path).render(data)
def get_cur_user(self): return get_cur_user()