commit/galaxy-central: dannon: Add functionality for deleting all hidden datasets in a history. This is card https://trello.com/c/0SoREcMn
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/ed15e6865e1e/ Changeset: ed15e6865e1e User: dannon Date: 2013-04-03 20:58:42 Summary: Add functionality for deleting all hidden datasets in a history. This is card https://trello.com/c/0SoREcMn Affected #: 2 files diff -r a3e96840fd63592d234a1e50b2d5e201fe430b3f -r ed15e6865e1e8d0648cd307f7026ac284da7553a lib/galaxy/webapps/galaxy/controllers/history.py --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -498,6 +498,21 @@ return trans.fill_template( "history/display_structured.mako", items=items ) @web.expose + def delete_hidden_datasets( self, trans ): + """ + This method deletes all hidden datasets in the current history. + """ + count = 0 + for hda in trans.history.datasets: + if not hda.visible and not hda.deleted and not hda.purged: + hda.mark_deleted() + count += 1 + trans.sa_session.add( hda ) + trans.log_event( "HDA id %s has been deleted" % hda.id ) + trans.sa_session.flush() + return trans.show_ok_message( "%d hidden datasets have been deleted" % count, refresh_frames=['history'] ) + + @web.expose def purge_deleted_datasets( self, trans ): count = 0 if trans.app.config.allow_user_dataset_purge: diff -r a3e96840fd63592d234a1e50b2d5e201fe430b3f -r ed15e6865e1e8d0648cd307f7026ac284da7553a templates/webapps/galaxy/root/index.mako --- a/templates/webapps/galaxy/root/index.mako +++ b/templates/webapps/galaxy/root/index.mako @@ -45,6 +45,11 @@ galaxy_main.location = "${h.url_for( controller='history', action='unhide_datasets', current=True )}"; } }, + "${_("Delete Hidden Datasets")}": function() { + if ( confirm( "Really delete all hidden datasets?" ) ) { + galaxy_main.location = "${h.url_for( controller='history', action='delete_hidden_datasets')}"; + } + }, "${_("Purge Deleted Datasets")}": function() { if ( confirm( "Really delete all deleted datasets permanently? This cannot be undone." ) ) { galaxy_main.location = "${h.url_for( controller='history', action='purge_deleted_datasets' )}"; 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