Merge branch 'master' into 258-removeBackboneJS

This commit is contained in:
Vokhmin Alexey V 2013-08-08 18:11:03 +04:00
commit e7b750cc21
4 changed files with 11 additions and 11 deletions

View File

@ -165,14 +165,14 @@ class Projects::BuildListsController < Projects::BaseController
def create_from_build_list
return if params[:build_list_id].blank?
@build_list = BuildList.find params[:build_list_id]
build_list = BuildList.find(params[:build_list_id])
params[:build_list] ||= {}
keys = [:save_to_repository_id, :auto_publish, :include_repos,
:project_version, :update_type, :auto_create_container,
:extra_repositories, :extra_build_lists, :build_for_platform_id]
keys.each { |key| params[:build_list][key] = @build_list.send(key) }
params[:arches] = [@build_list.arch_id.to_s]
keys.each { |key| params[:build_list][key] = build_list.send(key) }
params[:arches] = [build_list.arch_id.to_s]
[:owner_filter, :status_filter].each { |t| params[t] = 'true' if %w(true undefined).exclude? params[t] }
end
end

View File

@ -4,6 +4,6 @@
- checked = (params[:build_list].try(:[], :include_repos).map(&:to_s) || []).include?(repo.id.to_s)
- else checked = false
= check_box_tag 'build_list[include_repos][]', repo.id, checked,
:disabled => params[:build_list].try(:[], :build_for_platform_id).to_i != platform.id,
:disabled => ((params[:build_list].try(:[], :build_for_platform_id).to_i != platform.id) && @build_list.build_for_platform.try(:main?)),
:id => "include_repos_#{repo.id}", :rep_name => repo.name
= label_tag "include_repos_#{repo.id}", repo.name

View File

@ -1,4 +1,4 @@
= form_for new_project_build_list_path(project), :html => { :class => :form, :method => :post } do |f|
= form_for [@project, @build_list], :html => { :class => :form, :method => :post } do |f|
%section.left
%h3= t("activerecord.attributes.build_list.build_for_platform")
.all_platforms
@ -8,10 +8,10 @@
.offset25= render 'include_repos', :platform => pl
%section.right
%h3= t('activerecord.attributes.build_list.save_to_repository')
- selected = params[:build_list].try(:fetch, :save_to_repository_id) ? {:selected => params[:build_list][:save_to_repository_id]} : {}
.lineForm= f.select :save_to_repository_id, save_to_repositories(project), selected, :id => 'build_list_save_to_repository_id'
- selected = params[:build_list].try(:[], :save_to_repository_id) ? {:selected => params[:build_list][:save_to_repository_id]} : {}
.lineForm= f.select :save_to_repository_id, save_to_repositories(project), selected
%h3= t("activerecord.attributes.build_list.project_version")
.lineForm= f.select :project_version, versions_for_group_select(project), {}, :selected => params[:build_list].try(:fetch, :project_version) || project.default_branch, :id => 'build_list_project_version'
.lineForm= f.select :project_version, versions_for_group_select(project), {}, :selected => params[:build_list].try(:[], :project_version) || project.default_branch
%h3= t("activerecord.attributes.build_list.arch")
- Arch.recent.each do |arch|
.both
@ -20,7 +20,7 @@
= label_tag "arches_#{arch.id}", arch.name
%h3= t('activerecord.attributes.build_list.update_type')
- selected = params[:build_list].try(:fetch, :update_type) ? {:selected => params[:build_list][:update_version]} : {}
.lineForm= f.select :update_type, BuildList::UPDATE_TYPES, selected, :id => 'build_list_update_types'
.lineForm= f.select :update_type, BuildList::UPDATE_TYPES, selected
= render 'shared/autocomplete_form',
:field => :extra_repositories,
@ -39,7 +39,7 @@
%h3= t("activerecord.attributes.build_list.preferences")
- [:auto_publish, :auto_create_container].each do |kind|
.both
- checked = params[:build_list].try(:fetch, kind)
- checked = params[:build_list].try(:[], kind)
= check_box_tag "build_list[#{kind}]", checked, checked
= f.label kind
%br

View File

@ -25,7 +25,7 @@
%table.tablesorter{:cellpadding => "0", :cellspacing => "0"}
%tbody
- field_name = "#{subject_class}[#{field}][]"
- field_class.where(:id => params[:build_list].try(:fetch, field) || subject.send(field)).each do |extra|
- field_class.where(:id => params[:build_list].try(:[], field) ).each do |extra|
%tr
- if extra.is_a?(BuildList)
%td= link_to "#{extra.id} (#{extra.project.name} - #{extra.arch.name})", extra