commit/galaxy-central: dannon: Fix for incorrect template inheritance causing the tool shed base_panels to be displayed in the galaxy app upon logout.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/b21189736eb5/ Changeset: b21189736eb5 User: dannon Date: 2013-04-04 21:34:43 Summary: 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. Affected #: 1 file diff -r d9d824177f5dff29b6dd1d639796c9396ee1060e -r b21189736eb5f5b7e1a57bf02f8bc0ab1359fef5 templates/user/logout.mako --- 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 -</%def> \ No newline at end of file +</%def> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org