disable auto_publish for new_core, some refactoring

This commit is contained in:
Vokhmin Alexey V 2012-12-03 15:28:27 +04:00
parent 5c3514ec0f
commit ee73df5d3a
2 changed files with 38 additions and 37 deletions

View File

@ -56,6 +56,7 @@ class Projects::BuildListsController < Projects::BaseController
where(:id => params[:build_list][:include_repos]).group(:platform_id).map(&:platform_id)
new_core = current_user.admin? && params[:build_list][:new_core] == '1'
params[:build_list][:auto_publish] = false if new_core
Arch.where(:id => params[:arches]).each do |arch|
Platform.main.where(:id => build_for_platforms).each do |build_for_platform|
@build_list = @project.build_lists.build(params[:build_list])

View File

@ -131,13 +131,16 @@
- log_params = { :build_started => @build_list.build_started?, :get_log_path => log_build_list_path(@build_list) }
= render 'shared/log', ( @build_list.new_core? ? log_params : log_params.merge({:download_log_url => build_list_log_url(:build)}) )
- if (can_publish = @build_list.can_publish? && can?(:publish, @build_list))
- if (can_publish = @build_list.can_publish? && can?(:publish, @build_list) && !@build_list.new_core?)
.hr
= submit_tag t("layout.publish"), :confirm => t("layout.confirm"), :name => 'publish' if can_publish
- if @build_list.can_reject_publish? && can?(:reject_publish, @build_list)
= submit_tag t("layout.reject_publish"), :confirm => t("layout.confirm"), :name => 'reject_publish'
.hr
- if @build_list.new_core?
= render 'platforms/product_build_lists/results', :pbl => @build_list
- else
%h3= t("layout.build_lists.items_header")
- if @item_groups.blank?
%h4.nomargin= t("layout.build_lists.no_items_data")
@ -176,9 +179,6 @@
%td= package.release
.both
- if @build_list.new_core?
= render 'platforms/product_build_lists/results', :pbl => @build_list
:javascript
$('article .all').addClass('bigpadding');