Feature #31859 » 0001-Refactor-custom-fields-form.patch
| app/views/custom_fields/_form.html.erb | ||
|---|---|---|
|
</div>
|
||
|
<div class="splitcontentright">
|
||
|
<% case @custom_field.class.name
|
||
|
when "IssueCustomField" %>
|
||
|
<div class="box tabular">
|
||
|
<p><%= f.check_box :is_required %></p>
|
||
|
<% if @custom_field.format.is_filter_supported %>
|
||
|
<p><%= f.check_box :is_filter %></p>
|
||
|
<% end %>
|
||
|
<% if @custom_field.format.searchable_supported %>
|
||
|
<p><%= f.check_box :searchable %></p>
|
||
|
<% end %>
|
||
|
</div>
|
||
|
<%= render :partial => 'visibility_by_role_selector' %>
|
||
|
<% when "UserCustomField" %>
|
||
|
<div class="box tabular">
|
||
|
<p><%= f.check_box :is_required %></p>
|
||
|
<p><%= f.check_box :visible %></p>
|
||
|
<p><%= f.check_box :editable %></p>
|
||
|
<% if @custom_field.format.is_filter_supported %>
|
||
|
<p><%= f.check_box :is_filter %></p>
|
||
|
<% end %>
|
||
|
</div>
|
||
|
<div class="box tabular">
|
||
|
<p><%= f.check_box :is_required %></p>
|
||
|
<% when "ProjectCustomField" %>
|
||
|
<div class="box tabular">
|
||
|
<p><%= f.check_box :is_required %></p>
|
||
|
<% if %w(UserCustomField ProjectCustomField).include?(@custom_field.class.name) %>
|
||
|
<p><%= f.check_box :visible %></p>
|
||
|
<% if @custom_field.format.searchable_supported %>
|
||
|
<p><%= f.check_box :searchable %></p>
|
||
|
<% end %>
|
||
|
<% if @custom_field.format.is_filter_supported %>
|
||
|
<p><%= f.check_box :is_filter %></p>
|
||
|
<% end %>
|
||
|
</div>
|
||
|
<% end %>
|
||
|
<% when "VersionCustomField" %>
|
||
|
<div class="box tabular">
|
||
|
<p><%= f.check_box :is_required %></p>
|
||
|
<% if @custom_field.format.is_filter_supported %>
|
||
|
<p><%= f.check_box :is_filter %></p>
|
||
|
<% end %>
|
||
|
</div>
|
||
|
<% when "GroupCustomField" %>
|
||
|
<div class="box tabular">
|
||
|
<p><%= f.check_box :is_required %></p>
|
||
|
<% if @custom_field.format.is_filter_supported %>
|
||
|
<p><%= f.check_box :is_filter %></p>
|
||
|
<% end %>
|
||
|
</div>
|
||
|
<% if @custom_field.is_a?(UserCustomField) %>
|
||
|
<p><%= f.check_box :editable %></p>
|
||
|
<% end %>
|
||
|
<% when "TimeEntryCustomField" %>
|
||
|
<div class="box tabular">
|
||
|
<p><%= f.check_box :is_required %></p>
|
||
|
<% if @custom_field.format.is_filter_supported %>
|
||
|
<% if %w(IssueCustomField UserCustomField ProjectCustomField VersionCustomField GroupCustomField TimeEntryCustomField).include?(@custom_field.class.name) &&
|
||
|
@custom_field.format.is_filter_supported %>
|
||
|
<p><%= f.check_box :is_filter %></p>
|
||
|
<% end %>
|
||
|
</div>
|
||
|
<%= render :partial => 'visibility_by_role_selector' %>
|
||
|
<% end %>
|
||
|
<% else %>
|
||
|
<div class="box tabular">
|
||
|
<p><%= f.check_box :is_required %></p>
|
||
|
<% if %w(IssueCustomField ProjectCustomField).include?(@custom_field.class.name) && @custom_field.format.searchable_supported %>
|
||
|
<p><%= f.check_box :searchable %></p>
|
||
|
<% end %>
|
||
|
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
|
||
|
</div>
|
||
|
<% end %>
|
||
|
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
|
||
|
<% if @custom_field.is_a?(IssueCustomField) %>
|
||
|
<fieldset class="box" id="custom_field_tracker_ids"><legend><%= toggle_checkboxes_link("#custom_field_tracker_ids input[type=checkbox]") %><%=l(:label_tracker_plural)%></legend>
|
||
|
<% tracker_ids = @custom_field.tracker_ids %>
|
||
|
<% Tracker.sorted.each do |tracker| %>
|
||
|
<%= check_box_tag "custom_field[tracker_ids][]",
|
||
|
tracker.id,
|
||
|
tracker_ids.include?(tracker.id),
|
||
|
:id => "custom_field_tracker_ids_#{tracker.id}" %>
|
||
|
<label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>">
|
||
|
<%= tracker.name %>
|
||
|
</label>
|
||
|
<% if %w(IssueCustomField TimeEntryCustomField).include?(@custom_field.class.name) %>
|
||
|
<%= render :partial => 'visibility_by_role_selector', :locals => { :f => f } %>
|
||
|
<% end %>
|
||
|
<%= hidden_field_tag "custom_field[tracker_ids][]", '' %>
|
||
|
</fieldset>
|
||
|
<fieldset class="box"><legend><%= toggle_checkboxes_link("#custom_field_project_ids input[type=checkbox]:enabled") %><%= l(:label_project_plural) %></legend>
|
||
|
<p><%= f.check_box :is_for_all, :data => {:disables => '#custom_field_project_ids input'} %></p>
|
||
|
<% if @custom_field.is_a?(IssueCustomField) %>
|
||
|
<%= render :partial => 'visibility_by_tracker_selector', :locals => { :f => f } %>
|
||
|
<div id="custom_field_project_ids">
|
||
|
<% project_ids = @custom_field.project_ids.to_a %>
|
||
|
<%= render_project_nested_lists(Project.all) do |p|
|
||
|
content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, project_ids.include?(p.id), :id => nil) + ' ' + p)
|
||
|
end %>
|
||
|
<%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>
|
||
|
</div>
|
||
|
</fieldset>
|
||
|
<% end %>
|
||
|
<%= render :partial => 'visibility_by_project_selector', :locals => { :f => f } %>
|
||
|
<% end %>
|
||
|
</div>
|
||
|
</div>
|
||
| app/views/custom_fields/_visibility_by_project_selector.html.erb | ||
|---|---|---|
|
<fieldset class="box"><legend><%= toggle_checkboxes_link("#custom_field_project_ids input[type=checkbox]:enabled") %><%= l(:label_project_plural) %></legend>
|
||
|
<p><%= f.check_box :is_for_all, :data => {:disables => '#custom_field_project_ids input'} %></p>
|
||
|
<div id="custom_field_project_ids">
|
||
|
<% project_ids = @custom_field.project_ids.to_a %>
|
||
|
<%= render_project_nested_lists(Project.all) do |p|
|
||
|
content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, project_ids.include?(p.id), :id => nil) + ' ' + p)
|
||
|
end %>
|
||
|
<%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>
|
||
|
</div>
|
||
|
</fieldset>
|
||
| app/views/custom_fields/_visibility_by_tracker_selector.html.erb | ||
|---|---|---|
|
<fieldset class="box" id="custom_field_tracker_ids"><legend><%= toggle_checkboxes_link("#custom_field_tracker_ids input[type=checkbox]") %><%=l(:label_tracker_plural)%></legend>
|
||
|
<% tracker_ids = @custom_field.tracker_ids %>
|
||
|
<% Tracker.sorted.each do |tracker| %>
|
||
|
<%= check_box_tag "custom_field[tracker_ids][]",
|
||
|
tracker.id,
|
||
|
tracker_ids.include?(tracker.id),
|
||
|
:id => "custom_field_tracker_ids_#{tracker.id}" %>
|
||
|
<label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>">
|
||
|
<%= tracker.name %>
|
||
|
</label>
|
||
|
<% end %>
|
||
|
<%= hidden_field_tag "custom_field[tracker_ids][]", '' %>
|
||
|
</fieldset>
|
||
- « Previous
- 1
- 2
- 3
- 4
- Next »