diff --git a/app/views/users/_preferences.html.erb b/app/views/users/_preferences.html.erb index 26e83b123..fb19bb3e5 100644 --- a/app/views/users/_preferences.html.erb +++ b/app/views/users/_preferences.html.erb @@ -1,7 +1,6 @@ <%= labelled_fields_for :pref, @user.pref do |pref_fields| %>

<%= pref_fields.check_box :hide_mail %>

-

<%= pref_fields.select :time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %>

+

<%= pref_fields.time_zone_select :time_zone, nil, :include_blank => true %>

<%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %>

<%= pref_fields.check_box :warn_on_leaving_unsaved %>

<% end %> - diff --git a/lib/redmine/views/labelled_form_builder.rb b/lib/redmine/views/labelled_form_builder.rb index 9b88632b6..f6ba0bfcb 100644 --- a/lib/redmine/views/labelled_form_builder.rb +++ b/lib/redmine/views/labelled_form_builder.rb @@ -34,6 +34,10 @@ class Redmine::Views::LabelledFormBuilder < ActionView::Helpers::FormBuilder label_for_field(field, options) + super(field, choices, options, html_options.except(:label)).html_safe end + def time_zone_select(field, priority_zones = nil, options = {}, html_options = {}) + label_for_field(field, options) + super(field, priority_zones, options, html_options.except(:label)).html_safe + end + # Returns a label tag for the given field def label_for_field(field, options = {}) return ''.html_safe if options.delete(:no_label)