Project

General

Profile

Download (2.04 KB) Statistics
| Branch: | Tag: | Revision:
<% title _("Filters") %>

<% title_actions link_to_if_authorized(_("New filter"), hash_for_new_filter_path(:role_id => @role)) %>

<table class="table table-bordered table-striped">
<thead>
<tr>
<% unless params[:role_id] %>
<th><%= sort :role, :as => _("Role") %></th>
<% end %>
<th><%= sort :resource, :as => s_("Filter|Resource") %></th>
<th><%= sort :search, :as => s_("Filter|Unlimited") %></th>
<th><%= sort :search, :as => s_("Filter|Search") %></th>
<th></th>
</tr>
</thead>
<tbody>
<% @filters.each do |filter| %>
<tr>
<% unless params[:role_id] %>
<td>
<%= content_tag('span', link_to_if_authorized(filter.role.name, hash_for_roles_path(:search => "name = #{filter.role.name}").
merge(:auth_object => filter.role, :authorizer => @roles_authorizer))) %>
</td>
<% end %>
<td><%= _(filter.resource_class.try(:humanize_class_name) || filter.resource_type || '(Miscellaneous)') %></td>
<td><%= checked_icon filter.unlimited? %></td>
<td>
<%= content_tag('span', link_to_if_authorized(filter.search || _('none'),
hash_for_edit_filter_path(:id => filter, :role_id => @role).
merge(:auth_object => filter, :authorizer => authorizer))) %>
</td>
<td>
<%= action_buttons(
display_link_if_authorized(_("Edit"), hash_for_edit_filter_path(:id => filter, :role_id => @role).
merge(:auth_object => filter, :authorizer => authorizer)),
display_delete_if_authorized(hash_for_filter_path(:id => filter, :role_id => @role).
merge(:auth_object => filter, :authorizer => authorizer),
:confirm => (_("Delete filter?")))
)
%>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= page_entries_info @filters %>
<%= will_paginate @filters %>
(3-3/4)