%table.index
  %thead
    %tr
      %th= "#{Spree.t('date')}/#{Spree.t('time')}"
      %th= t(:amount)
      %th= t(:payment_method)
      %th= t(:payment_state)
      %th.actions
  %tbody
    - payments.each do |payment|
      %tr{class: "#{cycle('odd', 'even')}"}
        %td= pretty_time(payment.created_at)
        %td.align-center= payment.display_amount.to_html
        %td.align-center
          - if payment.payment_method_id
            = link_to payment_method_name(payment), spree.admin_order_payment_path(@order, payment)
        %td.align-center
          %span{class: "state #{payment.state}"}= t(payment.state, scope: "spree.payment_states", default: payment.state.capitalize)
        %td.actions
          - payment.actions.each do |action|
            = link_to_with_icon "icon-#{action}", Spree.t(action), fire_admin_order_payment_path(@order, payment, e: action),
            no_text: true, data: { method: :put, action: action, disable_with: "" }
