36 lines
1.1 KiB
Ruby
36 lines
1.1 KiB
Ruby
|
|
module ProductsHelper
|
||
|
|
|
||
|
|
def product_ad(product, options = {}, &block)
|
||
|
|
icon_size = options.delete(:icon) || 24
|
||
|
|
|
||
|
|
options[:class] = ["product-ad", "icon-#{icon_size}", options[:class]].compact.join(" ")
|
||
|
|
options[:onclick] = "location.href = '#{product_path(product)}'"
|
||
|
|
|
||
|
|
content = capture(&block)
|
||
|
|
content = "#{icon(product, icon_size)}#{content}"
|
||
|
|
|
||
|
|
concat content_tag(:div, content, options)
|
||
|
|
end
|
||
|
|
|
||
|
|
def versions_for_select(releases, since = nil)
|
||
|
|
options_for_select(releases.map{|r| r.version if r.has_changelog? && !r.version.include?('Beta') }.compact, since)
|
||
|
|
end
|
||
|
|
|
||
|
|
def download_link_trial_or_free(product)
|
||
|
|
if product.free? || better_splitbutton?
|
||
|
|
download_link(product, "standard-free")
|
||
|
|
else
|
||
|
|
download_link(product, "standard", t('txt.home.free_download'))
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
def better_slitbutton_buy_link
|
||
|
|
link_to "Buy commercial license with source code from $67", Settings.better_splitbutton_buy_url, :class => "commercial-buy image-link"
|
||
|
|
end
|
||
|
|
|
||
|
|
def better_splitbutton?
|
||
|
|
@product && @product.code == 'better-splitbutton'
|
||
|
|
end
|
||
|
|
|
||
|
|
end
|