[#369] fix disabled repositories checkboxes
This commit is contained in:
parent
737d8c99f3
commit
d9ed103504
|
@ -204,7 +204,7 @@ class Projects::BuildListsController < Projects::BaseController
|
|||
keys = [
|
||||
:save_to_repository_id, :auto_publish_status, :include_repos,
|
||||
:extra_params, :project_version, :update_type, :auto_create_container,
|
||||
:extra_repositories, :extra_build_lists, :build_for_platform_id,
|
||||
:extra_repositories, :extra_build_lists, :build_for_platform,
|
||||
:use_cached_chroot, :use_extra_tests
|
||||
]
|
||||
keys.each { |key| params[:build_list][key] = build_list.send(key) }
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- build_for_platform = params[:build_list].try :[], :build_for_platform
|
||||
- Repository.custom_sort(platform.repositories).each do |repo|
|
||||
- if params[:build_list].try(:[], :include_repos).present?
|
||||
- checked = (params[:build_list].try(:[], :include_repos).map(&:to_s) || []).include?(repo.id.to_s)
|
||||
|
@ -5,6 +6,6 @@
|
|||
.checkbox
|
||||
%label
|
||||
= check_box_tag 'build_list[include_repos][]', repo.id, checked,
|
||||
disabled: ((params[:build_list].try(:[], :build_for_platform_id).to_i != platform.id) && @build_list.build_for_platform.try(:main?)),
|
||||
disabled: ((build_for_platform != platform) && build_for_platform.try(:main?)),
|
||||
id: "include_repos_#{repo.id}", rep_name: repo.name
|
||||
= repo.name
|
||||
|
|
Loading…
Reference in New Issue