Archive: ComponentOwl Rails app, DB backups, go redirect script
This commit is contained in:
35
app/helpers/products_helper.rb
Normal file
35
app/helpers/products_helper.rb
Normal file
@@ -0,0 +1,35 @@
|
||||
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
|
||||
Reference in New Issue
Block a user