Ray's back-end modifications for sub-roles

This commit is contained in:
Christophe Vilayphiou committed 2011-12-28 20:57:18 +08:00
1 parent 62aaf79491
commit 75c9851dbc
10 files changed
+83 -35

No files matched your search

@@ -15,9 +15,8 @@
<%= f.select "select_list_options", attribute_field.select_list_options, :style => "width:130px" %>
</div>
</td>
<td>
<span class="action">
<% if attribute_field.new_record? %>
<td class="action">
<% if attribute_field.new_record? %>
<a href="#" class="delete"><%= t(:delete) %></a>
<% else %>
<%= f.hidden_field :id %>
@@ -25,10 +24,9 @@
<a href="#" class="switch" id="<%= attribute_field.id %>"></a>
<%= f.hidden_field :disabled, :value => attribute_field.is_disabled? , :class => 'built_in_state' %>
<% else %>
<a href="#" class="remove_existing_record"><%= t(:delete) %></a>
<a href="#" class="remove_existing_record delete"><%= t(:delete) %></a>
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
<% end %>
<% end %>
</span>
</td>
</tr>
+1 -1
View File
@@ -42,7 +42,7 @@
</thead>
<tfoot>
<tr>
<td colspan="5">
<td colspan="6">
<%= hidden_field_tag 'attribute_field_count', @attribute.attribute_fields.count %>
<a href="#" class="add"><%= t(:add) %></a>
</td>
+3 -1
View File
@@ -1,5 +1,6 @@
<div class="attributes_block <%= @class %>">
<h2><%= t("admin.#{@attribute_type}") %></h2>
<hr>
<div class="info_input">
<table border="0" cellspacing="0" cellpadding="0">
<thead class="list_head">
@@ -26,13 +27,14 @@
<div id='sub_roles' class="attributes_block <%= @class %>">
<h2>Sub roles</h2>
<hr>
<% @attribute.sub_roles.each_with_index do |sub_role, i| %>
<%= render :partial => 'form_sub', :object => sub_role, :locals => {:f => f, :i => i} %>
<% end %>
</div>
</div>
<div id='add_sub_role' class="info_input attributes_block">
<div id='add_sub_role'>
<%= hidden_field_tag 'attribute_field_count', @attribute.sub_roles.count %>
<a href="#" class="add"><%= t(:add) %></a>
</div>
+7 -6
View File
@@ -1,4 +1,3 @@
<div class="info_input">
<table border="0" cellspacing="0" cellpadding="0">
<thead class="list_head">
@@ -20,7 +19,7 @@
</tr>
</tbody>
</table>
<div class="attributes_block <%= @class %>">
<div class="group">
<h2>Attributes</h2>
<div class="info_input">
<table class="sub_role_attributes" border="0" cellspacing="0" cellpadding="0">
@@ -37,10 +36,12 @@
</thead>
<tfoot>
<tr>
<td id='add_attribute' colspan="5">
<%= hidden_field_tag 'attribute_field_count', sub_role.attribute_fields.count %>
<a href="#" class="add"><%= t(:add) %></a>
<%= hidden_field_tag 'sub_role_temp_id', (i rescue 'new_sub_roles') %>
<td colspan="6">
<div id='add_attribute'>
<%= hidden_field_tag 'attribute_field_count', sub_role.attribute_fields.count %>
<a href="#" class="add"><%= t(:add) %></a>
<%= hidden_field_tag 'sub_role_temp_id', (i rescue 'new_sub_roles') %>
</div>
</td>
</tr>
</tfoot>
+1 -1
View File
@@ -28,7 +28,7 @@
<% @roles.each do |role| %>
<div id="<%= role.id %>_block" class="attributes_block <%= @class %>" <%= raw(' style="display: none;"') unless ((@user.role.id.eql?(role.id) rescue nil) || (role.key.eql?('student') && @user.new_record?)) %>>
<h2><%= role.i18n_variable[I18n.locale] %></h2>
<hr>
<hr class="<#%= @user.role.key %>_block">
<%= render :partial => 'sub_role_selector', :locals => {:f => f, :role => role} %>
<%= render :partial => 'sub_role', :collection => role.sub_roles, :locals => {:f => f, :role => role} %>
</div>
@@ -1,4 +1,4 @@
<div id="sub_role_<%= show_sub_role.id %>" class="info_input">
<div id="sub_role_<%= show_sub_role.id %>" class="group">
<h2><%= show_sub_role.i18n_variable[I18n.locale] %></h2>
<%= render :partial => 'show_attribute', :object => show_sub_role %>
</div>
+5 -3
View File
@@ -1,5 +1,6 @@
<div id="sub_role_<%= sub_role.id %>" class="info_input" <%= raw(' style="display: none;"') unless @user.sub_role_ids.include?(sub_role.id) %>>
<h2><%= sub_role.i18n_variable[I18n.locale] %></h2>
<div id="sub_role_<%= sub_role.id %>" class="group" <%= raw(' style="display: none;"') unless @user.sub_role_ids.include?(sub_role.id) %>>
<h2><%= sub_role.i18n_variable[I18n.locale] %></h2>
<div class="info_input">
<table border="0" cellspacing="0" cellpadding="0">
<thead class="list_head">
<tr>
@@ -34,4 +35,5 @@
<% end %>
</tbody>
</table>
</div>
</div>
</div>
+2 -2
View File
@@ -20,9 +20,9 @@
</div>
<% end -%>
<div id="<%= @user.role.key %>_block" class="roles_block <%= @class %>">
<div id="basic_block" class="roles_block <%= @class %>">
<h2><%= @user.role.i18n_variable[I18n.locale] %></h2>
<hr>
<hr class="<%= @user.role.key %>_block">
<%= render :partial => 'show_sub_role', :collection => @user.sub_roles %>
</div>
<div class="button_bar">