RM_30739_Project_Custom_Fields_configuration_-_split_by_tracker_git.diff

Jérôme BATAILLE, 2019-02-04 17:34

Download (4.16 KB)

View differences:

app/views/projects/settings/_custom_field_checkbox.html.erb
1
    <label class="floating">
2
      <%= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (@project.all_issue_custom_fields.include? custom_field),
3
          :disabled => (custom_field.is_for_all? ? "disabled" : nil),
4
          :id => nil %>
5
      <%= custom_field_name_tag(custom_field) %>
6
    </label>
app/views/projects/settings/_issues.html.erb
3 3

  
4 4
  <% unless @trackers.empty? %>
5 5
  <fieldset class="box tabular" id="project_trackers"><legend><%= toggle_checkboxes_link('#project_trackers input[type=checkbox]') %><%= l(:label_tracker_plural)%></legend>
6
  <% @trackers.each do |tracker| %>
6
    <% @trackers.each do |tracker| %>
7 7
    <label class="floating">
8 8
      <%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.to_a.include?(tracker), :id => nil %>
9 9
      <%= tracker %>
10 10
    </label>
11
  <% end %>
11
    <% end %>
12 12
  <%= hidden_field_tag 'project[tracker_ids][]', '' %>
13 13
  </fieldset>
14 14
  <% end %>
15 15

  
16 16
  <% unless @issue_custom_fields.empty? %>
17
  <fieldset class="box tabular" id="project_issue_custom_fields"><legend><%= toggle_checkboxes_link('#project_issue_custom_fields input[type=checkbox]:enabled') %><%=l(:label_custom_field_plural)%></legend>
18
  <% @issue_custom_fields.each do |custom_field| %>
19
    <label class="floating">
20
      <%= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (@project.all_issue_custom_fields.include? custom_field),
21
          :disabled => (custom_field.is_for_all? ? "disabled" : nil),
22
          :id => nil %>
23
      <%= custom_field_name_tag(custom_field) %>
24
    </label>
25
  <% end %>
26
  <%= hidden_field_tag 'project[issue_custom_field_ids][]', '' %>
17
  <fieldset class="box tabular" id="project_issue_custom_fields"><legend><%=l(:label_custom_field_plural)%></legend>
18
    <fieldset class="box tabular" id="project_issue_custom_fields_for_all"><legend><b><%= l(:label_tracker_all) %></b></legend>
19
    <% @issue_custom_fields.select(&:is_for_all?).each do |custom_field| %>
20
<%= render :partial => 'projects/settings/custom_field_checkbox', :locals => {:custom_field => custom_field} %>
21
    <% end %>
22
    </fieldset>
23

  
24
    <fieldset class="box tabular" id="project_issue_custom_fields_multiple"><legend><%= toggle_checkboxes_link('#project_issue_custom_fields_multiple input[type=checkbox]:enabled') %><b><%= l(:label_tracker_plural) %> : <%= l(:field_multiple) %></b></legend>
25
    <% @issue_custom_fields.select{|cf| cf.trackers.size > 1}.each do |custom_field| %>
26
<%= render :partial => 'projects/settings/custom_field_checkbox', :locals => {:custom_field => custom_field} %>
27
    <% end %>
28
    </fieldset>
29

  
30
<%
31
    single_tracker_issue_custom_fields = @issue_custom_fields.select{|cf| cf.trackers.size == 1}
32
    if single_tracker_issue_custom_fields.any?
33
-%>
34
    <fieldset class="box tabular" id="project_issue_custom_fields_for_tracker"><legend><b><%=l(:label_tracker)%></b></legend>
35
<%
36
      Tracker.sorted.each do |t|
37
        issue_custom_fields_for_tracker = single_tracker_issue_custom_fields.select{|cf| cf.trackers.first == t}
38
        if issue_custom_fields_for_tracker.any?
39
-%>
40
      <fieldset class="box tabular" id="project_issue_custom_fields_tracker_<%= t.id %>"><legend><%= toggle_checkboxes_link("#project_issue_custom_fields_tracker_#{t.id} input[type=checkbox]:enabled") %><b><%= t.name %></b></legend>
41
        <% issue_custom_fields_for_tracker.each do |custom_field| %>
42
<%= render :partial => 'projects/settings/custom_field_checkbox', :locals => {:custom_field => custom_field} %>
43
          <% end %>
44
      </fieldset>
45
        <% end %>
46
      <% end %>
47
    </fieldset>
48
    <% end %>
49

  
50
    <%= hidden_field_tag 'project[issue_custom_field_ids][]', '' %>
27 51
  </fieldset>
28 52
  <% end %>
29 53