mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-31 19:47:14 +00:00
Add placeholder "h:mm" to hours field for better user guidance (#2464).
Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@22977 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9cc3542fa1
commit
7cc62836b5
@ -49,6 +49,7 @@ class Redmine::Views::LabelledFormBuilder < ActionView::Helpers::FormBuilder
|
||||
# display the value before type cast when the entered value is not valid
|
||||
if @object.errors[field].blank?
|
||||
options = options.merge(:value => format_hours(@object.send field))
|
||||
.with_defaults(:placeholder => 'h:mm')
|
||||
end
|
||||
text_field field, options
|
||||
end
|
||||
|
||||
@ -33,7 +33,9 @@ class Redmine::Views::LabelledFormBuilderTest < Redmine::HelperTest
|
||||
entry.validate
|
||||
|
||||
labelled_form_for(entry) do |f|
|
||||
assert_include 'value="2:30"', f.hours_field(:hours)
|
||||
field_html = f.hours_field(:hours)
|
||||
assert_include 'value="2:30"', field_html
|
||||
assert_include 'placeholder="h:mm"', field_html
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user