rosa-build/app/helpers/platforms_helper.rb

25 lines
745 B
Ruby
Raw Normal View History

2012-01-30 20:39:34 +00:00
# -*- encoding : utf-8 -*-
2011-03-09 19:27:51 +00:00
module PlatformsHelper
2011-03-31 13:13:04 +01:00
def repository_name_postfix(platform)
return "" unless platform
return platform.released ? '/update' : '/release'
end
def platform_printed_name(platform)
return "" unless platform
platform.released? ? "#{platform.name} #{I18n.t("layout.platforms.released_suffix")}" : platform.name
end
def platform_arch_settings(platform)
settings = platform.platform_arch_settings
2013-07-25 12:02:44 +01:00
settings |= Arch.where('id not in (?)', settings.map(&:arch_id)).map do |arch|
platform.platform_arch_settings.build(
:arch_id => arch.id,
:time_living => PlatformArchSetting::DEFAULT_TIME_LIVING
)
end
settings.sort_by{ |s| s.arch.name }
end
2011-03-09 19:27:51 +00:00
end