2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/9d5a55bbfcb8/ changeset: 9d5a55bbfcb8 user: jgoecks date: 2012-03-02 20:29:21 summary: Fix custom-build UI bugs. affected #: 2 files diff -r 29f652b9a18cbac444a1c1b68d5ad36f17db7192 -r 9d5a55bbfcb8d9129c3e429098255eee05614930 lib/galaxy/web/controllers/user.py --- a/lib/galaxy/web/controllers/user.py +++ b/lib/galaxy/web/controllers/user.py @@ -1174,6 +1174,8 @@ @web.expose @web.require_login() def dbkeys( self, trans, **kwds ): + """ Handle custom builds. """ + # # Process arguments and add/delete build. # @@ -1298,7 +1300,7 @@ fasta_hdas = trans.sa_session.query( model.HistoryDatasetAssociation ) \ .filter_by( history=trans.history, extension="fasta", deleted=False ) \ .order_by( model.HistoryDatasetAssociation.hid.desc() ) - + return trans.fill_template( 'user/dbkeys.mako', user=user, dbkeys=dbkeys, @@ -1306,7 +1308,7 @@ installed_len_files=self.installed_len_files, lines_skipped=lines_skipped, fasta_hdas=fasta_hdas, - use_panels=kwds.get( 'use_panels', None ) ) + use_panels=kwds.get( 'use_panels', False ) ) @web.expose @web.require_login() def api_keys( self, trans, cntrller, **kwd ): diff -r 29f652b9a18cbac444a1c1b68d5ad36f17db7192 -r 9d5a55bbfcb8d9129c3e429098255eee05614930 templates/user/dbkeys.mako --- a/templates/user/dbkeys.mako +++ b/templates/user/dbkeys.mako @@ -99,7 +99,7 @@ // Before submit, remove inputs not associated with the active tab. $("#submit").click(function() { - var id = $(".active > a").attr("id"); + var id = $(this).parents("form").find(".active > a").attr("id"); $("div.build_definition").children(":input").each(function() { if ( $(this).attr("id") !== (id + "_input") ) { $(this).remove(); @@ -168,6 +168,10 @@ <hr /><h3>Add a Custom Build</h3><form action="dbkeys" method="post" enctype="multipart/form-data"> + ## Include hidden param for panels: + %if use_panels: + <input type="hidden" name="use_panels" value="True"> + %endif ## Custom build via fasta in history. <div class="toolForm" style="float: left;"><div class="toolFormTitle">New Build</div> https://bitbucket.org/galaxy/galaxy-central/changeset/250bbb04b5a4/ changeset: 250bbb04b5a4 user: jgoecks date: 2012-03-02 20:35:57 summary: Merge affected #: 1 file diff -r 9d5a55bbfcb8d9129c3e429098255eee05614930 -r 250bbb04b5a4539010100cd56191fbb32c4242a5 lib/galaxy/util/shed_util.py --- a/lib/galaxy/util/shed_util.py +++ b/lib/galaxy/util/shed_util.py @@ -599,25 +599,6 @@ if converter_path and display_path: break return converter_path, display_path -def get_in_memory_config_elems_to_remove( shed_tool_conf_dict, guids_to_remove ): - config_elems = shed_tool_conf_dict[ 'config_elems' ] - config_elems_to_remove = [] - for config_elem in config_elems: - if config_elem.tag == 'section': - tool_elems_to_remove = [] - for tool_elem in config_elem: - if tool_elem.get( 'guid' ) in guids_to_remove: - tool_elems_to_remove.append( tool_elem ) - for tool_elem in tool_elems_to_remove: - # Remove all of the appropriate tool sub-elements from the section element. - config_elem.remove( tool_elem ) - if len( config_elem ) < 1: - # Keep a list of all empty section elements so they can be removed. - config_elems_to_remove.append( config_elem ) - elif config_elem.tag == 'tool': - if config_elem.get( 'guid' ) in guids_to_remove: - config_elems_to_remove.append( config_elem ) - return config_elems_to_remove def get_shed_tool_conf_dict( app, shed_tool_conf ): """ Return the in-memory version of the shed_tool_conf file, which is stored in the config_elems entry @@ -1003,18 +984,40 @@ if uninstall: # Remove from the shed_tool_conf file on disk. remove_from_shed_tool_config( trans, shed_tool_conf_dict, guids_to_remove ) - config_elems_to_remove = get_in_memory_config_elems_to_remove( shed_tool_conf_dict, guids_to_remove ) - # Remove from the in-memory list of config_elems. config_elems = shed_tool_conf_dict[ 'config_elems' ] + config_elems_to_remove = [] + for config_elem in config_elems: + if config_elem.tag == 'section': + # Get the section key for the in-memory tool panel. + section_key = 'section_%s' % str( config_elem.get( "id" ) ) + # Generate the list of tool elements to remove. + tool_elems_to_remove = [] + for tool_elem in config_elem: + if tool_elem.get( 'guid' ) in guids_to_remove: + tool_elems_to_remove.append( tool_elem ) + for tool_elem in tool_elems_to_remove: + # Remove the tool sub-element from the section element. + config_elem.remove( tool_elem ) + # Remove the tool from the section in the in-memory tool panel. + if section_key in trans.app.toolbox.tool_panel: + tool_section = trans.app.toolbox.tool_panel[ section_key ] + tool_key = key = 'tool_%s' % str( tool_elem.get( 'guid' ) ) + if tool_key in tool_section.elems: + del tool_section.elems[ tool_key ] + if not tool_section.elems: + del trans.app.toolbox.tool_panel[ section_key ] + if len( config_elem ) < 1: + # Keep a list of all empty section elements so they can be removed. + config_elems_to_remove.append( config_elem ) + elif config_elem.tag == 'tool': + if config_elem.get( 'guid' ) in guids_to_remove: + tool_key = key = 'tool_%s' % str( config_elem.get( 'guid' ) ) + if tool_key in trans.app.toolbox.tool_panel: + del trans.app.toolbox.tool_panel[ tool_key ] + config_elems_to_remove.append( config_elem ) for config_elem in config_elems_to_remove: # Remove the element from the in-memory list of elements. config_elems.remove( config_elem ) - if config_elem.tag == 'section': - key = 'section_%s' % str( config_elem.get( "id" ) ) - del trans.app.toolbox.tool_panel[ key ] - elif config_elem.tag == 'tool': - key = 'tool_%s' % str( config_elem.get( 'guid' ) ) - del trans.app.toolbox.tool_panel[ key ] # Update the config_elems of the in-memory shed_tool_conf_dict. shed_tool_conf_dict[ 'config_elems' ] = config_elems trans.app.toolbox.shed_tool_confs[ index ] = shed_tool_conf_dict 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.