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)
|
|
|
|
link_to mass_build.name, build_lists_path+"#?#{{filter: {mass_build_id: mass_build.id, ownership: 'everything'}}.to_param}"
|
|
|
|
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
|