Project

General

Profile

Defect #28393 » 0001-Sort-issue-custom-fields-by-position-in-tracker-view.patch

Gregor Schmidt, 2018-03-21 14:39

View differences:

app/controllers/trackers_controller.rb
106 106
      return
107 107
    end
108 108
    @trackers = Tracker.sorted.to_a
109
    @custom_fields = IssueCustomField.all.sort
109
    @custom_fields = IssueCustomField.sorted
110 110
  end
111 111
end
app/views/trackers/_form.html.erb
21 21
</p>
22 22
<%= hidden_field_tag 'tracker[core_fields][]', '' %>
23 23

  
24
<% if IssueCustomField.all.any? %>
24
<% @issue_custom_fields = IssueCustomField.sorted %>
25
<% if @issue_custom_fields.present? %>
25 26
<p>
26 27
  <label><%= l(:label_custom_field_plural) %></label>
27
  <% IssueCustomField.all.each do |field| %>
28
  <% @issue_custom_fields.each do |field| %>
28 29
    <label class="block">
29 30
      <%= check_box_tag 'tracker[custom_field_ids][]',field.id, @tracker.custom_fields.to_a.include?(field), :id => nil %>
30 31
      <%= field.name %>
(1-1/4)