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.
This commit is contained in:
Dannon Baker
2013-04-04 15:34:43 -04:00
parent 0db2c70d14
commit d27381fddd
+13 -6
View File
@@ -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
</%def>
</%def>