From 46a5aaeabe436b656d238a8755388baae2096ea5 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Thu, 14 Oct 2010 12:26:40 -0700 Subject: [PATCH] [#4647] Split the hours and estimates in the Deliverable details row --- app/views/deliverables/_details_row.html.erb | 26 +++++++++++++++++--- config/locales/en.yml | 1 + test/integration/contracts_show_test.rb | 15 ++++++----- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/app/views/deliverables/_details_row.html.erb b/app/views/deliverables/_details_row.html.erb index 125f118..efd240c 100644 --- a/app/views/deliverables/_details_row.html.erb +++ b/app/views/deliverables/_details_row.html.erb @@ -39,6 +39,7 @@ <%= l(:field_spent) %> <%= l(:field_budget) %> <%= l(:field_hours) %> + <%= l(:field_estimated) %> @@ -47,6 +48,7 @@ + @@ -56,8 +58,11 @@ <%= h(format_value_field_for_contracts(deliverable.labor_budget_spent(validated_period))) %> <%= h(format_value_field_for_contracts(deliverable.labor_budget_total(validated_period))) %> + + <%= h(format_value_field_for_contracts(deliverable.labor_hours_spent_total(validated_period))) %> <%= l(:text_short_hours) %> + - <%= h(format_value_field_for_contracts(deliverable.labor_hours_spent_total(validated_period))) %>/<%= h(format_value_field_for_contracts(deliverable.labor_budget_hours(validated_period))) %> <%= l(:text_short_hours) %> + <%= h(format_value_field_for_contracts(deliverable.labor_budget_hours(validated_period))) %> <%= l(:text_short_hours) %> @@ -66,8 +71,11 @@ <%= h(format_value_field_for_contracts(deliverable.overhead_spent(validated_period))) %> <%= h(format_value_field_for_contracts(deliverable.overhead_budget_total(validated_period))) %> + + <%= h(format_value_field_for_contracts(deliverable.overhead_hours_spent_total(validated_period))) %> <%= l(:text_short_hours) %> + - <%= h(format_value_field_for_contracts(deliverable.overhead_hours_spent_total(validated_period))) %>/<%= h(format_value_field_for_contracts(deliverable.overhead_budget_hours(validated_period))) %> <%= l(:text_short_hours) %> + <%= h(format_value_field_for_contracts(deliverable.overhead_budget_hours(validated_period))) %> <%= l(:text_short_hours) %> @@ -80,6 +88,7 @@ <%= h(format_value_field_for_contracts(fixed_budget.budget)) %> + <% end %> @@ -91,6 +100,8 @@ <%= h(format_value_field_for_contracts(deliverable.fixed_markup_budget_total(validated_period))) %> + + <% end %> @@ -101,6 +112,8 @@ <%= h(format_value_field_for_contracts(deliverable.profit_budget(validated_period))) %> + + <%= l(:field_total) %>: @@ -110,10 +123,15 @@ <%= h(format_value_field_for_contracts(deliverable.total(validated_period))) %> - + - <%= h(format_value_field_for_contracts(deliverable.hours_spent_total(validated_period))) %>/<%= h(format_value_field_for_contracts(deliverable.estimated_hour_budget_total(validated_period))) %> <%= l(:text_short_hours) %> + <%= h(format_value_field_for_contracts(deliverable.hours_spent_total(validated_period))) %> <%= l(:text_short_hours) %> + + + + + <%= h(format_value_field_for_contracts(deliverable.estimated_hour_budget_total(validated_period))) %> <%= l(:text_short_hours) %> diff --git a/config/locales/en.yml b/config/locales/en.yml index ac89ba6..54ae01b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -77,3 +77,4 @@ en: field_profit: Profit text_error_message_orphaned_time: "There is {{amount}} worth of time clocked to issues that are not assigned to any deliverables." text_error_message_update_orphaned_time: "Please update the orphaned issues." + field_estimated: Estimated diff --git a/test/integration/contracts_show_test.rb b/test/integration/contracts_show_test.rb index f39e34f..b690c16 100644 --- a/test/integration/contracts_show_test.rb +++ b/test/integration/contracts_show_test.rb @@ -331,7 +331,8 @@ class ContractsShowTest < ActionController::IntegrationTest visit_contract_page(@contract) assert_select "table#deliverables" do - assert_select "td.labor_hours", :text => /10\/100/ + assert_select "td.labor_hours_spent", :text => /10/ + assert_select "td.labor_hours", :text => /100/ end end @@ -365,7 +366,8 @@ class ContractsShowTest < ActionController::IntegrationTest visit_contract_page(@contract) assert_select "table#deliverables" do - assert_select "td.overhead_hours", :text => /5\/100/ + assert_select "td.overhead_hours_spent", :text => /5/ + assert_select "td.overhead_hours", :text => /100/ end end @@ -408,7 +410,8 @@ class ContractsShowTest < ActionController::IntegrationTest visit_contract_page(@contract) assert_select "table#deliverables" do - assert_select "td.total_hours", :text => /15\/200/ + assert_select "td.total_hours_spent", :text => /15/ + assert_select "td.total_hours", :text => /200/ end end @@ -489,9 +492,9 @@ class ContractsShowTest < ActionController::IntegrationTest assert_select '#deliverables .labor_budget_spent.overage' assert_select '#deliverables .overhead_budget_spent.overage' assert_select '#deliverables .profit_spent.overage' - assert_select '#deliverables .labor_hours .overage' - assert_select '#deliverables .overhead_hours .overage' - assert_select '#deliverables .total_hours .overage' + assert_select '#deliverables .labor_hours_spent .overage' + assert_select '#deliverables .overhead_hours_spent .overage' + assert_select '#deliverables .total_hours_spent .overage' end