Add functionality for deleting all hidden datasets in a history. This is card https://trello.com/c/0SoREcMn

This commit is contained in:
Dannon Baker
2013-04-03 14:58:42 -04:00
parent 58191b6086
commit 5e5e5f37ad
2 changed files with 20 additions and 0 deletions
@@ -497,6 +497,21 @@ class HistoryController( BaseUIController, SharableMixin, UsesAnnotations, UsesI
#
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
+5
View File
@@ -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' )}";