[#242] fixed repository selection

This commit is contained in:
Alexander Machehin 2013-08-06 19:46:57 +06:00
parent 4205acb47d
commit ba0d6c665f
1 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,8 @@
- Repository.custom_sort(platform.repositories).each do |repo| - Repository.custom_sort(platform.repositories).each do |repo|
.both .both
= check_box_tag "build_list[include_repos][]", repo.id, - if params[:build_list].try(:[], :include_repos).present?
(params[:build_list].try(:fetch, :include_repos) || []).include?(repo.id.to_s) || (repo.name == 'main' || @project.repositories.map(&:id).include?(repo.id)), - checked = (params[:build_list].try(:[], :include_repos) || []).include?(repo.id.to_s)
:id => "include_repos_#{repo.id}", :rep_name => repo.name - else checked = false
= check_box_tag 'build_list[include_repos][]', repo.id, checked,
:id => "include_repos_#{repo.id}", :rep_name => repo.name
= label_tag "include_repos_#{repo.id}", repo.name = label_tag "include_repos_#{repo.id}", repo.name