mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Hide the current_rate when editing
This commit is contained in:
@@ -53,14 +53,15 @@ module Admin
|
||||
input_width: :medium
|
||||
)
|
||||
|
||||
f.text_field(
|
||||
name: :current_rate,
|
||||
label: ::CostType.human_attribute_name(:current_rate),
|
||||
input_width: :small,
|
||||
inputmode: :decimal,
|
||||
value: current_rate_value,
|
||||
trailing_visual: { text: { text: Setting.costs_currency } }
|
||||
)
|
||||
if model.new_record?
|
||||
f.text_field(
|
||||
name: :current_rate,
|
||||
label: ::CostType.human_attribute_name(:current_rate),
|
||||
input_width: :small,
|
||||
inputmode: :decimal,
|
||||
trailing_visual: { text: { text: Setting.costs_currency } }
|
||||
)
|
||||
end
|
||||
|
||||
f.check_box(
|
||||
name: :default,
|
||||
@@ -72,13 +73,6 @@ module Admin
|
||||
label: ::CostType.human_attribute_name(:for_all_projects)
|
||||
)
|
||||
end
|
||||
|
||||
def current_rate_value
|
||||
rate = model.rate_at(Date.current)
|
||||
return "" unless rate
|
||||
|
||||
helpers.unitless_currency_number(rate.rate.round(2))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user