h2=t "workflow_step.actions_modal.title", model: record_class.model_name.human
- if batch = @workflow_instance_batch
  .display-row
    .display-label= batch.class.model_name.human
    .display-field
      = batch.presentation_name
      = "(#{@collection.size})"
.panel.workflow-step-workfow-instances-collection-container
  = safe_join @collection.map{|r| link_to(r.presentation_name, r, class: r.state) }, ', '
= simple_form_for @collection do |f|
  = f.collection_ids
  = f.error_notification
  - if can? :update, record_class
    .form-inputs= f.optional_input :bucket, input_html: {class: 'autocomplete', data: {source: record_class.available_bucket_names.to_json }}
    - if record_batch_class.present? and batch.blank? # do not offer to change batch if the collection is the batch itself
      .form-inputs= f.optional_input :workflow_instance_batch_id, collection: record_batch_class.for_select, label: record_batch_class.model_name.human
    .form-inputs= f.optional_input :plan_date, input_html: {class: 'datepicker'}
  .form-actions
    = link_to 'Back', @collection.one? ? @collection.first : record_class, class: 'workflow-step-back-button'
    - if can? :update, record_class
      = f.button :submit, 'Assign', class: 'workflow-step-assign-button'
    - if can?(:reset, record_class)
      = f.submit t('workflow_instance.reset.reset'), formaction: dunlop.reset_workflow_instances_path, class: "workflow-instance-reset-button right", data: {confirm: t('workflow_instance.reset.confirmation_message', workflow_instance: record_class.model_name.human)}
    - if can? :archive, record_class
      - if session[:archived_mode]
        = f.submit t('workflow_instance.revive.revive'), formaction: dunlop.revive_workflow_instances_path, class: "workflow-instance-revive-button right", data: {confirm: t('workflow_instance.revive.confirmation_message')}
      - else
        = f.submit t('workflow_instance.archive.archive'), formaction: dunlop.archive_workflow_instances_path, class: "workflow-instance-archive-button right", data: {confirm: t('workflow_instance.archive.confirmation_message')}
