orbit-4-2/app/models/desktop/desktop_theme.rb

64 lines
1.6 KiB
Ruby
Raw Normal View History

class DesktopTheme
include Mongoid::Document
include Mongoid::Timestamps
field :name
field :author
field :background
field :tilecolor ,type: Array, default: ["thmc1","thmc2"]
ICONS = {
"home"=>"d_home.png",
"app_manager"=>"d_app_manager.png",
"sections"=>"d_sections.png",
"settings"=>"d_settings.png",
"publication"=>"d_publication.png",
"journal_p"=>"d_journal_p.png",
"conference_p"=>"d_conference_p.png",
"books"=>"d_books.png",
"research"=>"d_research.png",
"research_d"=>"d_research_d.png",
"research_p"=>"d_research_p.png",
"patents"=>"d_patents.png",
"labs"=>"d_labs.png",
"experience"=>"d_experience.png",
"working"=>"d_working.png",
"education"=>"d_education.png",
"honors"=>"d_honors.png",
"activities"=>"d_activities.png",
"clubs"=>"d_clubs.png",
"landt"=>"d_landt.png",
"courses"=>"d_courses.png",
"homework"=>"d_homework.png",
"certification"=>"d_certification.png",
"personal"=>"d_personal.png",
"mypage"=>"d_mypage.png",
"blog"=>"d_blog.png",
"album"=>"d_album.png",
"calendar"=>"d_calendar.png",
"files"=>"d_files.png",
"orbit"=>"d_orbit.png",
"connection"=>"d_connection.png",
"appstore"=>"d_appstore.png"
}
has_one :css_default, as: :css, :autosave => true, :dependent => :destroy
has_many :images, as: :imgs, :autosave => true, :dependent => :destroy
has_and_belongs_to_many :desktops, :autosave => true
accepts_nested_attributes_for :images, :allow_destroy => true
# after_save :parse_css_for_images
# belongs_to :desktop
# protected
# def parse_css_for_images
# self.css_default.parse_urls
# end
end