Orbit/app/views/admin/components/_user_role_management.html.erb

38 lines
1.8 KiB
Plaintext
Raw Normal View History

2012-02-16 06:59:26 +00:00
<div id="open_for_all_user">
2012-09-12 11:12:50 +00:00
<h1><%= t("auth.all_member") %></h1>
2012-02-16 06:59:26 +00:00
<%= form_tag(submit_url) do %>
2012-09-12 11:12:50 +00:00
<%= check_box_tag 'auth_all',true,(auth.all rescue true) %><%= submit_tag t("auth.all_member") %><br/>
2012-02-16 06:59:26 +00:00
<% end %>
</div>
<div id="user_role_management">
2012-09-12 11:12:50 +00:00
<h1><%= t(:user) %></h1>
<%= form_tag(submit_url) do %>
<%= collection_select(:new,:role, Role.all, :id, :key, :prompt => true) %>
2012-09-12 11:12:50 +00:00
<%= submit_tag t("auth.by_role") %><br/>
<%= collection_select(:new,:sub_role, SubRole.all, :id, :key, :prompt => true) %>
2012-09-12 11:12:50 +00:00
<%= submit_tag t("auth.by_sub_role") %><br/>
<%= collection_select(:new,:privilege_user, User.all, :id, :name, :prompt => true) %>
2012-09-12 11:12:50 +00:00
<%= submit_tag t("auth.add_to_privilege_list") %><br/>
<%= collection_select(:new,:blocked_user, User.all, :id, :name, :prompt => true) %>
2012-09-12 11:12:50 +00:00
<%= submit_tag t("auth.add_to_block_list") %><br/>
<% end %>
<% unless auth.nil? %>
<% auth.roles.each do |role| %>
2012-11-27 03:15:15 +00:00
<li> <%= 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 %></li>
<% end %>
<ul>Sub Roles </ul>
<% auth.sub_roles.each do |role| %>
2012-11-27 03:15:15 +00:00
<li> <%= role.key %> <%= t(:built_in) %> :<%= role.built_in ? t(:yes_) : t(:no_) %> </li><%= link_to '[X]',polymorphic_path(ploy_route_ary,:type=>'sub_role',:target_id=>role.id),:method => :delete %>
<% end %>
<ul>PrivilegeList </ul>
<% auth.privilege_users.each do |user| %>
<li> <%= user.name %> <%= link_to '[X]',polymorphic_path(ploy_route_ary,:type=>'privilege_user',:target_id=>user.id),:method => :delete %> </li>
<% end %>
<ul>BlockedList </ul>
<% auth.blocked_users.each do |user| %>
<li> <%= user.name %><%= link_to '[X]',polymorphic_path(ploy_route_ary,:type=>'blocked_user',:target_id=>user.id),:method => :delete %> </li>
<% end %>
<% end %>
</div>