From 82d3e74eb128e31837f200db2f7ee8be847a23ce Mon Sep 17 00:00:00 2001 From: Carl Eberhard Date: Tue, 29 Apr 2014 12:34:07 -0400 Subject: [PATCH] History: allow admin to use display_structured w/ id, add display_structured link in history/view, allow switching to a history from history/view --- .../webapps/galaxy/controllers/history.py | 5 +- templates/webapps/galaxy/history/view.mako | 47 ++++++++++++++----- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/controllers/history.py b/lib/galaxy/webapps/galaxy/controllers/history.py index 53e92f2330c..1107c10960e 100644 --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -456,7 +456,10 @@ class HistoryController( BaseUIController, SharableMixin, UsesAnnotations, UsesI eagerload_all( 'active_datasets.children' ) ).get( id ) assert history - assert history.user and ( history.user.id == trans.user.id ) or ( history.id == trans.history.id ) + #TODO: formalize to trans.show_error + assert ( history.user and ( history.user.id == trans.user.id ) + or ( history.id == trans.history.id ) + or ( trans.user_is_admin() ) ) # Resolve jobs and workflow invocations for the datasets in the history # items is filled with items (hdas, jobs, or workflows) that go at the # top level diff --git a/templates/webapps/galaxy/history/view.mako b/templates/webapps/galaxy/history/view.mako index 833b58298a7..e09c996b286 100644 --- a/templates/webapps/galaxy/history/view.mako +++ b/templates/webapps/galaxy/history/view.mako @@ -72,24 +72,37 @@ ${parent.javascripts()} ## ---------------------------------------------------------------------------- <%def name="center_panel()"> <% + imp_with_deleted_url = h.url_for( controller='history', action='imp', id=history[ 'id' ], all_datasets=True ) + imp_without_deleted_url = h.url_for( controller='history', action='imp', id=history[ 'id' ] ) + + structure_url = h.url_for( controller='history', action='display_structured', id=history[ 'id' ] ) + + switch_to_url = h.url_for( controller='history', action='switch_to_history', hist_id=history[ 'id' ] ) + show_deleted = context.get( 'show_deleted', None ) show_hidden = context.get( 'show_hidden', None ) user_is_owner_json = 'true' if user_is_owner else 'false' show_deleted_json = h.to_json_string( show_deleted ) show_hidden_json = h.to_json_string( show_hidden ) - - imp_with_deleted_url = h.url_for( controller='history', action='imp', id=history['id'], all_datasets=True ) - imp_without_deleted_url = h.url_for( controller='history', action='imp', id=history['id'] ) %>