<!-- Run workflow button -->
<li>
  <%= image_tag_for_key('run_workflow', taverna_player.new_run_path(:workflow_id => workflow, :version => version), nil, nil, "Run #{human_name}") -%>
</li>

<!-- Run new data sweep button -->
<li>
    <%= image_tag_for_key('sweep', new_sweep_path(:workflow_id => workflow.id), nil, nil, "Run Data Sweep") -%>
</li>

<!-- Manage button -->
<% if workflow.can_manage? -%>
    <li><%= image_tag_for_key('manage', edit_workflow_path(workflow, :version => version), nil, nil, "Manage #{human_name}") -%></li>
<% end -%>

<!-- Download button -->
<% display_workflow = workflow.find_version(version) %>

<% if display_workflow.contains_downloadable_items? && display_workflow.is_downloadable? -%>
    <%# param code is used for temporary link -%>
    <% if can_download_asset?(workflow, params[:code]) -%>
        <%
           path = polymorphic_path(workflow,:version=>version,:action=>:download,:code=>params[:code])
        %>
        <li>
          <%= image_tag_for_key('download', path, "Download #{human_name}", nil, "Download #{human_name}") -%>
        </li>
    <% end -%>
<% end -%>

<!-- Run workflow button -->
<li>
  <%= image_tag_for_key('run_workflow', taverna_player.new_run_path(:workflow_id => workflow, :version => version), nil, nil, "Run #{human_name}") -%>
</li>

<!-- Run new data sweep button - only if there is at least on data port to sweep over. -->
<li>
    <%= image_tag_for_key('sweep', new_sweep_path(:workflow_id => workflow.id), nil, nil, "Run Data Sweep") if workflow.input_ports.select{|port| (port.port_type.name == WorkflowInputPortType::DATA)}.length > 0 -%>
</li>

<!-- Manage button -->
<% if workflow.can_manage? -%>
    <li><%= image_tag_for_key('manage', edit_workflow_path(workflow, :version => version), nil, nil, "Manage #{human_name}") -%></li>
<% end -%>

<!-- Download button -->
<% display_workflow = workflow.find_version(version) %>

<% if display_workflow.contains_downloadable_items? && display_workflow.is_downloadable? -%>
    <%# param code is used for temporary link -%>
    <% if can_download_asset?(workflow, params[:code]) -%>
        <%
           path = polymorphic_path(workflow,:version=>version,:action=>:download,:code=>params[:code])
        %>
        <li>
          <%= image_tag_for_key('download', path, "Download #{human_name}", nil, "Download #{human_name}") -%>
        </li>
    <% end -%>
<% end -%>

Allow sweeps to be created from the workflows/show page only if there is at least one data port.
Allow sweeps to be created from the workflows/show page only if there is at least one data port.
