<% colspan = 1 %> <% colspan += 1 unless @rev_record_1.nil? %> <% colspan += 1 unless @rev_record_2.nil? %> <%= as_(:revision) %> <%= as_(:current) %>
(<%= @record.updated_at %>) <% unless @rev_record_1.nil? %> <%= time_ago_in_words(@rev_record_1.updated_at) %> ago
(<%= @rev_record_1.updated_at %>) <% end %> <% unless @rev_record_2.nil? %> <%= time_ago_in_words(@rev_record_2.updated_at) %> ago
(<%= @rev_record_2.updated_at %>) <% end %> <% number_of_compare_cells = 0 %> <% columns.each :for => @record do |column| %> <%#= "" if number_of_compare_cells % 2 == 0 %> <% if column.plural_association? -%> <% save_record = @record %> <%= column.label -%>: <% save_rev_record_1 = @rev_record_1 %> <% save_rev_record_2 = @rev_record_2 %> <% # New or changed associations %> <% @record.send(column.association.name).each do |record| %> <% @rev_record_1 = nil %> <% @rev_record_1 = save_rev_record_1.send(column.association.name)[record.id] if save_rev_record_1 %> <% @rev_record_2 = nil %> <% @rev_record_2 = save_rev_record_2.send(column.association.name)[record.id] if save_rev_record_2 %> <% @record = record %> <% begin %> <%= render :partial => 'revision_columns', :locals => {:columns => active_scaffold_config_for(column.association.klass).revision.columns} -%> <% rescue Exception => e %> <%= column.association.class_name + ":" + e.message %> <% end %> <% end -%>
<% @record = save_record %> <% @rev_record_1 = save_rev_record_1 %> <% @rev_record_2 = save_rev_record_2 %> <% else -%> <%= column.label -%>: <% column.inplace_edit = false %> <% revision_value = get_column_value(@record, column) -%> <% revision_1_value = get_column_value(@rev_record_1, column) if @rev_record_1 -%> <% revision_2_value = get_column_value(@rev_record_2, column) if @rev_record_2 -%> <% current_attributes = "class=\"current_compare_cell\"" %> <% attributes = "class=\"right_compare_cell\"" %> <% revision_1_attributes = revision_2_attributes = nil %> <% revision_1_attributes = "class=\"right_compare_cell_changed\" title=\"#{revision_1_value}\"" unless @rev_record_1.nil? or revision_1_value.nil? or revision_value == revision_1_value %> <% revision_2_attributes = "class=\"right_compare_cell_changed\" title=\"#{revision_2_value}\"" unless @rev_record_2.nil? or revision_2_value.nil? or revision_1_value.nil? or revision_1_value == revision_2_value %> ><%= revision_value -%>   <% unless @rev_record_1.nil? %> ><%= revision_1_value -%>   <% end %> <% unless @rev_record_2.nil? %> ><%= revision_2_value -%>   <% end %> <% end -%> <% end -%>