'Patch page templates to add Hub-related buttons'

def patch_templates(self):

    self.jinja_template_vars['logo_url'] = (self.hub_host + url_path_join(self.hub_prefix, 'logo'))
    self.jinja_template_vars['hub_host'] = self.hub_host
    self.jinja_template_vars['hub_prefix'] = self.hub_prefix
    env = self.web_app.settings['jinja2_env']
    env.globals['hub_control_panel_url'] = (self.hub_host + url_path_join(self.hub_prefix, 'home'))
    def get_page(name):
        if (name == 'page.html'):
            return page_template
    orig_loader = env.loader
    env.loader = ChoiceLoader([FunctionLoader(get_page), orig_loader])
