%= error_messages_for 'custom_field' %> <% if @custom_field.is_a?(IssueCustomField) %>
<%= f.text_field :name, :required => true %>
<%= f.select :field_format, custom_field_formats_for_select(@custom_field), {}, :disabled => !@custom_field.new_record? %>
<% if @custom_field.format_in? 'list', 'user', 'version' %><%= f.check_box :multiple %> <% if !@custom_field.new_record? && @custom_field.multiple %> <%= l(:text_turning_multiple_off) %> <% end %>
<% end %> <% unless @custom_field.format_in? 'list', 'bool', 'date', 'user', 'version' %>
<%= f.text_field :min_length, :size => 5, :no_label => true %> -
<%= f.text_field :max_length, :size => 5, :no_label => true %>
(<%=l(:text_min_max_length_info)%>)
<%= f.text_field :regexp, :size => 50 %>
(<%=l(:text_regexp_info)%>)
<%= f.text_area :possible_values, :value => @custom_field.possible_values.to_a.join("\n"), :rows => 15 %> <%= l(:text_custom_field_possible_values_info) %>
<% end %> <% case @custom_field.field_format %> <% when 'bool' %><%= f.check_box(:default_value) %>
<% when 'text' %><%= f.text_area(:default_value, :rows => 8) %>
<% when 'date' %><%= f.text_field(:default_value, :size => 10) %>
<%= calendar_for('custom_field_default_value') %> <% when 'user', 'version' %> <% else %><%= f.text_field(:default_value) %>
<% end %> <%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %><%= f.check_box :is_required %>
<%= f.check_box :is_for_all %>
<%= f.check_box :is_filter %>
<%= f.check_box :searchable %>
<% 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 %>
<%= f.check_box :searchable %>
<%= 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) %>