% projects = Project.all_public.active.sort_by(&:name).collect{ |project| [ project.name, project.id ] } %> <% unless defined? observe_field %> <% if custom_field.field_format == 'project' %> <% blank_option = ''.html_safe %> <% if custom_field.is_required? %> <% unless custom_field.default_value.present? %> <% blank_option = content_tag(:option, "--- #{l(:actionview_instancetag_blank_option)} ---") %> <% end %> <% else %> <% blank_option = content_tag(:option) %> <% end %>
<%= form.select(:default_value, blank_option + options_for_select(projects, custom_field.default_value)) %>
<% end %> <% end %><%= form.text_field(:hint, :size => 50) %>
<% unless defined? observe_field %> <% if custom_field.field_format == 'project' %> <% end %> <% if Redmine::VERSION::MAJOR > 1 && Redmine::VERSION::MINOR > 1 && !defined?(ChiliProject) %> <%= javascript_tag('toggle_extended_field_format();') %> <% end %> <% else %> <%= javascript_tag('toggle_extended_field_format();') %> <% end %> <% content_for :header_tags do %> <% if defined? observe_field %> <%= javascript_include_tag('extended_prototype', :plugin => 'extended_fields') %> <% else %> <%= javascript_include_tag('extended_jquery', :plugin => 'extended_fields') %> <% end %> <% end %>