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

95 lines
3.0 KiB
Plaintext
Raw Permalink Normal View History

2013-08-30 08:47:44 +00:00
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">
2013-11-08 04:53:06 +00:00
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
2013-08-09 07:07:05 +00:00
<h4><%= role.title %><%= t(:role_info)%></h4>
</div>
2013-08-30 08:47:44 +00:00
<div class="attributes-body">
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 %>
2013-08-30 08:47:44 +00:00
<div class="input-area sub-role">
2013-08-09 07:07:05 +00:00
<% 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>
2013-08-30 08:47:44 +00:00
<div class="attributes-body">
2013-08-09 07:07:05 +00:00
<% 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