This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/views/admin/components/_user_role_management.html.erb

34 lines
1.7 KiB
Plaintext
Raw Normal View History

<div id="user_role_management">
<%#= debugger %>
<h1>User Role</h1>
<%= debugger %>
<%= form_tag(polymorphic_path([controller_path.split('/')[0],object,auth.class.name.underscore]),:method => :post) do %>
<%= collection_select(:new,:role, Role.all, :id, :key, :prompt => true) %>
<%= submit_tag 'Add Role' %><br/>
<%= collection_select(:new,:sub_role, SubRole.all, :id, :key, :prompt => true) %>
<%= submit_tag 'Add SubRole' %><br/>
<%= collection_select(:new,:privilege_user, User.all, :id, :name, :prompt => true) %>
<%= submit_tag 'Add PrivilegeList' %><br/>
<%= collection_select(:new,:blocked_user, User.all, :id, :name, :prompt => true) %>
<%= submit_tag 'Add BlockedList' %><br/>
<% end %>
<ul>Roles </ul>
<% unless auth.nil? %>
<% auth.roles.each do |role| %>
<li> <%= role.key %> Build in:<%= role.built_in ? 'Yes' : 'No' %>
<%= link_to '[X]',polymorphic_path(['remove',:admin,object,auth],:type=>'role',:target_id=>role.id),:method => :delete %></li>
<% end %>
<ul>Sub Roles </ul>
<% auth.sub_roles.each do |role| %>
<li> <%= role.key %> Build in:<%= role.built_in ? 'Yes' : 'No' %> </li><%= link_to '[X]',polymorphic_path(['remove',:admin,object,auth],: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(['remove',:admin,object,auth],: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(['remove',:admin,object,auth],:type=>'blocked_user',:target_id=>user.id),:method => :delete %> </li>
<% end %>
<% end %>
</div>