From 1d7f02386caf8b7d0e31056d576adbd89a09acbd Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 15 May 2015 19:18:30 +0500 Subject: [PATCH] dependent packages: fix auto publish status option --- app/jobs/build_lists/dependent_packages_job.rb | 2 +- .../build_lists/dependent_projects.html.slim | 6 ++++-- config/initializers/simple_form_bootstrap.rb | 12 ++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/jobs/build_lists/dependent_packages_job.rb b/app/jobs/build_lists/dependent_packages_job.rb index aeca0b36d..d04cf6bd0 100644 --- a/app/jobs/build_lists/dependent_packages_job.rb +++ b/app/jobs/build_lists/dependent_packages_job.rb @@ -39,8 +39,8 @@ module BuildLists group_id ).each { |field| bl.send("#{field}=", build_list.send(field)) } + bl.auto_publish_status = options[:auto_publish_status] %w( - auto_publish_status auto_create_container include_testing_subrepository use_cached_chroot diff --git a/app/views/projects/build_lists/dependent_projects.html.slim b/app/views/projects/build_lists/dependent_projects.html.slim index 95a901ba8..48e7f0dd2 100644 --- a/app/views/projects/build_lists/dependent_projects.html.slim +++ b/app/views/projects/build_lists/dependent_projects.html.slim @@ -10,7 +10,8 @@ url: dependent_projects_build_list_path(@build_list), html: { method: :post }, wrapper: :horizontal_form, - wrapper_mappings: { boolean: :horizontal_boolean } do |f| + wrapper_mappings: { boolean: :horizontal_boolean, + select: :horizontal_select } do |f| .col-md-6 .row @@ -49,7 +50,8 @@ .col-sm-offset-3.col-sm-9 h4 = t('.preferences') - = f.input :auto_publish_status, as: :boolean + = f.input :auto_publish_status, as: :select, collection: auto_publish_statuses, + include_blank: false = f.input :auto_create_container, as: :boolean = f.input :include_testing_subrepository, as: :boolean = f.input :use_cached_chroot, as: :boolean diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb index 6a28d6860..cbf8229f7 100644 --- a/config/initializers/simple_form_bootstrap.rb +++ b/config/initializers/simple_form_bootstrap.rb @@ -94,6 +94,18 @@ SimpleForm.setup do |config| end end + config.wrappers :horizontal_select, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| + b.use :html5 + b.optional :readonly + + b.wrapper tag: 'div', class: 'col-sm-offset-3 col-sm-9' do |wr| + wr.use :label_input, class: 'col-sm-9' + + wr.use :error, wrap_with: { tag: 'span', class: 'help-block' } + wr.use :hint, wrap_with: { tag: 'p', class: 'help-block' } + end + end + config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| b.use :html5 b.optional :readonly