<%= f.select :custom_field_section_id,
ProjectCustomFieldSection.all.collect { |s| [s.name, s.id] },
{ container_class: '-slim' },
required: true
%>
<% end %>
<%= f.select :field_format,
custom_field_formats_for_select(@custom_field),
{ container_class: '-slim' },
disabled: !@custom_field.new_record?,
data: {
action: 'admin--custom-fields#formatChanged',
'admin--custom-fields-target': 'format'
}
%>
<%= f.text_field :regexp,
size: 50,
container_class: '-wide',
data: { 'admin--custom-fields-target': 'regexp' } %>
<%= t(:text_regexp_info) %>
<% if @custom_field.new_record? || @custom_field.list? || @custom_field.multi_value_possible? %>
<%= f.check_box :multi_value,
data: {
'admin--custom-fields-target': 'multiSelect',
action: 'admin--custom-fields#checkOnlyOne'
} %>
<%= f.check_box :allow_non_open_versions,
data: {
'admin--custom-fields-target': 'allowNonOpenVersions'
} %>
<% end %>
<% if @custom_field.new_record? || !%w[text bool].include?(@custom_field.field_format) %>
<%= f.text_field :default_value,
id: 'custom_fields_default_value_text',
for: 'custom_fields_default_value_text',
data: { 'admin--custom-fields-target': 'defaultText' },
container_class: '-wide' %>
<% end %>
<% if @custom_field.new_record? || @custom_field.field_format == 'bool' %>
<%= f.check_box :default_value,
id: 'custom_fields_default_value_bool',
data: { 'admin--custom-fields-target': 'defaultBool' },
for: 'custom_fields_default_value_bool' %>
<% end %>
<% if @custom_field.new_record? || @custom_field.field_format == 'text' %>
<%= f.text_area :default_value,
id: 'custom_fields_default_value_longtext',
data: { 'admin--custom-fields-target': 'defaultLongText' },
for: 'custom_fields_default_value_longtext',
cols: 100,
rows: 20,
class: 'wiki-edit',
macros: "none",
with_text_formatting: true %>
<% end %>
<%= call_hook(:view_custom_fields_form_upper_box, custom_field: @custom_field, form: f) %>