2017-08-02 09:07:55 +00:00
|
|
|
class TemplateImageFile
|
2021-04-19 01:36:27 +00:00
|
|
|
require "ostruct"
|
2017-08-02 09:07:55 +00:00
|
|
|
include Mongoid::Document
|
|
|
|
include Mongoid::Timestamps
|
|
|
|
|
|
|
|
mount_uploader :image_file, GalleryUploader
|
|
|
|
|
|
|
|
field :order, :type => Integer, :default => 0
|
|
|
|
|
|
|
|
belongs_to :r_template
|
2021-04-19 01:36:27 +00:00
|
|
|
|
|
|
|
def album_crops
|
|
|
|
[]
|
|
|
|
end
|
|
|
|
|
|
|
|
def file
|
|
|
|
self.image_file
|
|
|
|
end
|
|
|
|
def album
|
|
|
|
tmp = OpenStruct.new
|
|
|
|
tmp.album_colors = album_colors
|
|
|
|
tmp.resize_gravity = 'Center'
|
|
|
|
tmp
|
|
|
|
end
|
|
|
|
|
|
|
|
def album_id
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
def album_colors
|
|
|
|
[{'color' => 'transparent'}]
|
|
|
|
end
|
2017-08-02 09:07:55 +00:00
|
|
|
end
|