<%= title(l(:label_role_plural)) -%>

<div class="autoscroll">
  <table class="list reorder">
    <thead>
    <tr>
      <th></th>
      <th><%= l(:label_role) %></th>
      <th><%= l(:field_description) %></th>
      <th></th>
    </tr>
    </thead>
    <tbody>
    <% @roles.each do |role| %>
      <tr class="<%= cycle("odd", "even") %> <%= role.builtin? ? "builtin" : "givable" %>">
        <td class="center reorder-handler"><%= render_reorder_handle(role, 'role', url_options: {page: params[:page]}) unless role.builtin? %></td>
        <td class="name"><%= content_tag(role.builtin? ? 'em' : 'span', link_to(role.name, edit_role_path(role))) %></td>
        <td class="description"><%= role.description %></td>
        <td class="buttons">
          <%= link_to l(:button_copy), new_role_path(:copy => role), :class => 'icon icon-copy' %>
          <%= delete_link role_path(role) unless role.builtin? %>
        </td>
      </tr>
    <% end %>
    </tbody>
  </table>
</div>

<span class="pagination"><%#= pagination_links_full @role_pages %></span>

<%#= render :partial => 'common/infinite_scroll' %>

<% ### PAGE CUSTOMS ##########################################################  -%>

<% html_title(l(:label_role_plural)) -%>
<% content_for :easy_page_layout_service_box_primary_actions do %>
  <%= link_to l(:label_role_new), {:action => 'new'}, :class => 'button-positive icon icon-add' %>
  <%= link_to l(:label_permissions_report), permissions_roles_path, :class => 'button icon icon-list' %>
<% end %>