More form cleanup. #1274
This commit is contained in:
1 parent
8a69714981
commit
52d6687f52
3 files changed
+17
-7
No files matched your search
@@ -4,14 +4,16 @@ module DeliverablesHelper
|
|||||||
# a Deliverable
|
# a Deliverable
|
||||||
def field_with_budget_observer_and_totals(form, field)
|
def field_with_budget_observer_and_totals(form, field)
|
||||||
content_tag(:tr,
|
content_tag(:tr,
|
||||||
content_tag(:td, "<label for='deliverable_#{field}'>TODO</label>") +
|
content_tag(:td, "<label for='deliverable_#{field.to_s}'>#{l_field(field, 'field_')}</label>") +
|
||||||
content_tag(:td, text_field(:deliverable, field, :size => 7)) +
|
content_tag(:td, text_field(:deliverable, field, :size => 7)) +
|
||||||
content_tag(:td,
|
content_tag(:td,
|
||||||
content_tag(:span,
|
content_tag(:span,
|
||||||
0,
|
0,
|
||||||
:class => "budget-calculation",
|
:class => "budget-calculation",
|
||||||
:id => field.to_s + '_subtotal'
|
:id => field.to_s + '_subtotal'
|
||||||
) + observe_field('deliverable_' + field.to_s, :function => "new Budget.updateAmounts();")))
|
) + observe_field('deliverable_' + field.to_s, :function => "new Budget.updateAmounts();"),
|
||||||
|
:class => "calculation-column"
|
||||||
|
))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -37,4 +39,8 @@ module DeliverablesHelper
|
|||||||
def allowed_management?
|
def allowed_management?
|
||||||
return User.current.allowed_to?(:manage_budget, @project)
|
return User.current.allowed_to?(:manage_budget, @project)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def l_field(field, prefix='')
|
||||||
|
l((prefix + field.to_s).to_sym)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<%= check_box(:deliverable, :type, {}, FixedDeliverable.name, HourlyDeliverable.name) %>
|
<%= check_box(:deliverable, :type, {}, FixedDeliverable.name, HourlyDeliverable.name) %>
|
||||||
<%= observe_field('deliverable_type', :function => "new Budget.changeType();") %>
|
<%= observe_field('deliverable_type', :function => "new Budget.changeType();") %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td class="calculation-column">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
<%= text_field :deliverable, :total_hours, :size => 7 %>
|
<%= text_field :deliverable, :total_hours, :size => 7 %>
|
||||||
<%= observe_field('deliverable_total_hours', :function => "new Budget.updateAmounts();") %>
|
<%= observe_field('deliverable_total_hours', :function => "new Budget.updateAmounts();") %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td class="calculation-column">
|
||||||
<%= content_tag(:span, 0, :class => "budget-calculation", :id => 'variableCost') %>
|
<%= content_tag(:span, 0, :class => "budget-calculation", :id => 'variableCost') %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
<%= text_field :deliverable, :fixed_cost, :size => 7 %>
|
<%= text_field :deliverable, :fixed_cost, :size => 7 %>
|
||||||
<%= observe_field('deliverable_fixed_cost', :function => "new Budget.updateAmounts();") %>
|
<%= observe_field('deliverable_fixed_cost', :function => "new Budget.updateAmounts();") %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td class="calculation-column">
|
||||||
<%= content_tag(:span, 0, :class => "budget-calculation", :id => 'fixedCost') %>
|
<%= content_tag(:span, 0, :class => "budget-calculation", :id => 'fixedCost') %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -73,7 +73,9 @@
|
|||||||
<tr class="total-budget">
|
<tr class="total-budget">
|
||||||
<td><label>Total Budget:</label></td>
|
<td><label>Total Budget:</label></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td><%= content_tag(:span, 0, :id => 'total-budget-calculation', :class => "budget-calculation") %></td>
|
<td class="calculation-column">
|
||||||
|
<%= content_tag(:span, 0, :id => 'total-budget-calculation', :class => "budget-calculation") %>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ tr.deliverable-details div { text-align:left; }
|
|||||||
#deliverable-form .splitcontentright p { padding-right: 30px; }
|
#deliverable-form .splitcontentright p { padding-right: 30px; }
|
||||||
#deliverable-form .splitcontentright input { float:left }
|
#deliverable-form .splitcontentright input { float:left }
|
||||||
|
|
||||||
span.budget-calculation { color:#999999; font-weight:bold; display:block; text-align:right; width: 100%;}
|
|
||||||
|
td.calculation-column { text-align:right; width: auto; }
|
||||||
|
.budget-calculation { color:#999999; font-weight:bold; display:block; text-align:right; width: 100%;}
|
||||||
p.total-budget { font-weight: bold; }
|
p.total-budget { font-weight: bold; }
|
||||||
p.total-budget #total-budget-calculation { }
|
p.total-budget #total-budget-calculation { }
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user