Rename product field build to build_script. Change links. Refs #2161

This commit is contained in:
Pavel Chipiga 2011-11-11 21:11:27 +02:00
parent 7996740ae7
commit e7f9d8251a
10 changed files with 49 additions and 32 deletions

View File

@ -9,7 +9,7 @@ class ProductsController < ApplicationController
@product.ks = DEFAULT_KS @product.ks = DEFAULT_KS
@product.menu = DEFAULT_MENU @product.menu = DEFAULT_MENU
@product.counter = DEFAULT_COUNTER @product.counter = DEFAULT_COUNTER
@product.build = DEFAULT_BUILD @product.build_script = DEFAULT_BUILD
end end
# def clone # def clone

View File

@ -3,7 +3,7 @@ class Product < ActiveRecord::Base
# BUILD_COMPLETED = 0 # BUILD_COMPLETED = 0
# BUILD_FAILED = 1 # BUILD_FAILED = 1
ATTRS_TO_CLONE = [ 'build_path', 'build', 'build', 'counter', 'ks', 'menu', 'tar', 'use_cron', 'cron_tab' ] ATTRS_TO_CLONE = [ 'build_path', 'build_script', 'counter', 'ks', 'menu', 'tar', 'use_cron', 'cron_tab' ]
validates :name, :presence => true, :uniqueness => {:scope => :platform_id} validates :name, :presence => true, :uniqueness => {:scope => :platform_id}
# validates :build_status, :inclusion => { :in => [ NEVER_BUILT, BUILD_COMPLETED, BUILD_FAILED ] } # validates :build_status, :inclusion => { :in => [ NEVER_BUILT, BUILD_COMPLETED, BUILD_FAILED ] }

View File

@ -19,14 +19,14 @@ class ProductBuildList < ActiveRecord::Base
end end
def event_log_message def event_log_message
{:product => Product.find(product_id).name}.inspect # TODO WTF product.name == nil ??? {:product => product.name}.inspect
end end
protected protected
def xml_rpc_create def xml_rpc_create
tar_url = "#{base_url}#{product.tar.url}" tar_url = "#{base_url}#{product.tar.url}"
result = ProductBuilder.create_product id, product.platform.unixname, product.ks, product.menu, product.build, product.counter, [], tar_url result = ProductBuilder.create_product id, product.platform.unixname, product.ks, product.menu, product.build_script, product.counter, [], tar_url
if result == ProductBuilder::SUCCESS if result == ProductBuilder::SUCCESS
return true return true
else else

View File

@ -104,9 +104,9 @@
- @platform.products.recent.each do |product| - @platform.products.recent.each do |product|
%tr{:class => cycle("odd", "even")} %tr{:class => cycle("odd", "even")}
%td %td
= link_to product.name, edit_platform_product_path(@platform, product) = link_to product.name, [@platform, product]
%td.last %td.last
#{link_to t("layout.show"), platform_product_path(@platform, product)} | #{link_to t("layout.delete"), platform_product_path(@platform, product), :method => :delete, :confirm => t("layout.products.confirm_delete")} #{(product.can_clone? ? "| #{link_to t("layout.products.clone"), clone_platform_product_path(@platform, product)}" : "").html_safe } #{link_to t("layout.edit"), edit_platform_product_path(@platform, product)} | #{link_to t("layout.delete"), platform_product_path(@platform, product), :method => :delete, :confirm => t("layout.products.confirm_delete")} #{(product.can_clone? ? "| #{link_to t("layout.products.clone"), clone_platform_product_path(@platform, product)}" : "").html_safe }
.actions-bar.wat-cf .actions-bar.wat-cf
.actions .actions
- content_for :sidebar, render(:partial => 'sidebar') - content_for :sidebar, render(:partial => 'sidebar')

View File

@ -1,21 +1,28 @@
%h1 Listing product_build_lists / .block
/ - if controller.action_name != 'all'
%table / .secondary-navigation
%tr / %ul.wat-cf
%th Product / %li.first= link_to t("layout.build_lists.current"), project_path(@project) + "#build_lists"
%th Status / %li.active= link_to t("layout.build_lists.all"), project_build_lists_path(@project)
%th /
%th / .content
%th / - if controller.action_name == 'all'
/ .inner
- @product_build_lists.each do |product_build_list| / %h2= t('layout.build_lists.build_server_status.header')
%tr / .field
%td= product_build_list.product / %span= t('layout.build_lists.build_server_status.client_count') + ":"
%td= product_build_list.status / %span= @build_server_status['client_count']
%td= link_to 'Show', product_build_list / .field
%td= link_to 'Edit', edit_product_build_list_path(product_build_list) / %span= t('layout.build_lists.build_server_status.count_new_task') + ":"
%td= link_to 'Destroy', product_build_list, :confirm => 'Are you sure?', :method => :delete / %span= @build_server_status['count_new_task']
/ .field
%br / %span= t('layout.build_lists.build_server_status.count_build_task') + ":"
/ %span= @build_server_status['count_build_task']
= link_to 'New Product build list', new_product_build_list_path /
/ .inner
/ = render :partial => "build_lists/filter", :action_url => @action_url
/
/ .inner
/ = render :partial => "build_lists/build_lists", :object => @build_lists
/
/ - content_for :sidebar, render(:partial => 'sidebar') if controller.action_name != 'all'

View File

@ -2,8 +2,8 @@
= f.label :name, t("activerecord.attributes.product.name"), :class => :label = f.label :name, t("activerecord.attributes.product.name"), :class => :label
= f.text_field :name, :class => 'text_field' = f.text_field :name, :class => 'text_field'
.group .group
= f.label :build, t("activerecord.attributes.product.build"), :class => :label = f.label :build_script, t("activerecord.attributes.product.build_script"), :class => :label
= f.text_area :build, :class => 'text_field', :cols => 80 = f.text_area :build_script, :class => 'text_field', :cols => 80
.group .group
= f.label :counter, t("activerecord.attributes.product.counter"), :class => :label = f.label :counter, t("activerecord.attributes.product.counter"), :class => :label
= f.text_area :counter, :class => 'text_field', :cols => 80 = f.text_area :counter, :class => 'text_field', :cols => 80

View File

@ -31,6 +31,7 @@ require 'xmlrpc/client'
module XMLRPC module XMLRPC
class Client class Client
def call(*args) def call(*args)
# raise args.inspect
case case
when args.first == 'get_status' when args.first == 'get_status'
{:client_count => '1', :count_new_task => '2', :count_build_task => 3} {:client_count => '1', :count_new_task => '2', :count_build_task => 3}

View File

@ -449,7 +449,7 @@ ru:
updated_at: Обновлен updated_at: Обновлен
ks: Содержимое .ks.template ks: Содержимое .ks.template
counter: Содержимое .counter counter: Содержимое .counter
build: Содержимое build build_script: Содержимое build
menu: Содержимое .menu.xml menu: Содержимое .menu.xml
tar: Tar.bz2 файл tar: Tar.bz2 файл
is_template: Шаблон is_template: Шаблон

View File

@ -0,0 +1,9 @@
class RenameProductsBuildToBuildScript < ActiveRecord::Migration
def self.up
rename_column :products, :build, :build_script
end
def self.down
rename_column :products, :build_script, :build
end
end

View File

@ -10,7 +10,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20111107211538) do ActiveRecord::Schema.define(:version => 20111111184657) do
create_table "arches", :force => true do |t| create_table "arches", :force => true do |t|
t.string "name", :null => false t.string "name", :null => false
@ -188,7 +188,7 @@ ActiveRecord::Schema.define(:version => 20111107211538) do
t.string "build_path" t.string "build_path"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.text "build" t.text "build_script"
t.text "counter" t.text "counter"
t.text "ks" t.text "ks"
t.text "menu" t.text "menu"