#237: sorted repositories in top of list in new build list page

This commit is contained in:
Vokhmin Alexey V 2013-07-25 20:57:10 +04:00
parent 0868bbc9b3
commit 95cdb1cc04
2 changed files with 6 additions and 1 deletions

View File

@ -19,6 +19,11 @@ module BuildListsHelper
.joins(:repositories).uniq .joins(:repositories).uniq
end end
def platform_repositories(platform)
repositories = platform.repositories.order(:name)
repositories.select{ |r| %w(main base).include?(r.name) } | repositories
end
def save_to_repositories(project) def save_to_repositories(project)
project.repositories.collect do |r| project.repositories.collect do |r|
[ [

View File

@ -1,4 +1,4 @@
- platform.repositories.each do |repo| - platform_repositories(platform).each do |repo|
.both .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}", :rep_name => repo.name = check_box_tag "build_list[include_repos][]", repo.id, repo.name == 'main' || @project.repositories.map(&:id).include?(repo.id), :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