Use time_zone_select specific helper.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9744 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Etienne Massip 2012-06-01 13:38:03 +00:00
parent fc7b790081
commit 121ce2a390
2 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,6 @@
<%= labelled_fields_for :pref, @user.pref do |pref_fields| %>
<p><%= pref_fields.check_box :hide_mail %></p>
<p><%= pref_fields.select :time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %></p>
<p><%= pref_fields.time_zone_select :time_zone, nil, :include_blank => true %></p>
<p><%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %></p>
<p><%= pref_fields.check_box :warn_on_leaving_unsaved %></p>
<% end %>

View File

@ -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)