User role and sub_role simple interface complete

This commit is contained in:
Matthew Fu authored and Christophe Vilayphiou committed 2012-01-24 12:28:33 +08:00
1 parent 25cbe0c2a5
commit afbb9e266a
4 files changed
+88 -12

No files matched your search

+36 -8
View File
@@ -6,9 +6,11 @@
<br />
<br />
<!-- Remove if CSS done-->
<h3><%= @module_app.title %></h3>
<div id="manager_management">
<h1><%= @module_app.title %></h1>
<h1>Manager</h1>
<dl id="manager">
<dt>Manager</ht>
<% @module_app.managers.each do |manager| %>
@@ -16,13 +18,11 @@
<% end %>
<dd>Add:
<%= form_tag(assign_manager_admin_module_app_path) do %>
<%= text_field_tag 'manager_id','Enter User ID here',:disabled => !if_permit_to_assign(:manager)%>
<%= collection_select(:manager,:id, User.all, :id, :name, :prompt => true,:disabled => !if_permit_to_assign(:manager))%>
<%= submit_tag 'Add Manager' %>
<% end %>
</dd>
</dl>
<dl id="sub_manager">
<dt>Sub Manager</ht>
<% @module_app.sub_managers.each do |manager| %>
@@ -30,12 +30,40 @@
<% end %>
<dd>Add:
<%= form_tag(assign_sub_manager_admin_module_app_path) do %>
<%= text_field_tag 'sub_manager_id','Enter User ID here',:disabled => !if_permit_to_assign(:sub_manager)%>
<%= collection_select(:sub_manager,:id, User.all, :id, :name, :prompt => true,:disabled => !if_permit_to_assign(:sub_manager))%>
<%= submit_tag 'Add Sub Manager' %>
<% end %>
</dd>
</dl>
</div>
<div id="user_role_management">
<h1>User Role</h1>
<%= form_tag(admin_module_app_app_auths_path(@module_app),: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 @module_app.app_auth.nil? %>
<% @module_app.app_auth.roles.each do |role| %>
<li> <%= role.key %> Build in:<%= role.built_in ? 'Yes' : 'No' %> <%= link_to '[X]',remove_admin_module_app_app_auth_path(@module_app,@module_app.app_auth,'role',role),:method => :delete %></li>
<% end %>
<ul>Sub Roles </ul>
<% @module_app.app_auth.sub_roles.each do |role| %>
<li> <%= role.key %> Build in:<%= role.built_in ? 'Yes' : 'No' %> </li><%= link_to '[X]',remove_admin_module_app_app_auth_path(@module_app,@module_app.app_auth,'sub_role',role),:method => :delete %>
<% end %>
<ul>PrivilegeList </ul>
<% @module_app.app_auth.privilege_users.each do |user| %>
<li> <%= user.name %> <%= link_to '[X]',remove_admin_module_app_app_auth_path(@module_app,@module_app.app_auth,'privilege_user',user),:method => :delete %> </li>
<% end %>
<ul>BlockedList </ul>
<% @module_app.app_auth.blocked_users.each do |user| %>
<li> <%= user.name %><%= link_to '[X]',remove_admin_module_app_app_auth_path(@module_app,@module_app.app_auth,'blocked_user',user),:method => :delete %> </li>
<% end %>
<% end %>
</div>