More form cleanup. #1274

This commit is contained in:
Eric Davis
2008-06-12 15:04:01 -07:00
parent 8a69714981
commit 52d6687f52
3 changed files with 17 additions and 7 deletions
+8 -2
View File
@@ -4,14 +4,16 @@ module DeliverablesHelper
# a Deliverable
def field_with_budget_observer_and_totals(form, field)
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,
content_tag(:span,
0,
:class => "budget-calculation",
: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
@@ -37,4 +39,8 @@ module DeliverablesHelper
def allowed_management?
return User.current.allowed_to?(:manage_budget, @project)
end
def l_field(field, prefix='')
l((prefix + field.to_s).to_sym)
end
end