diff --git a/app/helpers/deliverables_helper.rb b/app/helpers/deliverables_helper.rb index 592df33..ef93199 100644 --- a/app/helpers/deliverables_helper.rb +++ b/app/helpers/deliverables_helper.rb @@ -12,9 +12,20 @@ module DeliverablesHelper def paragraph_with_data(label, data) content_tag(:p, - content_tag(:span, label) + - h(data)) + content_tag(:span, label, :class => 'title') + + content_tag(:span, h(data), :class => 'data')) end + + def paragraph_with_double_data(label, data1, data2) + content_tag(:p, + content_tag(:span, label, :class => 'title') + + content_tag(:span, + content_tag(:span, h(data1), :class => 'left-data') + + content_tag(:span, h(data2), :class => 'right-data'), + :class => 'fake-table')) + + end + def allowed_management? return User.current.allowed_to?(:manage_budget, @project) diff --git a/app/views/deliverables/_budget.html.erb b/app/views/deliverables/_budget.html.erb index 5df1cd5..ba921b7 100644 --- a/app/views/deliverables/_budget.html.erb +++ b/app/views/deliverables/_budget.html.erb @@ -19,7 +19,7 @@ <% end %>

- Progress: <%= h budget.progress %> + Progress: <%= h number_to_percentage(budget.progress, :precision => 0) %>

<% if allowed_management? %> diff --git a/app/views/deliverables/_deliverable.html.erb b/app/views/deliverables/_deliverable.html.erb index 802cad3..ecc09c1 100644 --- a/app/views/deliverables/_deliverable.html.erb +++ b/app/views/deliverables/_deliverable.html.erb @@ -26,12 +26,16 @@ - <%= paragraph_with_data("Progress: ", deliverable.progress) -%> - <%= paragraph_with_data("Hours Estimated: ", deliverable.total_hours) if allowed_management? -%> - <%= paragraph_with_data("Hours Used: ", deliverable.hours_used) if allowed_management? -%> + <%= paragraph_with_double_data "Progress: ", number_to_percentage(deliverable.progress, :precision => 0), '' %> + <% if allowed_management? %> + <%= paragraph_with_double_data "Hours Estimated: ", number_with_precision(deliverable.total_hours, 0), '' %> + <%= paragraph_with_double_data "Hours Used: ", number_with_precision(deliverable.hours_used,0), number_to_currency(deliverable.spent, :precision => 0) %> + +

 

<% deliverable.members_spent.each do |person| %> -

<%= h person.user.name -%>: <%= h(person.hours) %> <%= number_to_currency(person.spent, :precision => 0) %>

+ <%= paragraph_with_double_data (h(person.user.name), person.hours.round, number_to_currency(person.spent, :precision => 0)) %> + <% end %> <% end %> @@ -44,10 +48,10 @@ -

<%= l(:label_issue_plural) -%>: <%= deliverable.issues.size -%>

+ <%= paragraph_with_data(l(:label_issue_plural), deliverable.issues.size) -%> <% deliverable.issues_with_trackers.each do |tracker_name, count| %> -

<%= h tracker_name -%>: <%= h(count) %>

+ <%= paragraph_with_data(h(tracker_name), count) -%> <% end %> diff --git a/assets/stylesheets/budget.css b/assets/stylesheets/budget.css index 4507e3e..6770d4c 100644 --- a/assets/stylesheets/budget.css +++ b/assets/stylesheets/budget.css @@ -11,8 +11,13 @@ tr.deliverable td.spent { text-align: right; } tr.deliverable td.due_date { text-align: center; } tr.deliverable td.done_ratio table.progress { margin-left:auto; margin-right: auto;} -tr.deliverable-details p { text-align:left; } -tr.deliverable-details span { font-weight:bold; } +tr.deliverable-details p { text-align:left; clear:both;} +tr.deliverable-details span.title { float:left; font-weight:bold; width: 130px;} +tr.deliverable-details span.data { float:right; padding-right: 50px;} + +tr.deliverable-details span.left-data { float:left; width: 40px; text-align: right} +tr.deliverable-details span.right-data { float:right; padding-right: 30px;} + tr.deliverable-details div { text-align:left; } #deliverable-form .splitcontentleft { width: 62% }