orbit-basic/app/views/admin/users_new_interface/_role.html.erb

102 lines
3.4 KiB
Plaintext
Raw Normal View History

2013-08-09 07:07:05 +00:00
<div id="roles-area" class="input-area">
2013-01-14 10:19:14 +00:00
2013-08-09 07:07:05 +00:00
<% role_disable = @user.roles.include?(role) ? false : true %>
2013-01-14 10:19:14 +00:00
2013-08-09 07:07:05 +00:00
<div class="attributes <%= role_disable ? 'disabled' : '' %>">
<div class="attributes-header clearfix">
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= role_disable ? 'disabled' : '' %>">
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
<label><b></b></label>
</div>
</div>
<h4><%= role.title %><%= t(:role_info)%></h4>
</div>
2013-08-09 07:07:05 +00:00
<div class="attributes-body" style="display: <%= role_disable ? 'none' : 'block' %>;" >
2013-08-09 07:07:05 +00:00
<% @form_index = @form_index +1 %>
2013-08-09 07:07:05 +00:00
<div class="control-group">
<%= label_tag t(:status), nil, {:func=>"field_label", :for=>"1", :class=>"control-label muted"} %>
<div class="controls">
<% role.role_statuses.where(:disable => false).each_with_index do |rrs, i|%>
<%= hidden_field_tag("user[role_status][id][#{rrs.id}]", false,:for=>"#{@form_index}")%>
<%= label_tag(i,check_box_tag( "user[role_status][id][#{rrs.id}]", true, @user.role_statuses.include?(rrs))+rrs.title,:class=>"checkbox inline") %>
<% end %>
</div>
</div>
2013-08-09 07:07:05 +00:00
<% @form_index = @form_index +1 %>
2013-08-09 07:07:05 +00:00
<div class="control-group">
<%= label_tag t(:category), nil, {:func=>"field_label", :for=>"1", :class=>"control-label muted"} %>
<div class="controls">
<% role.role_categorys.where(:disable => false).each_with_index do |rrcg, i|%>
<%= hidden_field_tag("user[role_category][id][#{rrcg.id}]", false,:for=>"#{@form_index}")%>
<%= label_tag(i,check_box_tag( "user[role_category][id][#{rrcg.id}]", true, @user.role_categorys.include?(rrcg))+rrcg.title,:class=>"checkbox inline") %>
<% end %>
</div>
</div>
2012-10-15 05:54:29 +00:00
2013-08-09 07:07:05 +00:00
<% role.attribute_fields.asc(:_id).each do |rf|%>
<%= rf.block_helper(@user,@form_index)%>
<% @form_index = @form_index +1 %>
<% end %>
<% @form_index = @form_index +1 %>
<div id="roles-area" class="input-area">
<% role.sub_roles.where(:disabled=>false).asc("_id").each do |sub_role| %>
<% sub_role_disable = @user.sub_roles.include?(sub_role) ? false : true %>
<div class="attributes <%= sub_role_disable ? 'disabled' : '' %>">
<div class="attributes-header clearfix">
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= sub_role_disable ? 'disabled' : '' %>">
<%= hidden_field_tag("user[disable_sub_role][id][#{sub_role.id}]",sub_role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>sub_role_disable)%>
<label><b></b></label>
</div>
</div>
<h4><%= sub_role.title %><%= t(:role_info)%></h4>
</div>
<div class="attributes-body" style="display: <%= sub_role_disable ? 'none' : 'block' %>;">
<% sub_role.attribute_fields.asc(:_id).each do |af|%>
<%= af.block_helper(@user,@form_index)%>
<% @form_index = @form_index +1 %>
<% end %>
</div>
</div>
<% end %>
</div>
</div>
2012-10-15 05:54:29 +00:00
</div>
2013-08-09 07:07:05 +00:00
</div>