%# This is ancient code, needs a lot of refactoring when I or someone can get around to it. In the meantime, it works. %>
<% title ||= name %>
<% container ||= '' %>
<% system_controlled = false if system_controlled.nil? %>
<% form_id ||= nil %>
<% attributes_key ||= nil %>
<% attributes = lookup_attributes(attributes_key) unless attributes_key.blank? %>
<% totals = Array.new(attributes.size) %>
<% total_columns ||= [] %>
<% total_columns.each {|total_column| totals[total_column - 1] = 0.00} %>
<%
begin
hidden_fields = "#{name.classify}::HIDDEN_FIELDS".constantize
rescue NameError, LoadError
hidden_fields = []
end
%>
<% if container.empty? %>
<% end %>
<% attributes.each do |attribute| %>
<% if not hidden_fields.include? attribute.to_sym %>
<% if attribute[-3..-1] == "_id" -%>
<%= attribute[0..-3].tr("_", " ").capitalize_words %>
<% else -%>
<%= attribute.tr("_", " ").split.each(&:capitalize!).join ' ' %>
<% end -%>
<% end -%>