Converted all details into tables. #1274
This commit is contained in:
@@ -23,6 +23,13 @@ module DeliverablesHelper
|
||||
content_tag(:span, label, :class => 'title') +
|
||||
content_tag(:span, h(data), :class => 'data'))
|
||||
end
|
||||
|
||||
def row_with_data(label, data, css_class='')
|
||||
content_tag(:tr,
|
||||
content_tag(:td, label, :class => 'title') +
|
||||
content_tag(:td, h(data), :class => 'data'),
|
||||
:class => css_class)
|
||||
end
|
||||
|
||||
# Helper to generate a consistant HTML format for displaying basic data
|
||||
def paragraph_with_double_data(label, data1, data2)
|
||||
@@ -35,6 +42,15 @@ module DeliverablesHelper
|
||||
|
||||
end
|
||||
|
||||
# Helper to generate a consistant HTML format for displaying basic data
|
||||
def row_with_double_data(label, data1, data2, css_class='')
|
||||
content_tag(:tr,
|
||||
content_tag(:td, label, :class => 'title') +
|
||||
content_tag(:td, h(data1), :class => 'data') +
|
||||
content_tag(:td, h(data2), :class => 'data'),
|
||||
:class => css_class)
|
||||
end
|
||||
|
||||
# Check if the current user is allowed to manage the budget. Based on Role permissions.
|
||||
def allowed_management?
|
||||
return User.current.allowed_to?(:manage_budget, @project)
|
||||
|
||||
@@ -29,34 +29,40 @@
|
||||
</td>
|
||||
|
||||
<td colspan="2">
|
||||
<%= 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) %>
|
||||
<table class="progress-table">
|
||||
<%= row_with_double_data "Progress: ", number_to_percentage(deliverable.progress, :precision => 0), '' %>
|
||||
<% if allowed_management? %>
|
||||
<%= row_with_double_data "Hours Estimated: ", number_with_precision(deliverable.total_hours, 0), '' %>
|
||||
<%= row_with_double_data "Hours Used: ", number_with_precision(deliverable.hours_used,0), number_to_currency(deliverable.spent, :precision => 0) %>
|
||||
|
||||
<p> </p>
|
||||
<tr><td> </td></tr>
|
||||
|
||||
<% deliverable.members_spent.each do |person| %>
|
||||
<%= paragraph_with_double_data (h(person.user.name), person.hours.round, number_to_currency(person.spent, :precision => 0)) %>
|
||||
<% end %>
|
||||
<% deliverable.members_spent.each do |person| %>
|
||||
<%= row_with_double_data (h(person.user.name), person.hours.round, number_to_currency(person.spent, :precision => 0)) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
<td colspan="3">
|
||||
<%= paragraph_with_data("Total Budget: ", number_to_currency(deliverable.budget, :precision => 0)) -%>
|
||||
<table class="financials">
|
||||
<%= row_with_data("Total Budget: ", number_to_currency(deliverable.budget, :precision => 0)) -%>
|
||||
<% if allowed_management? %>
|
||||
<%= paragraph_with_data("Labor: ", number_to_currency(deliverable.labor_budget || 0.0, :precision => 0)) -%>
|
||||
<%= paragraph_with_data("Overhead: ", number_or_percent(deliverable.overhead, deliverable.overhead_percent)) -%>
|
||||
<%= paragraph_with_data("Materials: ", number_or_percent(deliverable.materials, deliverable.materials_percent)) -%>
|
||||
<%= paragraph_with_data("Profit: ", number_or_percent(deliverable.profit, deliverable.profit_percent)) -%>
|
||||
<%= row_with_data("Labor: ", number_to_currency(deliverable.labor_budget || 0.0, :precision => 0)) -%>
|
||||
<%= row_with_data("Overhead: ", number_or_percent(deliverable.overhead, deliverable.overhead_percent)) -%>
|
||||
<%= row_with_data("Materials: ", number_or_percent(deliverable.materials, deliverable.materials_percent)) -%>
|
||||
<%= row_with_data("Profit: ", number_or_percent(deliverable.profit, deliverable.profit_percent)) -%>
|
||||
<% end %>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
<td colspan="2">
|
||||
<%= paragraph_with_data(l(:label_issue_plural), deliverable.issues.size) -%>
|
||||
<table class="issue-totals">
|
||||
<%= row_with_data(l(:label_issue_plural), deliverable.issues.size, 'issue-totals') -%>
|
||||
|
||||
<% deliverable.issues_with_trackers.each do |tracker_name, count| %>
|
||||
<%= paragraph_with_data(h(tracker_name), count) -%>
|
||||
<% end %>
|
||||
<% deliverable.issues_with_trackers.each do |tracker_name, count| %>
|
||||
<%= row_with_data(h(tracker_name), count,'issue-totals') -%>
|
||||
<% end %>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -20,13 +20,11 @@ tr.deliverable-details td { padding-bottom: 50px ; }
|
||||
td.deliverable-actions { padding-left: 10px; width:100px;}
|
||||
|
||||
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; }
|
||||
tr.deliverable-details table { width: 85%; }
|
||||
tr.deliverable-details table tr td { padding: 0px; }
|
||||
tr.deliverable-details table tr td.title { font-weight:bold; text-align:left; }
|
||||
tr.deliverable-details table tr td.data { text-align:right; }
|
||||
|
||||
#deliverable-form .splitcontentleft { width: 62% }
|
||||
#deliverable-form .splitcontentright { width: 37% }
|
||||
@@ -39,6 +37,8 @@ td.calculation-column { text-align:right; width: auto; }
|
||||
p.total-budget { font-weight: bold; }
|
||||
p.total-budget #total-budget-calculation { }
|
||||
|
||||
|
||||
|
||||
/* Rest some defaults */
|
||||
.jstElements button { padding: 0; margin-right: 0px;}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user