kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
154 lines
6.3 KiB
154 lines
6.3 KiB
<%#-- copyright
|
|
OpenProject is a project management system.
|
|
Copyright (C) 2012-2017 the OpenProject Foundation (OPF)
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License version 3.
|
|
|
|
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
|
Copyright (C) 2006-2017 Jean-Philippe Lang
|
|
Copyright (C) 2010-2013 the ChiliProject Team
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; either version 2
|
|
of the License, or (at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
See doc/COPYRIGHT.rdoc for more details.
|
|
|
|
++#%>
|
|
<%= error_messages_for 'custom_field' %>
|
|
|
|
<section class="form--section" id="custom_field_form">
|
|
<div class="form--field -required" id="custom_field_name_attributes">
|
|
<%= f.text_field :name,
|
|
multi_locale: true,
|
|
required: true %>
|
|
</div>
|
|
<div class="form--field">
|
|
<%= f.select :field_format,
|
|
custom_field_formats_for_select(@custom_field),
|
|
{},
|
|
disabled: !@custom_field.new_record? %>
|
|
</div>
|
|
<div class="form--grouping" id="custom_field_length">
|
|
<div class="form--grouping-label">
|
|
<%= l(:label_min_max_length) %> <br>
|
|
<small>(<%= l(:text_min_max_length_info ) %>)</small>
|
|
</div>
|
|
<div class="form--grouping-row">
|
|
<div class="form--field">
|
|
<%= f.text_field :min_length %>
|
|
</div>
|
|
<div class="form--field">
|
|
<%= f.text_field :max_length %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form--field">
|
|
<%= f.text_field :regexp,
|
|
size: 50 %>
|
|
<span class="form--field-instructions">
|
|
<%=l(:text_regexp_info)%>
|
|
</span>
|
|
</div>
|
|
|
|
<div class="form--field" id="custom_field_multi_select">
|
|
<% if EnterpriseToken.allows_to?(:multiselect_custom_fields) %>
|
|
<%= f.check_box :multi_value %>
|
|
<% else %>
|
|
<label class="form--label" for="custom_field_multi_value_disabled"><%= CustomField.human_attribute_name('multi_value') %></label>
|
|
<span class="form--field-container">
|
|
<span class="form--check-box-container">
|
|
<input disabled="disabled" class="-cf-ignore-disabled form--check-box" type="checkbox" name="custom_field_multi_value_disabled">
|
|
<%= render partial: 'enterprise/locked_note' %>
|
|
</span>
|
|
</span>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="form--field" id="custom_field_possible_values_attributes">
|
|
<% if @custom_field.new_record? || @custom_field.field_format == 'list' %>
|
|
<label
|
|
class="form--label"
|
|
title="<%= I18n.t("activerecord.attributes.custom_field.possible_values") %>"
|
|
for="custom_field_possible_values"
|
|
>
|
|
<%= I18n.t("activerecord.attributes.custom_field.possible_values") %>
|
|
</label>
|
|
<span class="form--field-container">
|
|
<%= render partial: "custom_fields/custom_options", locals: { custom_options: @custom_field.custom_options, f: f } %>
|
|
</span>
|
|
<a id="add-custom-option" href="#" class="form--field-extra-actions icon icon-add">Add</a>
|
|
<% end %>
|
|
</div>
|
|
<div id="custom_field_default_value_attributes">
|
|
<div class="form--field" id="default_value_text">
|
|
<% if @custom_field.new_record? || @custom_field.field_format != 'bool' %>
|
|
<%= f.text_field(:default_value) %>
|
|
<% end %>
|
|
</div>
|
|
<div class="form--field" style="display:none" id="default_value_bool">
|
|
<% if @custom_field.new_record? || @custom_field.field_format == 'bool' %>
|
|
<%= f.check_box(:default_value) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<%= call_hook(:view_custom_fields_form_upper_box, custom_field: @custom_field, form: f) %>
|
|
</section>
|
|
|
|
<section class="form--section">
|
|
<% case @custom_field.class.name
|
|
when "WorkPackageCustomField" %>
|
|
<fieldset class="form--fieldset">
|
|
<legend class="form--fieldset-legend"><%=l(:label_type_plural)%></legend>
|
|
<div class="form--field">
|
|
<div class="form--field-container -wrap-around">
|
|
<% for type in @types %>
|
|
<%= content_tag :label, '',
|
|
class: "form--label-with-check-box",
|
|
for: "custom_field_type_ids_#{type.id}" do %>
|
|
<div class="form--check-box-container">
|
|
<%= check_box_tag "custom_field[type_ids][]", type.id, (@custom_field.types.include? type),
|
|
id: "custom_field_type_ids_#{type.id}",
|
|
class: 'form--check-box' %>
|
|
</div>
|
|
<%= (type.is_standard) ? l(:label_custom_field_default_type) : h(type) %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<%= hidden_field_tag "custom_field[type_ids][]", '' %>
|
|
</fieldset>
|
|
|
|
|
|
<div class="form--field"><%= f.check_box :is_required %></div>
|
|
<div class="form--field"><%= f.check_box :is_for_all %></div>
|
|
<div class="form--field"><%= f.check_box :is_filter %></div>
|
|
<div class="form--field" id="searchable_container"><%= f.check_box :searchable %></div>
|
|
<% when "UserCustomField" %>
|
|
<div class="form--field"><%= f.check_box :is_required %></div>
|
|
<div class="form--field"><%= f.check_box :visible %></div>
|
|
<div class="form--field"><%= f.check_box :editable %></div>
|
|
<% when "ProjectCustomField" %>
|
|
<div class="form--field"><%= f.check_box :is_required %></div>
|
|
<div class="form--field"><%= f.check_box :visible %></div>
|
|
<div class="form--field" id="searchable_container"><%= f.check_box :searchable %></div>
|
|
<% when "TimeEntryCustomField" %>
|
|
<div class="form--field"><%= f.check_box :is_required %></div>
|
|
<% else %>
|
|
<div class="form--field"><%= f.check_box :is_required %></div>
|
|
<% end %>
|
|
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", custom_field: @custom_field, form: f) %>
|
|
</section>
|
|
|
|
|