From 4b2b3af5ce2e4e495de12cc8fe2d410dd46ef133 Mon Sep 17 00:00:00 2001 From: Carl Eberhard Date: Thu, 20 Feb 2014 17:44:04 -0500 Subject: [PATCH] (Fix to 8e4196a) Histories embedded in pages: first pass at using panel --- lib/galaxy/webapps/galaxy/controllers/history.py | 16 +++++++++++++++- templates/display_base.mako | 15 ++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/controllers/history.py b/lib/galaxy/webapps/galaxy/controllers/history.py index b7479b4c607..d215c50fa0f 100644 --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -753,7 +753,21 @@ class HistoryController( BaseUIController, SharableMixin, UsesAnnotations, UsesI history.annotation = self.get_item_annotation_str( trans.sa_session, history.user, history ) for dataset in datasets: dataset.annotation = self.get_item_annotation_str( trans.sa_session, history.user, dataset ) - return trans.stream_template_mako( "/history/item_content.mako", item = history, item_data = datasets ) + + user_is_owner = trans.user == history.user + history.annotation = self.get_item_annotation_str( trans.sa_session, history.user, history ) + + hda_dicts = [] + datasets = self.get_history_datasets( trans, history ) + for hda in datasets: + hda_dict = self.get_hda_dict( trans, hda ) + hda_dict[ 'annotation' ] = self.get_item_annotation_str( trans.sa_session, history.user, hda ) + hda_dicts.append( hda_dict ) + history_dict = self.get_history_dict( trans, history, hda_dictionaries=hda_dicts ) + history_dict[ 'annotation' ] = history.annotation + + return trans.fill_template( "history/item_content.mako", item=history, item_data=datasets, + user_is_owner=user_is_owner, history_dict=history_dict, hda_dicts=hda_dicts ) @web.expose def name_autocomplete_data( self, trans, q=None, limit=None, timestamp=None ): diff --git a/templates/display_base.mako b/templates/display_base.mako index 11e617ef09a..91b3fd073d8 100644 --- a/templates/display_base.mako +++ b/templates/display_base.mako @@ -11,6 +11,7 @@ <%inherit file="${inherit( context )}"/> <%namespace file="/tagging_common.mako" import="render_individual_tagging_element, render_community_tagging_element" /> <%namespace file="/display_common.mako" import="*" /> +<%namespace file="webapps/galaxy/history/history_panel.mako" import="history_panel_javascripts" /> ## ## Functions used by base.mako and base_panels.mako to display content. @@ -34,7 +35,7 @@ ${parent.javascripts()} ${h.js( "libs/jquery/jstorage", "libs/jquery/jquery.autocomplete", "libs/jquery/jquery.rating", "galaxy.autocom_tagging" )} - + ${history_panel_javascripts()} ${h.js( "galaxy.panels", "libs/jquery/jstorage", "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel", "libs/jquery/jquery-ui", "libs/require", "libs/farbtastic" )}