[refs #601] Add statuscheck for destroy action in product build list(small fix)

This commit is contained in:
Vladimir Sharshov 2012-08-06 17:08:13 +04:00
parent c7a3addfb8
commit dd1bf7719f
2 changed files with 3 additions and 2 deletions

View File

@ -26,7 +26,7 @@ class Platforms::ProductBuildListsController < Platforms::BaseController
if @product_build_list.destroy if @product_build_list.destroy
flash[:notice] = t('flash.product_build_list.delete') flash[:notice] = t('flash.product_build_list.delete')
else else
flash[:notice] = t('flash.product_build_list.delete_error') flash[:error] = t('flash.product_build_list.delete_error')
end end
redirect_to [@platform, @product] redirect_to [@platform, @product]
end end

View File

@ -3,5 +3,6 @@
%td= product_build_list.human_status %td= product_build_list.human_status
%td= link_to nil, product_build_list.container_path %td= link_to nil, product_build_list.container_path
%td= link_to product_build_list.product.name, platform_product_path(product_build_list.product.platform, product_build_list.product) %td= link_to product_build_list.product.name, platform_product_path(product_build_list.product.platform, product_build_list.product)
%td= link_to image_tag('x.png'), platform_product_product_build_list_path(product_build_list.product.platform, product_build_list.product, product_build_list), :method => :delete, :confirm => t("layout.confirm") if can?(:destroy, product_build_list) && product_build_list.can_destroy? - pbl = product_build_list
%td= link_to image_tag('x.png'), platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl), :method => :delete, :confirm => t("layout.confirm") if can?(:destroy, pbl) && pbl.can_destroy?
%td= l(product_build_list.updated_at, :format => :long) %td= l(product_build_list.updated_at, :format => :long)