<%= form_tag buyer_bulk_approval_path, :method => :put, :id => 'bulk-action' do %>

<%= submit_tag "Approve Selected", :class => 'action' %> | <%= submit_tag "Reject Selected", :class => 'action' %>

<table class="data" id="accounts">
  <thead>
    <tr>
      <th></th>
      <th>Org Name</th>
      <th>Admin</th>
      <th></th>
      <th>Created on</th>
      <th>&nbsp;</th>
    </tr>
  </thead>

  <tbody>
    <% accounts.each do | account | %>
      <tr id="<%= dom_id(account) %>" title="<%= account.state.to_s %>">
        <td><%= check_box_tag 'account_ids[]',account.id, false, :id => "account_bulk_#{account.id}" %></td>
        <td><%= link_to account.org_name, buyer_account_path(account), :class => 'action view' %></td>
        <td><%= link_to((accounts.first.human_or_display_name), buyer_account_user_path(account, account.admin), :title => "View Details") %></td>
        <td><%= account.admins.first.email %></td>
        <td><%= account.created_at.to_date.to_s(:long) %></td>
        <td><%= link_to_edit_partner_account account %>	|
        <%= link_to('Destroy', partner_path(account),
                    data: {:confirm => 'Are you sure?'}, :method => :delete, :id => "destroy-account-#{account.id}")
         %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= will_paginate accounts %>

<%= submit_tag "Approve Selected", :class => 'action' %> | <%= submit_tag "Reject Selected", :class => 'action' %>

<% end %>

