diff --git a/app/assets/javascripts/extra/build_list.js b/app/assets/javascripts/extra/build_list.js index 0aa0205a8..02f9d253d 100644 --- a/app/assets/javascripts/extra/build_list.js +++ b/app/assets/javascripts/extra/build_list.js @@ -38,11 +38,18 @@ $(document).ready(function() { $('.offset25 input[type="checkbox"]').click(function() { setPlChecked(this, $(this).attr('checked')); }); + + $('.build_bpl_ids').click(function() { + return false; + }); }); function setPlChecked(pointer, checked) { - pl_cbx = $(pointer).parent().parent().parent().find('input[type="checkbox"].build_bpl_ids'); + var pl_cbx = $(pointer).parent().parent().parent().find('input[type="checkbox"].build_bpl_ids'); + var pl_id = pl_cbx.val(); if (checked && !$(pointer).attr('disabled')) { pl_cbx.attr('checked', 'checked'); + } else if ($('input[pl_id=' + pl_id + '][checked="checked"]').size() == 0) { + pl_cbx.removeAttr('checked'); } } diff --git a/app/views/build_lists/_include_repos.html.haml b/app/views/build_lists/_include_repos.html.haml index 7d99581c1..d62150f29 100644 --- a/app/views/build_lists/_include_repos.html.haml +++ b/app/views/build_lists/_include_repos.html.haml @@ -1,4 +1,4 @@ - platform.repositories.each do |repo| .both - = check_box_tag "build_list[include_repos][]", repo.id, repo.name == 'main' || @project.repositories.map(&:id).include?(repo.id), :id => "include_repos_#{repo.id}" # (params[:build_list]||[]).fetch(:include_repos, []).include?(repo.id.to_s) - = label_tag "include_repos_#{repo.id}", repo.name \ No newline at end of file + = check_box_tag "build_list[include_repos][]", repo.id, repo.name == 'main' || @project.repositories.map(&:id).include?(repo.id), :id => "include_repos_#{repo.id}", :pl_id => platform.id + = label_tag "include_repos_#{repo.id}", repo.name diff --git a/app/views/build_lists/new.html.haml b/app/views/build_lists/new.html.haml index 6bdc68c12..1a499ef44 100644 --- a/app/views/build_lists/new.html.haml +++ b/app/views/build_lists/new.html.haml @@ -16,7 +16,10 @@ %h3= t("activerecord.attributes.build_list.arch") - Arch.recent.each do |arch| .both - = check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s), :id => "arches_#{arch.id}" + - if controller.action_name == 'new' + = check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s), :id => "arches_#{arch.id}", :checked => 'checked' + - else + = check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s), :id => "arches_#{arch.id}" = label_tag "arches_#{arch.id}", arch.name %h3= t("activerecord.attributes.build_list.pl") .lineForm= f.select :pl_id, @project.repositories.collect{|r| ["#{r.platform.name}/#{r.name}", r.platform.id]}