field_name << "[]" if custom_field.multiple?
field_id = "#{name}_custom_field_values_#{custom_field.id}"
+ tag_options = {:id => field_id, :class => "#{custom_field.field_format}_cf"}
+
field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
case field_format.try(:edit_as)
when "date"
- text_field_tag(field_name, custom_value.value, :id => field_id, :size => 10) +
+ text_field_tag(field_name, custom_value.value, tag_options.merge(:size => 10)) +
calendar_for(field_id)
when "text"
- text_area_tag(field_name, custom_value.value, :id => field_id, :rows => 3, :style => 'width:90%')
+ text_area_tag(field_name, custom_value.value, tag_options.merge(:rows => 3))
when "bool"
- hidden_field_tag(field_name, '0') + check_box_tag(field_name, '1', custom_value.true?, :id => field_id)
+ hidden_field_tag(field_name, '0') + check_box_tag(field_name, '1', custom_value.true?, tag_options)
when "list"
blank_option = ''
unless custom_field.multiple?
end
end
s = select_tag(field_name, blank_option.html_safe + options_for_select(custom_field.possible_values_options(custom_value.customized), custom_value.value),
- :id => field_id, :multiple => custom_field.multiple?)
+ tag_options.merge(:multiple => custom_field.multiple?))
if custom_field.multiple?
s << hidden_field_tag(field_name, '')
end
s
else
- text_field_tag(field_name, custom_value.value, :id => field_id)
+ text_field_tag(field_name, custom_value.value, tag_options)
end
end
field_name = "#{name}[custom_field_values][#{custom_field.id}]"
field_name << "[]" if custom_field.multiple?
field_id = "#{name}_custom_field_values_#{custom_field.id}"
+
+ tag_options = {:id => field_id, :class => "#{custom_field.field_format}_cf"}
+
field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
case field_format.try(:edit_as)
when "date"
- text_field_tag(field_name, '', :id => field_id, :size => 10) +
+ text_field_tag(field_name, '', tag_options.merge(:size => 10)) +
calendar_for(field_id)
when "text"
- text_area_tag(field_name, '', :id => field_id, :rows => 3, :style => 'width:90%')
+ text_area_tag(field_name, '', tag_options.merge(:rows => 3))
when "bool"
select_tag(field_name, options_for_select([[l(:label_no_change_option), ''],
[l(:general_text_yes), '1'],
- [l(:general_text_no), '0']]), :id => field_id)
+ [l(:general_text_no), '0']]), tag_options)
when "list"
options = []
options << [l(:label_no_change_option), ''] unless custom_field.multiple?
options << [l(:label_none), '__none__'] unless custom_field.is_required?
options += custom_field.possible_values_options(projects)
- select_tag(field_name, options_for_select(options),
- :id => field_id, :multiple => custom_field.multiple?)
+ select_tag(field_name, options_for_select(options), tag_options.merge(:multiple => custom_field.multiple?))
else
- text_field_tag(field_name, '', :id => field_id)
+ text_field_tag(field_name, '', tag_options)
end
end