Rename product field build to build_script. Change links. Refs #2161
This commit is contained in:
parent
7996740ae7
commit
e7f9d8251a
|
@ -9,7 +9,7 @@ class ProductsController < ApplicationController
|
|||
@product.ks = DEFAULT_KS
|
||||
@product.menu = DEFAULT_MENU
|
||||
@product.counter = DEFAULT_COUNTER
|
||||
@product.build = DEFAULT_BUILD
|
||||
@product.build_script = DEFAULT_BUILD
|
||||
end
|
||||
|
||||
# def clone
|
||||
|
|
|
@ -3,7 +3,7 @@ class Product < ActiveRecord::Base
|
|||
# BUILD_COMPLETED = 0
|
||||
# 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 :build_status, :inclusion => { :in => [ NEVER_BUILT, BUILD_COMPLETED, BUILD_FAILED ] }
|
||||
|
|
|
@ -19,14 +19,14 @@ class ProductBuildList < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def event_log_message
|
||||
{:product => Product.find(product_id).name}.inspect # TODO WTF product.name == nil ???
|
||||
{:product => product.name}.inspect
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def xml_rpc_create
|
||||
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
|
||||
return true
|
||||
else
|
||||
|
|
|
@ -104,9 +104,9 @@
|
|||
- @platform.products.recent.each do |product|
|
||||
%tr{:class => cycle("odd", "even")}
|
||||
%td
|
||||
= link_to product.name, edit_platform_product_path(@platform, product)
|
||||
= link_to product.name, [@platform, product]
|
||||
%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
|
||||
- content_for :sidebar, render(:partial => 'sidebar')
|
||||
|
|
|
@ -1,21 +1,28 @@
|
|||
%h1 Listing product_build_lists
|
||||
|
||||
%table
|
||||
%tr
|
||||
%th Product
|
||||
%th Status
|
||||
%th
|
||||
%th
|
||||
%th
|
||||
|
||||
- @product_build_lists.each do |product_build_list|
|
||||
%tr
|
||||
%td= product_build_list.product
|
||||
%td= product_build_list.status
|
||||
%td= link_to 'Show', product_build_list
|
||||
%td= link_to 'Edit', edit_product_build_list_path(product_build_list)
|
||||
%td= link_to 'Destroy', product_build_list, :confirm => 'Are you sure?', :method => :delete
|
||||
|
||||
%br
|
||||
|
||||
= link_to 'New Product build list', new_product_build_list_path
|
||||
/ .block
|
||||
/ - if controller.action_name != 'all'
|
||||
/ .secondary-navigation
|
||||
/ %ul.wat-cf
|
||||
/ %li.first= link_to t("layout.build_lists.current"), project_path(@project) + "#build_lists"
|
||||
/ %li.active= link_to t("layout.build_lists.all"), project_build_lists_path(@project)
|
||||
/
|
||||
/ .content
|
||||
/ - if controller.action_name == 'all'
|
||||
/ .inner
|
||||
/ %h2= t('layout.build_lists.build_server_status.header')
|
||||
/ .field
|
||||
/ %span= t('layout.build_lists.build_server_status.client_count') + ":"
|
||||
/ %span= @build_server_status['client_count']
|
||||
/ .field
|
||||
/ %span= t('layout.build_lists.build_server_status.count_new_task') + ":"
|
||||
/ %span= @build_server_status['count_new_task']
|
||||
/ .field
|
||||
/ %span= t('layout.build_lists.build_server_status.count_build_task') + ":"
|
||||
/ %span= @build_server_status['count_build_task']
|
||||
/
|
||||
/ .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'
|
|
@ -2,8 +2,8 @@
|
|||
= f.label :name, t("activerecord.attributes.product.name"), :class => :label
|
||||
= f.text_field :name, :class => 'text_field'
|
||||
.group
|
||||
= f.label :build, t("activerecord.attributes.product.build"), :class => :label
|
||||
= f.text_area :build, :class => 'text_field', :cols => 80
|
||||
= f.label :build_script, t("activerecord.attributes.product.build_script"), :class => :label
|
||||
= f.text_area :build_script, :class => 'text_field', :cols => 80
|
||||
.group
|
||||
= f.label :counter, t("activerecord.attributes.product.counter"), :class => :label
|
||||
= f.text_area :counter, :class => 'text_field', :cols => 80
|
||||
|
|
|
@ -31,6 +31,7 @@ require 'xmlrpc/client'
|
|||
module XMLRPC
|
||||
class Client
|
||||
def call(*args)
|
||||
# raise args.inspect
|
||||
case
|
||||
when args.first == 'get_status'
|
||||
{:client_count => '1', :count_new_task => '2', :count_build_task => 3}
|
||||
|
|
|
@ -449,7 +449,7 @@ ru:
|
|||
updated_at: Обновлен
|
||||
ks: Содержимое .ks.template
|
||||
counter: Содержимое .counter
|
||||
build: Содержимое build
|
||||
build_script: Содержимое build
|
||||
menu: Содержимое .menu.xml
|
||||
tar: Tar.bz2 файл
|
||||
is_template: Шаблон
|
||||
|
|
|
@ -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
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# 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|
|
||||
t.string "name", :null => false
|
||||
|
@ -188,7 +188,7 @@ ActiveRecord::Schema.define(:version => 20111107211538) do
|
|||
t.string "build_path"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.text "build"
|
||||
t.text "build_script"
|
||||
t.text "counter"
|
||||
t.text "ks"
|
||||
t.text "menu"
|
||||
|
|
Loading…
Reference in New Issue