Project

General

Profile

Patch #28242 » 0002-adds-toogle-checkboxes-to-trackers-and-custom-fields.patch

Marius BĂLTEANU, 2018-02-25 15:49

View differences:

app/views/projects/settings/_issues.html.erb
<%= hidden_field_tag 'tab', 'issues' %>
<% unless @trackers.empty? %>
<fieldset class="box tabular" id="project_trackers"><legend><%=l(:label_tracker_plural)%></legend>
<fieldset class="box tabular" id="project_trackers"><legend><%= toggle_checkboxes_link('#project_trackers input[type=checkbox]') %><%= l(:label_tracker_plural)%></legend>
<% @trackers.each do |tracker| %>
<label class="floating">
<%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.to_a.include?(tracker), :id => nil %>
......
<% end %>
<% unless @issue_custom_fields.empty? %>
<fieldset class="box tabular" id="project_issue_custom_fields"><legend><%=l(:label_custom_field_plural)%></legend>
<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>
<% @issue_custom_fields.each do |custom_field| %>
<label class="floating">
<%= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (@project.all_issue_custom_fields.include? custom_field),
public/javascripts/application.js
function toggleCheckboxesBySelector(selector) {
var all_checked = true;
$(selector).each(function(index) {
if (!$(this).is(':checked')) { all_checked = false; }
});
(2-2/7)