%= error_messages_for 'custom_field' %>
<%= f.text_field :name, :required => true %>
<%= f.text_area :description, :rows => 7 %>
<%= f.select :field_format, custom_field_formats_for_select(@custom_field), {}, :disabled => !@custom_field.new_record? %>
<% if @custom_field.format.multiple_supported %><%= f.check_box :multiple %> <% if !@custom_field.new_record? && @custom_field.multiple %> <%= l(:text_turning_multiple_off) %> <% end %>
<% end %> <%= render_custom_field_format_partial f, @custom_field %> <%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %><%= submit_tag l(:button_save) %>
<%= f.check_box :is_required %>
<%= f.check_box :is_for_all, :data => {:disables => '#custom_field_project_ids input'} %>
<%= f.check_box :is_filter %>
<% if @custom_field.format.searchable_supported %><%= f.check_box :searchable %>
<% end %><% Role.givable.sorted.each do |role| %> <% end %> <%= hidden_field_tag 'custom_field[role_ids][]', '' %>
<% when "UserCustomField" %><%= f.check_box :is_required %>
<%= f.check_box :visible %>
<%= f.check_box :editable %>
<%= f.check_box :is_filter %>
<% when "ProjectCustomField" %><%= f.check_box :is_required %>
<%= f.check_box :visible %>
<% if @custom_field.format.searchable_supported %><%= f.check_box :searchable %>
<% end %><%= f.check_box :is_filter %>
<% when "VersionCustomField" %><%= f.check_box :is_required %>
<%= f.check_box :is_filter %>
<% when "GroupCustomField" %><%= f.check_box :is_required %>
<%= f.check_box :is_filter %>
<% when "TimeEntryCustomField" %><%= f.check_box :is_required %>
<%= f.check_box :is_filter %>
<% else %><%= f.check_box :is_required %>
<% end %> <%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>