mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user