[refs #200] Fix build list form interface and include_repos logic

This commit is contained in:
konstantin.grabar 2012-03-20 14:36:31 +04:00
parent 1d56dfad3d
commit 31e0c9191c
3 changed files with 5 additions and 4 deletions

View File

@ -16,11 +16,11 @@ $(document).ready(function() {
$(this).attr('disabled', 'disabled');
$(this).parent().find('.offset25 input[type="checkbox"]').attr('disabled', 'disabled');
}
$('.additional_pl').parent().find('.offset25 input[type="checkbox"]').attr('disabled', 'disabled');
//$('.additional_pl').parent().find('.offset25 input[type="checkbox"]').attr('disabled', 'disabled');
} else {
$(this).removeAttr('disabled');
$(this).parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled');
$('.additional_pl').parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled');
//$('.additional_pl').parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled');
}
});
});

View File

@ -44,8 +44,9 @@ class BuildListsController < ApplicationController
@build_list = @project.build_lists.build(params[:build_list])
@build_list.commit_hash = @project.git_repository.commits(@build_list.project_version.match(/^latest_(.+)/).to_a.last || @build_list.project_version).first.id if @build_list.project_version
@build_list.bpl = bpl; @build_list.arch = arch; @build_list.user = current_user
@build_list.include_repos = @build_list.include_repos.select { |ir| @build_list.bpl.repository_ids.include? ir.to_i }
flash_options = {:project_version => @build_list.project_version, :arch => arch.name, :bpl => bpl.name, :pl => @build_list.pl}
if @build_list.save
if @build_list.save!
notices << t("flash.build_list.saved", flash_options)
else
errors << t("flash.build_list.save_error", flash_options)

View File

@ -4,7 +4,7 @@
.lineForm= f.select :project_version, @project.versions
%h3= t("activerecord.attributes.build_list.bpl")
.all_platforms
- (Platform.main | @project.platforms).each do |pl|
- Platform.main.each do |pl|
.both
- if pl.platform_type == 'main'
= check_box_tag "bpls[]", pl.id, (params[:bpls]||[]).include?(pl.id.to_s), :class => 'build_bpl_ids', :id => "bpls_#{pl.id}"