From 4601de81e417d88af192e98afd39a8700f43f5bc Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Wed, 18 Jun 2014 21:48:18 +0400 Subject: [PATCH] disable creation of dependent projects for builds from RELS --- app/helpers/build_lists_helper.rb | 5 +++++ app/views/projects/build_lists/show.html.haml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/helpers/build_lists_helper.rb b/app/helpers/build_lists_helper.rb index 5cebbfd3c..5c1d21aeb 100644 --- a/app/helpers/build_lists_helper.rb +++ b/app/helpers/build_lists_helper.rb @@ -14,6 +14,11 @@ module BuildListsHelper end end + def can_run_dependent_build_lists?(build_list) + build_list.save_to_platform.main? && + build_list.save_to_platform.distrib_type == 'mdv' + end + def availables_main_platforms Platform.availables_main_platforms current_user, current_ability end diff --git a/app/views/projects/build_lists/show.html.haml b/app/views/projects/build_lists/show.html.haml index e11d869d8..e7e0a4e0c 100644 --- a/app/views/projects/build_lists/show.html.haml +++ b/app/views/projects/build_lists/show.html.haml @@ -220,7 +220,7 @@ 'ng-show' => 'build_list.can_create_container' - if can? :create, @build_list = link_to t('layout.build_lists.recreate_build_list'), new_project_build_list_path(@build_list.project, build_list_id: @build_list.id), class: 'button' - - if @build_list.save_to_platform.main? + - if can_run_dependent_build_lists?(@build_list) = link_to t('layout.build_lists.run_build_lists'), project_build_lists_path(@build_list.project, origin: @build_list.id), method: :post,