<% if @deliverable.new_record? %>

<%= f.select :kind, [[l(:label_cost_based_deliverable), CostBasedDeliverable.name], [l(:label_fixed_deliverable), FixedDeliverable.name]], {:required => true, :prompt => true }, :autocomplete => 'off' %>

<%= observe_field :deliverable_kind, :url => { :action => :new }, :update => :content, :with => "Form.serialize('deliverable-form')" %>
<% end %>

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

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

<% if @deliverable.kind == "CostBasedDeliverable" -%>
<%= l(:caption_material_budget) %> <% if User.current.allowed_to?(:view_unit_price, @project)%><%end%> <%- @deliverable.deliverable_costs.each_with_index do |deliverable_cost, index| -%> <%= render :partial => 'deliverable_cost', :object => deliverable_cost, :locals => {:index => index, :classes => cycle('odd', 'even')} %> <%- end -%>
<%= l(:caption_cost_unit_plural)%> <%= l(:caption_cost_type) %> <%= l(:label_comment) %><%= l(:caption_budget) %>
<%= link_to_function l(:button_add_material_cost), "deliverableCostsForm.add()", {:class => "icon icon-add"} %>
<%= l(:caption_labor_budget) %> <% if User.current.allowed_to?(:view_all_rates, @project) || User.current.allowed_to?(:view_own_rate, @project) %> <% end %> <%- @deliverable.deliverable_hours.each_with_index do |deliverable_hour, index| -%> <%= render :partial => 'deliverable_hour', :object => deliverable_hour, :locals => {:index => index, :classes => cycle('odd', 'even')} %> <%- end -%>
<%= l(:field_hours)%> <%= l(:label_user) %> <%= l(:label_comment) %><%= l(:caption_budget) %>
<%= link_to_function l(:button_add_labor_cost), "deliverableHoursForm.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('deliverable_fixed_date') %>

<% if @deliverable.new_record? %>

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

<% end %> <%= wikitoolbar_for 'deliverable_description' %>