diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 37d33d0b73a..f330e3f2947 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -295,7 +295,7 @@ class ToolBox( object ): self.load_workflow_tag_set( sub_elem, elems ) elif sub_elem.tag == 'label': self.load_label_tag_set( sub_elem, elems ) - if key not in panel_dict and section.elems: + if key not in panel_dict: panel_dict[ key ] = section def load_tool( self, config_file, guid=None ): """ diff --git a/lib/galaxy/web/controllers/admin_toolshed.py b/lib/galaxy/web/controllers/admin_toolshed.py index 5b8c97b812e..55af5b533db 100644 --- a/lib/galaxy/web/controllers/admin_toolshed.py +++ b/lib/galaxy/web/controllers/admin_toolshed.py @@ -499,18 +499,9 @@ class AdminToolshed( AdminGalaxy ): metadata = repository.metadata repository_tools_tups = get_repository_tools_tups( trans.app, metadata ) guids_to_activate = [ repository_tool_tup[1] for repository_tool_tup in repository_tools_tups ] - # Undelete the tool_version for each guid. + # Make sure we have a tool_version for each guid. for guid_to_activate in guids_to_activate: - tool_version = get_tool_version( trans.app, guid_to_activate ) - if tool_version: - if tool_version.deleted: - # This should not happen as we are currently not marking tool versions as deleted - # upon deactivation. We may decide to eliminate the tool_version.deleted column - # at some point, but we'll keep it for now in case we decide its useful. - tool_version.deleted = False - trans.sa_session.add( tool_version ) - trans.sa_session.flush() - else: + if not get_tool_version( trans.app, guid_to_activate ): # We're somehow missing a tool_version, so create a new one. tool_version = trans.model.ToolVersion( tool_id=guid_to_activate, tool_shed_repository=repository ) trans.sa_session.add( tool_version ) diff --git a/templates/root/tool_menu.mako b/templates/root/tool_menu.mako index 220fb0c8522..1fd501885fd 100644 --- a/templates/root/tool_menu.mako +++ b/templates/root/tool_menu.mako @@ -365,22 +365,25 @@ ${render_workflow( key, val, False )} %elif key.startswith( 'section' ): <% section = val %> -
- ${section.name} -
-
-
- %for section_key, section_val in section.elems.items(): - %if section_key.startswith( 'tool' ): - ${render_tool( section_val, True )} - %elif section_key.startswith( 'workflow' ): - ${render_workflow( section_key, section_val, True )} - %elif section_key.startswith( 'label' ): - ${render_label( section_val )} - %endif - %endfor + ## Render the section only if it is not empty. + %if section.elems: +
+ ${section.name}
-
+
+
+ %for section_key, section_val in section.elems.items(): + %if section_key.startswith( 'tool' ): + ${render_tool( section_val, True )} + %elif section_key.startswith( 'workflow' ): + ${render_workflow( section_key, section_val, True )} + %elif section_key.startswith( 'label' ): + ${render_label( section_val )} + %endif + %endfor +
+
+ %endif %elif key.startswith( 'label' ): ${render_label( val )} %endif