engine/app/uploaders/theme_asset_uploader.rb

34 lines
625 B
Ruby
Raw Normal View History

2010-05-11 21:38:52 +00:00
# encoding: utf-8
class ThemeAssetUploader < AssetUploader
process :set_content_type
2010-05-11 21:38:52 +00:00
process :set_size
process :set_width_and_height
2010-06-03 15:32:40 +00:00
version :thumb do
process :resize_to_fill => [50, 50]
process :convert => 'png'
end
2010-06-03 15:32:40 +00:00
version :medium do
process :resize_to_fill => [80, 80]
process :convert => 'png'
end
version :preview do
process :resize_to_fit => [880, 1100]
process :convert => 'png'
2010-06-03 15:32:40 +00:00
end
def store_dir
2010-09-23 23:00:13 +00:00
# "sites/#{model.site_id}/themes/#{model.id}"
"sites/#{model.site_id}/theme/"
2010-05-11 21:38:52 +00:00
end
2010-05-11 21:38:52 +00:00
def extension_white_list
%w(jpg jpeg gif png css js swf flv)
2010-05-11 21:38:52 +00:00
end
end