<%= t(:user) %>
<%= form_tag(submit_url) do %>
<%= collection_select(:new,:role, Role.all, :id, :key, :prompt => true) %>
<%= submit_tag t("auth.by_role") %>
<%= collection_select(:new,:sub_role, SubRole.all, :id, :key, :prompt => true) %>
<%= submit_tag t("auth.by_sub_role") %>
<%= collection_select(:new,:privilege_user, User.all, :id, :name, :prompt => true) %>
<%= submit_tag t("auth.add_to_privilege_list") %>
<%= collection_select(:new,:blocked_user, User.all, :id, :name, :prompt => true) %>
<%= submit_tag t("auth.add_to_block_list") %>
<% end %>
<% unless auth.nil? %>
<% auth.roles.each do |role| %>
<%= role.key %> <%= t(:built_in) %> :<%= role.built_in ? t(:yes_) : t(:no_) %>
<%= link_to '[X]',polymorphic_path(ploy_route_ary,:type=>'role',:target_id=>role.id),:method => :delete %>
<% end %>
<% auth.sub_roles.each do |role| %>
<%= role.key %> <%= t(:built_in) %> :<%= role.built_in ? t(:yes_) : t(:no_) %> <%= link_to '[X]',polymorphic_path(ploy_route_ary,:type=>'sub_role',:target_id=>role.id),:method => :delete %>
<% end %>
<% auth.privilege_users.each do |user| %>
<%= user.name %> <%= link_to '[X]',polymorphic_path(ploy_route_ary,:type=>'privilege_user',:target_id=>user.id),:method => :delete %>
<% end %>
<% auth.blocked_users.each do |user| %>
<%= user.name %><%= link_to '[X]',polymorphic_path(ploy_route_ary,:type=>'blocked_user',:target_id=>user.id),:method => :delete %>
<% end %>
<% end %>