- if defined?(Foundation)
  = page_title :index, ExecutionBatch
  = search_form_for @q do |f|
    table.execution-batches.ui.compact.striped.table
      thead
        tr
          th= sort_link @q, :sti_type
          th= sort_link @q, :state
          th= sort_link @q, :created_at
          th= at :info_message
          th.actions
            i.icon-search
            = search_result_info @batches
        = search_row do
          th= f.select :sti_type_eq, ExecutionBatch.distinct.pluck(:sti_type), {include_blank: ' - '}, {class: 'input-small'}
          th= f.select :state_eq, ExecutionBatch.distinct.pluck(:state), {include_blank: ' - '},   {class: 'input-small'}
          th
            = f.text_field "created_at_gteq", placeholder: 'min', class: 'datepicker input-small'
            = f.text_field "created_at_lteq", placeholder: 'max', class: 'datepicker input-small'
          th= f.text_field :info_message_cont, placeholder: '~'
          th.column-filter.actions
            = f.submit t('dunlop.filter.apply').html_safe, class: 'submit-filters-button'
            = link_to dunlop.execution_batches_path(reset_q: true), class: 'clear-filters-button' do
              span== t('dunlop.filter.reset')
      tbody
        - @batches.each do |batch|
          tr
            td= link_to batch.model_name.human, dunlop.execution_batch_path(batch)
            td= batch.human_state_name
            td data-time=batch.created_at.iso8601 data-format="LLL"
            td= batch.info_message
            td= table_show_link batch, dunlop.execution_batch_path(batch)

  br
  = paginate @batches
- else
  .ui.container
    = page_title :index, ExecutionBatch
    = search_form_for(@q, html: {class: 'ui form'}) do |f|
      table.execution-batches.ui.compact.striped.table
        thead
          tr
            th= sort_link @q, :sti_type
            th= sort_link @q, :state
            th= sort_link @q, :created_at
            th= at :info_message
            th.actions
              i.icon-search
              = search_result_info @batches
          = search_row do
            th= f.select :sti_type_eq, ExecutionBatch.distinct.pluck(:sti_type), {include_blank: ' - '}, {class: 'input-small'}
            th= f.select :state_eq, ExecutionBatch.distinct.pluck(:state), {include_blank: ' - '},   {class: 'input-small'}
            th
              .ui.mini.input= f.text_field "created_at_gteq", placeholder: 'min', class: 'datepicker input-small'
              .ui.mini.input= f.text_field "created_at_lteq", placeholder: 'max', class: 'datepicker input-small'
            th= f.text_field :info_message_cont, placeholder: '~'
            th.column-filter.actions
              button.ui.small.primary.icon.button.submit-filters-button
                i.filter.icon
              = link_to dunlop.source_files_path(reset_q: true), class: 'clear-filters-button ui basic yellow small icon button'
                i.undo.icon
        tbody
          - @batches.each do |batch|
            tr
              td= link_to batch.model_name.human, dunlop.execution_batch_path(batch)
              td= batch.human_state_name
              td data-time=batch.created_at.iso8601 data-format="LLL"
              td= batch.info_message
              td= table_show_link batch, dunlop.execution_batch_path(batch)

    br
    = paginate @batches
