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,53 +131,53 @@
- 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
%h3= t("layout.build_lists.items_header")
- if @item_groups.blank?
%h4.nomargin= t("layout.build_lists.no_items_data")
- @item_groups.each_with_index do |group, level|
- group.each do |item|
%h4.nomargin= "#{item.name} ##{level}"
- 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")
- @item_groups.each_with_index do |group, level|
- group.each do |item|
%h4.nomargin= "#{item.name} ##{level}"
%table.tablesorter.width565{:cellpadding => "0", :cellspacing => "0"}
%thead
%tr
%th= t("activerecord.attributes.build_list/item.name")
%th= t("activerecord.attributes.build_list/item.version")
%th= t("activerecord.attributes.build_list/item.status")
%tbody
%tr{:class => build_list_item_status_color(item.status)}
%td= item.name
%td= item.version
%td= item.human_status
.both
- if @build_list.packages.present?
.hr
%h3= t("layout.build_lists.packages_header")
%table.tablesorter.width565{:cellpadding => "0", :cellspacing => "0"}
%thead
%tr
%th= t("activerecord.attributes.build_list/item.name")
%th= t("activerecord.attributes.build_list/item.version")
%th= t("activerecord.attributes.build_list/item.status")
%th= t("activerecord.attributes.build_list/package.fullname")
%th= t("activerecord.attributes.build_list/package.name")
%th= t("activerecord.attributes.build_list/package.version")
%th= t("activerecord.attributes.build_list/package.release")
%tbody
%tr{:class => build_list_item_status_color(item.status)}
%td= item.name
%td= item.version
%td= item.human_status
.both
- if @build_list.packages.present?
.hr
%h3= t("layout.build_lists.packages_header")
%table.tablesorter.width565{:cellpadding => "0", :cellspacing => "0"}
%thead
%tr
%th= t("activerecord.attributes.build_list/package.fullname")
%th= t("activerecord.attributes.build_list/package.name")
%th= t("activerecord.attributes.build_list/package.version")
%th= t("activerecord.attributes.build_list/package.release")
%tbody
- @build_list.packages.each do |package|
%tr
%td= package.fullname
%td= package.name
%td= package.version
%td= package.release
.both
- if @build_list.new_core?
= render 'platforms/product_build_lists/results', :pbl => @build_list
- @build_list.packages.each do |package|
%tr
%td= package.fullname
%td= package.name
%td= package.version
%td= package.release
.both
:javascript
$('article .all').addClass('bigpadding');