From b1722cae758e80151fbf8e39e789eeded91aca89 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 6 Nov 2012 20:19:52 +0400 Subject: [PATCH] added some params for build ISO --- .../product_build_lists_controller.rb | 2 ++ app/models/product_build_list.rb | 2 +- .../product_build_lists/new.html.haml | 18 +++++++++++++++++- app/views/platforms/products/_form.html.haml | 9 ++++++++- ..._integrate_new_iso_builder_with_products.rb | 3 +++ db/schema.rb | 3 +++ 6 files changed, 34 insertions(+), 3 deletions(-) diff --git a/app/controllers/platforms/product_build_lists_controller.rb b/app/controllers/platforms/product_build_lists_controller.rb index 5307665a0..5ee747c94 100644 --- a/app/controllers/platforms/product_build_lists_controller.rb +++ b/app/controllers/platforms/product_build_lists_controller.rb @@ -11,6 +11,8 @@ class Platforms::ProductBuildListsController < Platforms::BaseController before_filter :find_product_build_list, :only => [:status_build] def new + @project = @product_build_list.product.project + @arches = Arch.recent.map{ |a| [a.name, a.id] } end def create diff --git a/app/models/product_build_list.rb b/app/models/product_build_list.rb index 72750ab88..0a1178123 100644 --- a/app/models/product_build_list.rb +++ b/app/models/product_build_list.rb @@ -25,7 +25,7 @@ class ProductBuildList < ActiveRecord::Base validates :status, :inclusion => { :in => [BUILD_STARTED, BUILD_COMPLETED, BUILD_FAILED] } attr_accessor :base_url - attr_accessible :status, :base_url, :branch, :arch_id, :project_id + attr_accessible :status, :base_url, :branch, :arch_id, :project_id, :main_script, :iso_folder, :params attr_readonly :product_id diff --git a/app/views/platforms/product_build_lists/new.html.haml b/app/views/platforms/product_build_lists/new.html.haml index 54fbc08f9..4205b161c 100644 --- a/app/views/platforms/product_build_lists/new.html.haml +++ b/app/views/platforms/product_build_lists/new.html.haml @@ -3,4 +3,20 @@ = render 'sidebar' = form_for @product_build_list, :html => {:class => :form} do |f| - = render 'form', :f => f \ No newline at end of file + .leftlist= f.label :lst, t("activerecord.attributes.product_build_lists.lst"), :class => :label + .rightlist= @product_build_list.product.try(:lst) + .both + + .leftlist= f.label :project, t("activerecord.attributes.product_build_lists.project"), :class => :label + .rightlist= @product_build_list.product.project.try(:name_with_owner) + .both + + .leftlist= f.label :project_version, t("activerecord.attributes.product_build_lists.project_version"), :class => :label + .rightlist= f.select :project_version, versions_for_group_select(@project), :selected => params[:product_build_lists].try(:fetch, :project_version) || "latest_" + @project.default_branch + .both + + .leftlist= f.label :arch, t("activerecord.attributes.product_build_lists.arch"), :class => :label + .rightlist= f.select :arch, @arches + .both + + diff --git a/app/views/platforms/products/_form.html.haml b/app/views/platforms/products/_form.html.haml index 3652f9a93..948bd7d66 100644 --- a/app/views/platforms/products/_form.html.haml +++ b/app/views/platforms/products/_form.html.haml @@ -42,7 +42,14 @@ = t('layout.products.new_iso_builder') %br %br -= render 'platforms/product_build_lists/form', :f => f +.leftlist= f.label :project, t("activerecord.attributes.product.project"), :class => :label +.rightlist= f.autocomplete_field :project, autocomplete_project_platform_products_path(@platform), :id_element => 'src_project_id', :name => 'src_project', :value => @product.project.try(:name_with_owner) +.both + +.leftlist= f.label :lst, t("activerecord.attributes.product.lst"), :class => :label +.rightlist= f.text_field :lst, :class => 'text_field' +.both + .leftlist= f.label :repos, t("activerecord.attributes.product.repos"), :class => :label .rightlist= f.text_area :repos, :class => 'text_field resizable' .both diff --git a/db/migrate/20121106113338_integrate_new_iso_builder_with_products.rb b/db/migrate/20121106113338_integrate_new_iso_builder_with_products.rb index 290738447..2aedd1010 100644 --- a/db/migrate/20121106113338_integrate_new_iso_builder_with_products.rb +++ b/db/migrate/20121106113338_integrate_new_iso_builder_with_products.rb @@ -13,5 +13,8 @@ class IntegrateNewIsoBuilderWithProducts < ActiveRecord::Migration add_column :product_build_lists, :repo, :string add_column :product_build_lists, :arch_id, :integer + add_column :product_build_lists, :params, :string + add_column :product_build_lists, :main_script, :string + add_column :product_build_lists, :iso_folder, :string end end diff --git a/db/schema.rb b/db/schema.rb index 44e990748..54a18df6f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -287,6 +287,9 @@ ActiveRecord::Schema.define(:version => 20121106113338) do t.string "lst" t.string "repo" t.integer "arch_id" + t.string "params" + t.string "main_script" + t.string "iso_folder" end add_index "product_build_lists", ["product_id"], :name => "index_product_build_lists_on_product_id"