%inherit file="/display_base.mako"/>
<%!
from galaxy.tools.parameters import DataToolParameter, RuntimeValue
from galaxy.web import form_builder
%>
<%def name="stylesheets()">
${parent.stylesheets()}
${h.css( "workflow" )}
%def>
<%def name="do_inputs( inputs, values, prefix, step, other_values=None )">
%for input_index, input in enumerate( inputs.itervalues() ):
%if input.type == "repeat":
${input.title_plural}
<% repeat_values = values[input.name] %>
%for i in range( len( repeat_values ) ):
<% index = repeat_values[i]['__index__'] %>
${input.title} ${i + 1}
${do_inputs( input.inputs, repeat_values[ i ], prefix + input.name + "_" + str(index) + "|", step, other_values )}
%endfor
%elif input.type == "conditional":
<% group_values = values[input.name] %>
<% current_case = group_values['__current_case__'] %>
<% new_prefix = prefix + input.name + "|" %>
${row_for_param( input.test_param, group_values[ input.test_param.name ], other_values, prefix, step )}
${do_inputs( input.cases[ current_case ].inputs, group_values, new_prefix, step, other_values )}
%else:
${row_for_param( input, values[ input.name ], other_values, prefix, step )}
%endif
%endfor
%def>
<%def name="row_for_param( param, value, other_values, prefix, step )">
<% cls = "form-row" %>
${param.get_label()}
%if isinstance( param, DataToolParameter ):
%if ( prefix + param.name ) in step.input_connections_by_name:
<%
conn = step.input_connections_by_name[ prefix + param.name ]
%>
Output dataset '${conn.output_name}' from step ${int(conn.output_step.order_index)+1}
%else:
select at runtime
%endif
%else:
${param.value_to_display_text( value, app )}
%endif
%def>
<%def name="render_item_links( workflow )">
Import workflow
%def>
<%def name="render_item( workflow, steps )">
<%
# HACK: Rendering workflow steps requires that trans have a history; however, if it's user's first visit to Galaxy is here, he won't have a history
# and an error will occur. To prevent this error, make sure user has a history.
trans.get_history( create=True )
%>
Step Annotation
%for i, step in enumerate( steps ):
%if step.type == 'tool' or step.type is None:
<% tool = app.toolbox.tools_by_id[step.tool_id] %>
%else:
## TODO: always input dataset?
<% module = step.module %>
%endif
%if hasattr( step, "annotation") and step.annotation is not None:
${step.annotation}
%endif
%endfor
%def>