<%= f.hidden_field :kind %> <%# if @cost_object.new_record? %> <% if false %>

<%= f.select :kind, [[l(:label_variable_cost_object), VariableCostObject.name], [l(:label_fixed_cost_object), FixedCostObject.name]], {:required => true, :prompt => true }, :autocomplete => 'off' %>

<%= observe_field :cost_object_kind, :url => { :action => :new }, :update => :content, :with => "Form.serialize('cost_object_form')", :before => "confirmChangeType('#{l(:text_cost_object_change_type_confirmation)}', $('cost_object_kind'), '#{@cost_object.kind.to_s}')" %>
<% end %>

<%= f.text_field :subject, :size => 80, :required => true %>

<%= f.text_area :description, :cols => 60, :rows => (@cost_object.description.blank? ? 10 : [[10, @cost_object.description.length / 50].max, 100].min), :accesskey => accesskey(:edit), :class => 'wiki-edit' %>

<% if @cost_object.kind == "VariableCostObject" -%>
<%= l(:caption_material_budget) %> <% if User.current.allowed_to?(:view_cost_rates, @project)%><%end%> <%- @cost_object.material_budget_items.each_with_index do |material_budget_item, index| -%> <%= render :partial => 'material_budget_item', :object => material_budget_item, :locals => {:index => index, :classes => cycle('odd', 'even')} %> <%- end -%>
<%= MaterialBudgetItem.human_attribute_name(:units) %> <%= MaterialBudgetItem.human_attribute_name(:cost_type) %> <%= MaterialBudgetItem.human_attribute_name(:comment) %><%= MaterialBudgetItem.human_attribute_name(:budget) %>
<%= link_to_function l(:button_add_budget_item), "materialBudgetItemsForm.add()", {:class => "icon icon-add"} %>
<%= l(:caption_labor_budget) %> <% if User.current.allowed_to?(:view_hourly_rates, @project) %> <% end %> <%- @cost_object.labor_budget_items.each_with_index do |labor_budget_item, index| -%> <%= render :partial => 'labor_budget_item', :object => labor_budget_item, :locals => {:index => index, :classes => cycle('odd', 'even')} %> <%- end -%>
<%= LaborBudgetItem.human_attribute_name(:hours) %> <%= LaborBudgetItem.human_attribute_name(:user) %> <%= LaborBudgetItem.human_attribute_name(:comment) %><%= LaborBudgetItem.human_attribute_name(:budget) %>
<%= link_to_function l(:button_add_budget_item), "laborBudgetItemsForm.add()", {:class => "icon icon-add"} %>
<%- end %>

<%= f.check_box(:project_manager_signoff) %>

<%= f.check_box(:client_signoff) %>

<%= f.text_field :fixed_date, :size => 10 %><%= calendar_for('cost_object_fixed_date') %>

<% if @cost_object.new_record? %>

<%= render :partial => 'attachments/form' %>

<% end %> <%= wikitoolbar_for 'cost_object_description' %> <% content_for :header_tags do %> <%= javascript_tag "initialize_editinplace('src=\"#{image_path('cancel.png')}\" alt=\"#{l(:button_cancel_edit_budget)}\" title=\"#{l(:button_cancel_edit_budget)}\"' )" %> <% end %>