commit/galaxy-central: greg: Fixes for managing an installed tool shed repository's tool dependencies.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/be547fe12a1e/ Changeset: be547fe12a1e User: greg Date: 2013-06-24 22:03:59 Summary: Fixes for managing an installed tool shed repository's tool dependencies. Affected #: 5 files diff -r b16265a28cfce30b5678dad9551f08bfdc538ad3 -r be547fe12a1e1b02bc4c7e79834739c590797526 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -482,9 +482,7 @@ def install_tool_dependencies( self, trans, **kwd ): message = kwd.get( 'message', '' ) status = kwd.get( 'status', 'done' ) - tool_dependency_ids = util.listify( kwd.get( 'tool_dependency_ids', None ) ) - if not tool_dependency_ids: - tool_dependency_ids = util.listify( kwd.get( 'id', None ) ) + tool_dependency_ids = tool_dependency_util.get_tool_dependency_ids( as_string=False, **kwd ) tool_dependencies = [] for tool_dependency_id in tool_dependency_ids: tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_id ) @@ -731,11 +729,11 @@ kwd[ 'status' ] = 'error' installed_tool_dependencies_select_field = suc.build_tool_dependencies_select_field( trans, tool_shed_repository=tool_shed_repository, - name='tool_dependency_ids', + name='inst_td_ids', uninstalled=False ) uninstalled_tool_dependencies_select_field = suc.build_tool_dependencies_select_field( trans, tool_shed_repository=tool_shed_repository, - name='tool_dependency_ids', + name='uninstalled_tool_dependency_ids', uninstalled=True ) return trans.fill_template( '/admin/tool_shed_repository/manage_repository_tool_dependencies.mako', repository=tool_shed_repository, @@ -1517,7 +1515,7 @@ def uninstall_tool_dependencies( self, trans, **kwd ): message = kwd.get( 'message', '' ) status = kwd.get( 'status', 'done' ) - tool_dependency_ids = util.listify( kwd.get( 'tool_dependency_ids', None ) ) + tool_dependency_ids = tool_dependency_util.get_tool_dependency_ids( as_string=False, **kwd ) if not tool_dependency_ids: tool_dependency_ids = util.listify( kwd.get( 'id', None ) ) tool_dependencies = [] diff -r b16265a28cfce30b5678dad9551f08bfdc538ad3 -r be547fe12a1e1b02bc4c7e79834739c590797526 lib/tool_shed/util/tool_dependency_util.py --- a/lib/tool_shed/util/tool_dependency_util.py +++ b/lib/tool_shed/util/tool_dependency_util.py @@ -220,9 +220,16 @@ def get_tool_dependency_ids( as_string=False, **kwd ): tool_dependency_id = kwd.get( 'tool_dependency_id', None ) - tool_dependency_ids = util.listify( kwd.get( 'tool_dependency_ids', None ) ) - if not tool_dependency_ids: - tool_dependency_ids = util.listify( kwd.get( 'id', None ) ) + if 'tool_dependency_ids' in kwd: + tool_dependency_ids = util.listify( kwd[ 'tool_dependency_ids' ] ) + elif 'id' in kwd: + tool_dependency_ids = util.listify( kwd[ 'id' ] ) + elif 'inst_td_ids' in kwd: + tool_dependency_ids = util.listify( kwd[ 'inst_td_ids' ] ) + elif 'uninstalled_tool_dependency_ids' in kwd: + tool_dependency_ids = util.listify( kwd[ 'uninstalled_tool_dependency_ids' ] ) + else: + tool_dependency_ids = [] if tool_dependency_id and tool_dependency_id not in tool_dependency_ids: tool_dependency_ids.append( tool_dependency_id ) if as_string: diff -r b16265a28cfce30b5678dad9551f08bfdc538ad3 -r be547fe12a1e1b02bc4c7e79834739c590797526 templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako --- a/templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako +++ b/templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako @@ -44,7 +44,7 @@ <tr><td> %if tool_dependency.status not in [ trans.model.ToolDependency.installation_status.UNINSTALLED ]: - <a target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', operation='browse', id=trans.security.encode_id( tool_dependency.id ) )}"> + <a target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', operation='browse', tool_dependency_ids=trans.security.encode_id( tool_dependency.id ) )}"> ${tool_dependency.name} </a> %else: @@ -66,7 +66,7 @@ </div><div style="clear: both"></div><div class="form-row"> - <input type="checkbox" id="checkAll" name="select_all_uninstalled_tool_dependencies_checkbox" value="true" onclick="checkAllFields('tool_dependency_ids');"/><input type="hidden" name="select_all_uninstalled_tool_dependencies_checkbox" value="true"/><b>Select/unselect all tool dependencies</b> + <input type="checkbox" id="checkAllUninstalled" name="select_all_uninstalled_tool_dependencies_checkbox" value="true" onclick="checkAllFields( 'uninstalled_tool_dependency_ids', 'checkAllUninstalled' );"/><input type="hidden" name="select_all_uninstalled_tool_dependencies_checkbox" value="true"/><b>Select/unselect all tool dependencies</b></div><div style="clear: both"></div><div class="form-row"> @@ -87,7 +87,7 @@ </div><div style="clear: both"></div><div class="form-row"> - <input type="checkbox" id="checkAll" name="select_all_installed_tool_dependencies_checkbox" value="true" onclick="checkAllFields('tool_dependency_ids');"/><input type="hidden" name="select_all_installed_tool_dependencies_checkbox" value="true"/><b>Select/unselect all tool dependencies</b> + <input type="checkbox" id="checkAllInstalled" name="select_all_installed_tool_dependencies_checkbox" value="true" onclick="checkAllFields( 'inst_td_ids', 'checkAllInstalled' );"/><input type="hidden" name="select_all_installed_tool_dependencies_checkbox" value="true"/><b>Select/unselect all tool dependencies</b></div><div style="clear: both"></div><div class="form-row"> diff -r b16265a28cfce30b5678dad9551f08bfdc538ad3 -r be547fe12a1e1b02bc4c7e79834739c590797526 templates/webapps/tool_shed/common/common.mako --- a/templates/webapps/tool_shed/common/common.mako +++ b/templates/webapps/tool_shed/common/common.mako @@ -1,8 +1,15 @@ -<%def name="common_misc_javascripts()"> +<%def name="common_misc_javascripts( element_id=None )"><script type="text/javascript"> - function checkAllFields( name ) + function checkAllFields( name, element_id=element_id ) { - var chkAll = document.getElementById( 'checkAll' ); + if ( element_id ) + { + chkAll = document.getElementById( element_id ); + } + else + { + var chkAll = document.getElementById( 'checkAll' ); + } var checks = document.getElementsByTagName( 'input' ); var boxLength = checks.length; var allChecked = false; diff -r b16265a28cfce30b5678dad9551f08bfdc538ad3 -r be547fe12a1e1b02bc4c7e79834739c590797526 templates/webapps/tool_shed/repository/common.mako --- a/templates/webapps/tool_shed/repository/common.mako +++ b/templates/webapps/tool_shed/repository/common.mako @@ -862,12 +862,12 @@ %if row_is_header: ${tool_dependency.name | h} %elif trans.webapp.name == 'galaxy' and tool_dependency.tool_dependency_id: - %if tool_dependency.repository_id and tool_dependency.installation_status == 'Installed': + %if tool_dependency.repository_id and tool_dependency.installation_status in [ trans.model.ToolDependency.installation_status.INSTALLED ]: <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_tool_dependency', id=trans.security.encode_id( tool_dependency.tool_dependency_id ), repository_id=trans.security.encode_id( tool_dependency.repository_id ) )}"> ${tool_dependency.name | h} </a> - %elif tool_dependency.installation_status != 'Installed': - <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', id=trans.security.encode_id( tool_dependency.tool_dependency_id ) )}"> + %elif tool_dependency.installation_status not in [ trans.model.ToolDependency.installation_status.UNINSTALLED ]: + <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', tool_dependency_ids=trans.security.encode_id( tool_dependency.tool_dependency_id ) )}"> ${tool_dependency.name} </a> %else: 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