apps update -- app upload and activation

This commit is contained in:
harrybomrah authored and saurabhbhatia committed 2013-07-30 16:42:50 +08:00
1 parent f2ada14b7a
commit ed22a4d303
11 files changed
+230 -207

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
class DesktopApp
include Mongoid::Document
include Mongoid::Timestamps
field :name
field :author
field :shape
field :version, :type => String
field :text_color, :type => String, default: "#fff"
field :bg_color, :type => String, default: "#fff"
field :icon, default: "icon.png"
field :url
has_many :images, as: :imgs, :autosave => true, :dependent => :destroy
has_and_belongs_to_many :desktops, :autosave => true
has_many :tiles, :autosave => true
accepts_nested_attributes_for :images, :allow_destroy => true
end
+1 -1
View File
@@ -5,7 +5,7 @@ class DesktopWidget
field :name
field :author
field :shape
field :shape, default: "w1 h1"
field :fullsize, :type => Boolean, default: false
field :version, :type => String
field :text_color, :type => String, default: ""
+4 -4
View File
@@ -7,11 +7,11 @@ class Group
before_create :initialize_tile
def initialize_tile
self.tiles.build(data_category: "app", data_content: "quotes", position: 5, shape: "w1 h1", title: "Quotes")
self.tiles.build(data_category: "app", data_content: "dailyenglish", position: 6, shape: "w1 h1", title: "Daily English Word")
# self.tiles.build(data_category: "app", data_content: "quotes", position: 5, shape: "w1 h1", title: "Quotes")
# self.tiles.build(data_category: "app", data_content: "dailyenglish", position: 6, shape: "w1 h1", title: "Daily English Word")
widgets = self.section.desktop.desktop_widgets.collect{|widget| widget.id}
for i in 0..3
self.tiles.build(data_category: "widget", position: i+1,desktop_widget_id: widgets[i])
widgets.each_with_index do |w,i|
self.tiles.build(data_category: "widget", position: i+1,desktop_widget_id: w)
end
end
end
+1
View File
@@ -13,5 +13,6 @@ class Tile
belongs_to :group
belongs_to :desktop_widget
belongs_to :desktop_app
end