#405: added ability to recreate mass builds

This commit is contained in:
Vokhmin Alexey V 2014-06-26 23:51:21 +04:00
parent 2c326e809e
commit 790ea62670
5 changed files with 12 additions and 2 deletions

View File

@ -8,13 +8,19 @@ class Platforms::MassBuildsController < Platforms::BaseController
def new def new
if params[:mass_build_id].present?
@mass_build = @platform.mass_builds.find(params[:mass_build_id]).dup
@mass_build.arches = Arch.where(name: @mass_build.arch_names.split(', ')).pluck(:id)
end
@mass_build.arches ||= @platform.platform_arch_settings.by_default.pluck(:arch_id)
@mass_build.arches.map!(&:to_s)
end end
def show def show
end end
def create def create
@mass_build.user, @mass_build.arches = current_user, params[:arches] @mass_build.user, @mass_build.arches = current_user, params[:arches] || []
if @mass_build.save if @mass_build.save
redirect_to(platform_mass_builds_path(@platform), notice: t("flash.platform.build_all_success")) redirect_to(platform_mass_builds_path(@platform), notice: t("flash.platform.build_all_success"))

View File

@ -18,7 +18,7 @@
%h3= t("activerecord.attributes.build_list.arch") %h3= t("activerecord.attributes.build_list.arch")
- Arch.recent.each do |arch| - Arch.recent.each do |arch|
.lefter .lefter
= check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s), id: "arches_#{arch.id}" = check_box_tag "arches[]", arch.id, @mass_build.arches.include?(arch.id.to_s), id: "arches_#{arch.id}"
= label_tag "arches_#{arch.id}", arch.name = label_tag "arches_#{arch.id}", arch.name
.both .both
- if @platform.personal? - if @platform.personal?

View File

@ -61,3 +61,5 @@
cancel_platform_mass_build_path(@platform, @mass_build.id), cancel_platform_mass_build_path(@platform, @mass_build.id),
method: :post, class: 'button', method: :post, class: 'button',
data: { confirm: t('layout.mass_builds.cancel_confirm') } data: { confirm: t('layout.mass_builds.cancel_confirm') }
- if can? :create, @mass_build
= link_to t('layout.mass_builds.recreate'), new_platform_mass_build_path(@platform, mass_build_id: @mass_build.id), class: 'button'

View File

@ -2,6 +2,7 @@ en:
layout: layout:
mass_builds: mass_builds:
new: New mass build new: New mass build
recreate: Recreate mass build
publish_success: Publish success builds publish_success: Publish success builds
publish_test_failed: Publish test failed builds publish_test_failed: Publish test failed builds
repositories: Repositories repositories: Repositories

View File

@ -2,6 +2,7 @@ ru:
layout: layout:
mass_builds: mass_builds:
new: Новая массовая сборка new: Новая массовая сборка
recreate: Пересоздать массовую сборку
publish_success: Опубликовать успешные сборки publish_success: Опубликовать успешные сборки
publish_test_failed: Опубликовать сборки с проваленными тестами publish_test_failed: Опубликовать сборки с проваленными тестами
repositories: Репозитории repositories: Репозитории