#405: added ability to recreate mass builds
This commit is contained in:
parent
2c326e809e
commit
790ea62670
|
@ -8,13 +8,19 @@ class Platforms::MassBuildsController < Platforms::BaseController
|
|||
|
||||
|
||||
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
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
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
|
||||
redirect_to(platform_mass_builds_path(@platform), notice: t("flash.platform.build_all_success"))
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
%h3= t("activerecord.attributes.build_list.arch")
|
||||
- Arch.recent.each do |arch|
|
||||
.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
|
||||
.both
|
||||
- if @platform.personal?
|
||||
|
|
|
@ -61,3 +61,5 @@
|
|||
cancel_platform_mass_build_path(@platform, @mass_build.id),
|
||||
method: :post, class: 'button',
|
||||
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'
|
||||
|
|
|
@ -2,6 +2,7 @@ en:
|
|||
layout:
|
||||
mass_builds:
|
||||
new: New mass build
|
||||
recreate: Recreate mass build
|
||||
publish_success: Publish success builds
|
||||
publish_test_failed: Publish test failed builds
|
||||
repositories: Repositories
|
||||
|
|
|
@ -2,6 +2,7 @@ ru:
|
|||
layout:
|
||||
mass_builds:
|
||||
new: Новая массовая сборка
|
||||
recreate: Пересоздать массовую сборку
|
||||
publish_success: Опубликовать успешные сборки
|
||||
publish_test_failed: Опубликовать сборки с проваленными тестами
|
||||
repositories: Репозитории
|
||||
|
|
Loading…
Reference in New Issue