1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/dbff28bde968/ changeset: dbff28bde968 user: dan date: 2012-11-07 19:50:06 summary: Allow unhiding all datasets in the current history. affected #: 3 files diff -r 932585f1dd8d67c28d2c22003af0d9ae318ef947 -r dbff28bde968a05b787dd53cfca182c53a81eeb7 lib/galaxy/model/__init__.py --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -694,6 +694,9 @@ @property def get_disk_size_bytes( self ): return self.get_disk_size( nice_size=False ) + def unhide_datasets( self ): + for dataset in self.datasets: + dataset.mark_unhidden() def get_disk_size( self, nice_size=False ): # unique datasets only db_session = object_session( self ) diff -r 932585f1dd8d67c28d2c22003af0d9ae318ef947 -r dbff28bde968a05b787dd53cfca182c53a81eeb7 lib/galaxy/webapps/galaxy/controllers/history.py --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -550,6 +550,20 @@ return trans.show_ok_message( "History deleted, a new history is active", refresh_frames=['history'] ) @web.expose + def unhide_datasets( self, trans, current=False, ids=None ): + """Unhide the datasets in the active history -- this does not require a logged in user.""" + if not ids and util.string_as_bool( current ): + histories = [ trans.get_history() ] + refresh_frames = ['history'] + else: + raise NotImplementedError( "You can currently only unhide all the datasets of the current history." ) + for history in histories: + history.unhide_datasets() + trans.sa_session.add( history ) + trans.sa_session.flush() + return trans.show_ok_message( "Your datasets have been unhidden.", refresh_frames=refresh_frames ) + + @web.expose @web.require_login( "rate items" ) @web.json def rate_async( self, trans, id, rating ): diff -r 932585f1dd8d67c28d2c22003af0d9ae318ef947 -r dbff28bde968a05b787dd53cfca182c53a81eeb7 templates/root/index.mako --- a/templates/root/index.mako +++ b/templates/root/index.mako @@ -43,6 +43,11 @@ "${_("Show Hidden Datasets")}": function() { galaxy_history.location = "${h.url_for( controller='root', action='history', show_hidden=True)}"; }, + "${_("Unhide Hidden Datasets")}": function() { + if ( confirm( "Really unhide all hidden datasets?" ) ) { + galaxy_main.location = "${h.url_for( controller='history', action='unhide_datasets', current=True )}"; + } + }, "${_("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.