From cebaab33131c0ba67af95b26cb1e232aaa699cf4 Mon Sep 17 00:00:00 2001 From: Nate Coraor Date: Mon, 20 Jun 2011 17:02:51 -0400 Subject: [PATCH] Add the download/save icon to errored datasets which contain data. Fixes #207 and #583. --- templates/root/history_common.mako | 52 ++++++++++++++++++------------ 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/templates/root/history_common.mako b/templates/root/history_common.mako index 3c106df5222..86ef72a9ed3 100644 --- a/templates/root/history_common.mako +++ b/templates/root/history_common.mako @@ -1,9 +1,35 @@ <% _=n_ %> + +<%def name="render_download_links( data, dataset_id )"> + <% + from galaxy.datatypes.metadata import FileParameter + %> + %if not data.purged: + ## Check for downloadable metadata files + <% meta_files = [ k for k in data.metadata.spec.keys() if isinstance( data.metadata.spec[k].param, FileParameter ) ] %> + %if meta_files: +
+ Download Dataset + Additional Files + %for file_type in meta_files: + Download ${file_type} + %endfor +
+ + %endif + %endif + + ## Render the dataset `data` as history item, using `hid` as the displayed id <%def name="render_dataset( data, hid, show_deleted_on_refresh = False, for_editing = True, display_structured = False )"> <% dataset_id = trans.security.encode_id( data.id ) - from galaxy.datatypes.metadata import FileParameter if data.state in ['no state','',None]: data_state = "queued" @@ -126,6 +152,9 @@
+ %if data.has_data(): + ${render_download_links( data, dataset_id )} + %endif %if for_editing: @@ -169,26 +198,7 @@ %endif
%if data.has_data(): - %if not data.purged: - ## Check for downloadable metadata files - <% meta_files = [ k for k in data.metadata.spec.keys() if isinstance( data.metadata.spec[k].param, FileParameter ) ] %> - %if meta_files: -
- Download Dataset - Additional Files - %for file_type in meta_files: - Download ${file_type} - %endfor -
- - %endif - %endif + ${render_download_links( data, dataset_id )}