Matched layout to comp. #1190

This commit is contained in:
Eric Davis
2008-06-09 17:08:17 -07:00
parent 211fc5879d
commit 1bb2742521
4 changed files with 31 additions and 11 deletions

View File

@@ -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)

View File

@@ -19,7 +19,7 @@
<% end %>
<p>
Progress: <%= h budget.progress %>
Progress: <%= h number_to_percentage(budget.progress, :precision => 0) %>
</p>
<% if allowed_management? %>

View File

@@ -26,12 +26,16 @@
</td>
<td colspan="2">
<%= 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) %>
<p>&nbsp;</p>
<% deliverable.members_spent.each do |person| %>
<p><%= h person.user.name -%>: <%= h(person.hours) %> <%= number_to_currency(person.spent, :precision => 0) %></p>
<%= paragraph_with_double_data (h(person.user.name), person.hours.round, number_to_currency(person.spent, :precision => 0)) %>
<% end %>
<% end %>
</td>
@@ -44,10 +48,10 @@
</td>
<td colspan="2">
<p><%= l(:label_issue_plural) -%>: <%= deliverable.issues.size -%></p>
<%= paragraph_with_data(l(:label_issue_plural), deliverable.issues.size) -%>
<% deliverable.issues_with_trackers.each do |tracker_name, count| %>
<p><%= h tracker_name -%>: <%= h(count) %></p>
<%= paragraph_with_data(h(tracker_name), count) -%>
<% end %>
</td>
</tr>

View File

@@ -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% }