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) where(:id => params[:build_list][:include_repos]).group(:platform_id).map(&:platform_id)
new_core = current_user.admin? && params[:build_list][:new_core] == '1' 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| Arch.where(:id => params[:arches]).each do |arch|
Platform.main.where(:id => build_for_platforms).each do |build_for_platform| Platform.main.where(:id => build_for_platforms).each do |build_for_platform|
@build_list = @project.build_lists.build(params[:build_list]) @build_list = @project.build_lists.build(params[:build_list])

View File

@ -131,17 +131,20 @@
- log_params = { :build_started => @build_list.build_started?, :get_log_path => log_build_list_path(@build_list) } - 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)}) ) = 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 .hr
= submit_tag t("layout.publish"), :confirm => t("layout.confirm"), :name => 'publish' if can_publish = 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) - if @build_list.can_reject_publish? && can?(:reject_publish, @build_list)
= submit_tag t("layout.reject_publish"), :confirm => t("layout.confirm"), :name => 'reject_publish' = submit_tag t("layout.reject_publish"), :confirm => t("layout.confirm"), :name => 'reject_publish'
.hr .hr
%h3= t("layout.build_lists.items_header") - if @build_list.new_core?
- if @item_groups.blank? = 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") %h4.nomargin= t("layout.build_lists.no_items_data")
- @item_groups.each_with_index do |group, level| - @item_groups.each_with_index do |group, level|
- group.each do |item| - group.each do |item|
%h4.nomargin= "#{item.name} ##{level}" %h4.nomargin= "#{item.name} ##{level}"
%table.tablesorter.width565{:cellpadding => "0", :cellspacing => "0"} %table.tablesorter.width565{:cellpadding => "0", :cellspacing => "0"}
@ -155,9 +158,9 @@
%td= item.name %td= item.name
%td= item.version %td= item.version
%td= item.human_status %td= item.human_status
.both .both
- if @build_list.packages.present? - if @build_list.packages.present?
.hr .hr
%h3= t("layout.build_lists.packages_header") %h3= t("layout.build_lists.packages_header")
%table.tablesorter.width565{:cellpadding => "0", :cellspacing => "0"} %table.tablesorter.width565{:cellpadding => "0", :cellspacing => "0"}
@ -176,9 +179,6 @@
%td= package.release %td= package.release
.both .both
- if @build_list.new_core?
= render 'platforms/product_build_lists/results', :pbl => @build_list
:javascript :javascript
$('article .all').addClass('bigpadding'); $('article .all').addClass('bigpadding');