diff --git a/app/helpers/deliverables_helper.rb b/app/helpers/deliverables_helper.rb index e19afd9..d9ff59c 100644 --- a/app/helpers/deliverables_helper.rb +++ b/app/helpers/deliverables_helper.rb @@ -7,6 +7,6 @@ module DeliverablesHelper :class => "budget-calculation", :id => 'deliverable_' + field.to_s + '_subtotal' ) - ) + observe_field('deliverable_' + field.to_s, :function => "updateSubtotal('deliverable_#{field.to_s}'); updateBudget('deliverable_budget');") + ) + observe_field('deliverable_' + field.to_s, :function => "new Budget().updateSubtotal('deliverable_#{field.to_s}'); new Budget().updateBudget('deliverable_budget');") end end diff --git a/app/views/deliverables/_form.html.erb b/app/views/deliverables/_form.html.erb index a0e233f..19d8629 100644 --- a/app/views/deliverables/_form.html.erb +++ b/app/views/deliverables/_form.html.erb @@ -21,13 +21,13 @@

TODO: Fixed cost

<%= f.text_field :cost_per_hour, :size => 7 %>

- <%= observe_field('deliverable_cost_per_hour', :function => "updateBaseSubtotal(); updateBudget('deliverable_budget');") %> + <%= observe_field('deliverable_cost_per_hour', :function => "new Budget().updateBaseSubtotal(); new Budget().updateBudget('deliverable_budget');") %>

<%= f.text_field :total_hours, :size => 7 %> <%= content_tag(:span, 0, :class => "budget-calculation", :id => 'deliverable_base_subtotal') %>

- <%= observe_field('deliverable_total_hours', :function => "updateBaseSubtotal(); updateBudget('deliverable_budget');") %> + <%= observe_field('deliverable_total_hours', :function => "new Budget().updateBaseSubtotal(); new Budget().updateBudget('deliverable_budget');") %> <%= field_with_budget_observer_and_totals(f, :overhead) %> <%= field_with_budget_observer_and_totals(f, :materials) %> @@ -62,77 +62,118 @@ <% content_for :header_tags do %> <% end %> diff --git a/assets/stylesheets/budget.css b/assets/stylesheets/budget.css index f3a6faf..d91adea 100644 --- a/assets/stylesheets/budget.css +++ b/assets/stylesheets/budget.css @@ -9,5 +9,7 @@ tr.deliverable td.done_ratio table.progress { margin-left:auto; margin-right: au #deliverable-form .splitcontentleft { width: 62% } #deliverable-form .splitcontentright { width: 37% } +#deliverable-form .splitcontentright p { padding-right: 30px; } +#deliverable-form .splitcontentright input { float:left } -span.budget-calculation { color:#999999; font-weight:bold;} \ No newline at end of file +span.budget-calculation { color:#999999; font-weight:bold; display:block; text-align:right; width: 100%;} \ No newline at end of file