From d27381fdddacd8601edaa5b9e75889c8c5b2b6ec Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 4 Apr 2013 15:34:43 -0400 Subject: [PATCH] Fix for incorrect template inheritance causing the tool shed base_panels to be displayed in the galaxy app upon logout. Mako's inherit directives are processed *before* non-global logic, so you need a built-in switch (as implemented, now) or, ideally, refactor into different templates for each webapp that inherit correctly. --- templates/user/logout.mako | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/templates/user/logout.mako b/templates/user/logout.mako index 6084009dfa9..3f6c02f7995 100644 --- a/templates/user/logout.mako +++ b/templates/user/logout.mako @@ -1,8 +1,15 @@ -%if trans.webapp.name == 'galaxy': - <%inherit file="/webapps/galaxy/base_panels.mako"/> -%elif trans.webapp.name == 'tool_shed': - <%inherit file="/webapps/tool_shed/base_panels.mako"/> -%endif +<%! +#This is a hack, we should restructure templates to avoid this. +def inherit(context): + if context.get('trans').webapp.name == 'galaxy': + return '/webapps/galaxy/base_panels.mako' + elif context.get('trans').webapp.name == 'tool_shed': + return '/webapps/tool_shed/base_panels.mako' + else: + return '/base.mako' +%> + +<%inherit file="${inherit(context)}"/> <%namespace file="/message.mako" import="render_msg" /> @@ -35,4 +42,4 @@ %if message: ${render_msg( message, status )} %endif - \ No newline at end of file +