<% title _("Subnets") %>

<%= javascript 'subnets' %>
<% title_actions display_link_if_authorized(_("New Subnet"), hash_for_new_subnet_path) %>

<table class="table table-bordered table-striped table-two-pane table-fixed">
  <thead>
    <tr>
      <th class="col-md-3"><%= sort :name, :as => s_("Subnet|Name") %></th>
      <th class="col-md-2"><%= sort :network, :as => s_("Subnet|Network") %></th>
      <th class="col-md-3"><%= _("Domains") %></th>
      <th class="col-md-1"><%= sort :vlanid, :as => s_('Subnet|Vlanid') %></th>
      <th class="col-md-2"><%= _("DHCP Proxy") %></th>
      <th><%= _('Actions') %></th>
    </tr>
  </thead>
  <tbody>
    <% @subnets.each do |subnet| %>
      <tr>
        <td class="display-two-pane ellipsis"><%=link_to_if_authorized subnet.name, hash_for_edit_subnet_path(:id => subnet).merge(:auth_object => subnet, :authorizer => authorizer) %></td>
        <td><%=subnet.network_address %></td>
        <td class="ellipsis"><%=subnet.domains.to_sentence %></td>
        <td><%=subnet.vlanid %></td>
        <td class="ellipsis"><%=subnet.dhcp %></td>
        <td class="col-md-1">
          <%= action_buttons(display_delete_if_authorized(
            hash_for_subnet_path(:id => subnet).
            merge(:auth_object => subnet, :authorizer => authorizer),
            :data => { :confirm => _("Delete %s?") % subnet.name })) %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
<%= will_paginate_with_info @subnets %>
