%h1

= "#{@flow_task.type.to_s.underscore.humanize} #{@flow_task.id}"

%table.stacked.simple

%tr
  %th Created by
  %td
    - if current_user.id == @flow_task.user_id
      you
    - else
      = @flow_task.user
%tr
  %th Created at
  %td= @flow_task.created_at
%tr
  %th Started at
  %td= @flow_task.started_at
%tr
  %th Finished at
  %td= @flow_task.finished_at
- unless @flow_task.options.blank?
  %tr
    %th Options
    %td
      %pre
        = @flow_task.options.inspect
- unless @flow_task.command.blank?
  %tr
    %th Command
    %td= @flow_task.command
- unless @flow_task.error_msg.blank?
  %tr
    %th Error
    %td.error.status
      = @flow_task.error_msg
%tr
  %th Inputs
  %td
    %ul
      - for input in @flow_task.inputs
        %li
          - if input.resource
            = link_to "#{input.resource_type}: #{input.resource.to_param}", input.resource
          - else
            = link_to input.file_file_name, input.file.url
%tr
  %th Outputs
  %td
    %ul
      - for output in @flow_task.outputs
        %li
          - if output.resource
            = link_to "#{output.resource_type}: #{output.resource.to_param}", input.resource
          - else
            = link_to output.file_file_name, output.file.url
- unless @flow_task.redirect_url.blank?
  %th Redirect URL
  %td
    = link_to flow_task_redirect_url(@flow_task), flow_task_redirect_url(@flow_task)