59 lines
1020 B
Ruby
59 lines
1020 B
Ruby
|
|
module PadHelper
|
||
|
|
|
||
|
|
def val(key)
|
||
|
|
@product.pad_value_for_key(key) || Settings.pad[key] || ""
|
||
|
|
end
|
||
|
|
|
||
|
|
def product_link
|
||
|
|
product_url(@product)
|
||
|
|
end
|
||
|
|
|
||
|
|
def buy_link
|
||
|
|
@product.free? ? product_url(@product) : order_url(@product)
|
||
|
|
end
|
||
|
|
|
||
|
|
def pad_link
|
||
|
|
pad_url(@product)
|
||
|
|
end
|
||
|
|
|
||
|
|
def setup_file_link
|
||
|
|
direct_download_url(:filename => @product.file_url)
|
||
|
|
end
|
||
|
|
|
||
|
|
def name
|
||
|
|
@product.name.strip_version
|
||
|
|
end
|
||
|
|
|
||
|
|
def version
|
||
|
|
@product.current_version
|
||
|
|
end
|
||
|
|
|
||
|
|
def release_month
|
||
|
|
@product.current_release.date.strftime("%m")
|
||
|
|
end
|
||
|
|
|
||
|
|
def release_day
|
||
|
|
@product.current_release.date.strftime("%d")
|
||
|
|
end
|
||
|
|
|
||
|
|
def release_year
|
||
|
|
@product.current_release.date.year
|
||
|
|
end
|
||
|
|
|
||
|
|
def price
|
||
|
|
@product.price || 0
|
||
|
|
end
|
||
|
|
|
||
|
|
def size_b
|
||
|
|
@product.setup_file.size
|
||
|
|
end
|
||
|
|
|
||
|
|
def size_kb
|
||
|
|
number_with_precision(@product.setup_file.size.to_f / 1024, :precision => 0)
|
||
|
|
end
|
||
|
|
|
||
|
|
def size_mb
|
||
|
|
number_with_precision(@product.setup_file.size.to_f / 1024 / 1024, :precision => 2)
|
||
|
|
end
|
||
|
|
end
|