[refs #442] Fix auto_publish select

This commit is contained in:
konstantin.grabar 2012-06-21 17:49:20 +04:00
parent c3b5951465
commit 10efb2401a
2 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,7 @@ class Platforms::PlatformsController < Platforms::BaseController
if mass_build.save
redirect_to(mass_builds_platform_path(@platform), :notice => t("flash.platform.build_all_success"))
else
@auto_publish_selected = params[:auto_publish].present? ? params[:auto_publish].present? : false
@mass_builds = MassBuild.by_platform(@platform).order('created_at DESC').paginate(:page => params[:page], :per_page => 20)
flash[:warning] = mass_build.errors.full_messages.join('. ')
flash[:error] = t("flash.platform.build_all_error")
@ -25,6 +26,7 @@ class Platforms::PlatformsController < Platforms::BaseController
def mass_builds
@mass_builds = MassBuild.by_platform(@platform).order('created_at DESC').paginate(:page => params[:page], :per_page => 20)
@auto_publish_selected = true
render :action => :build_all
end

View File

@ -19,7 +19,7 @@
.both
%h3= t("activerecord.attributes.build_list.preferences")
.both.bottom_20
= check_box_tag :auto_publish, true, params[:auto_publish].present? ? params[:auto_publish].present? : false, :id => 'auto_publish'
= check_box_tag :auto_publish, true, @auto_publish_selected, :id => 'auto_publish'
= label_tag :auto_publish
%br