rosa-build/app/helpers/mass_build_helper.rb

26 lines
829 B
Ruby
Raw Normal View History

2012-12-06 17:59:17 +00:00
module MassBuildHelper
2014-06-26 22:21:31 +01:00
2012-12-06 17:59:17 +00:00
def link_to_list platform, mass_build, which
link_to t("layout.mass_builds.#{which}"),
2014-06-26 22:21:31 +01:00
get_list_platform_mass_build_path(platform, mass_build, kind: which, format: :txt),
2015-03-14 22:10:04 +00:00
target: "_blank" if policy(mass_build).get_list?
2012-12-06 17:59:17 +00:00
end
2014-06-26 18:20:26 +01:00
def link_to_mass_build(mass_build)
2016-05-22 14:31:01 +01:00
link_to mass_build.name, build_lists_path+"#?#{{mass_build_id: mass_build.id, ownership: 'everything'}.to_param}"
2014-06-26 18:20:26 +01:00
end
2014-06-26 22:21:31 +01:00
2014-11-18 15:58:39 +00:00
def new_mass_build_data(mass_build, platform, params)
{
platform_id: mass_build.save_to_platform.try(:id),
repositories: platform.repositories.map do |repo|
{ id: repo.id,
name: repo.name,
checked: (params[:repositories]||[]).include?(repo.id.to_s) }
end
}.to_json
2014-06-26 22:21:31 +01:00
end
2012-12-06 17:59:17 +00:00
end