Merge branch 'desktop_harry' of github.com:Rulingcom/orbit into desktop_harry
Conflicts: Gemfile.lock app/assets/javascripts/.DS_Store app/assets/stylesheets/style.css.erb app/views/layouts/_orbit_bar.html.erb
This commit is contained in:
commit
a1e74987dc
389 files changed
+6931
-1
No files matched your search
@@ -0,0 +1,23 @@
|
||||
class Desktop
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :theme, default: "4f8d3f493b67fcd05f086359"
|
||||
field :customtheme
|
||||
field :wallpaper
|
||||
|
||||
belongs_to :user
|
||||
|
||||
has_many :sections, :autosave => true, :dependent => :destroy
|
||||
has_many :desktop_widgets, :autosave => true, :dependent => :destroy
|
||||
|
||||
before_create :initialize_section
|
||||
|
||||
def initialize_section
|
||||
self.sections.build(name: "Desktop 1")
|
||||
self.sections.build(name: "Desktop 2")
|
||||
self.sections.build(name: "Desktop 3")
|
||||
self.sections.build(name: "Desktop 4")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class DesktopTheme
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :name
|
||||
field :author
|
||||
|
||||
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
class DesktopWidget
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :name
|
||||
field :author
|
||||
field :shape
|
||||
field :desktop_id
|
||||
field :status
|
||||
field :section
|
||||
|
||||
belongs_to :desktop
|
||||
end
|
||||
@@ -0,0 +1,19 @@
|
||||
class Group
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
belongs_to :section
|
||||
has_many :tiles, :autosave => true, :dependent => :destroy
|
||||
before_create :initialize_tile
|
||||
|
||||
def initialize_tile
|
||||
self.tiles.build(data_category: "widget", data_content: "timetable", position: 1, shape: "w2 h2", title: "Tiime Table")
|
||||
self.tiles.build(data_category: "app", data_content: "quotes", position: 2, shape: "w1 h1", title: "Quotes")
|
||||
self.tiles.build(data_category: "widget", data_content: "weather", position: 3, shape: "w2 h2", title: "Weather")
|
||||
self.tiles.build(data_category: "widget", data_content: "clock", position: 4, shape: "w2 h1", title: "Clock")
|
||||
self.tiles.build(data_category: "app", data_content: "dailyenglish", position: 5, shape: "w1 h1", title: "Daily English Word")
|
||||
self.tiles.build(data_category: "widget", data_content: "school_events", position: 6, shape: "w2 h1", title: "School Events")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
class Journal
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :user_id
|
||||
field :title
|
||||
|
||||
belongs_to :user
|
||||
has_many :papers, :autosave => true, :dependent => :destroy
|
||||
|
||||
before_create :initialize_paper
|
||||
|
||||
def initialize_paper
|
||||
for i in 0..5
|
||||
self.papers.build
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
class OtherAccount
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
include Mongoid::Encryptor
|
||||
|
||||
field :user_id
|
||||
field :type
|
||||
field :email
|
||||
field :encrypted_password
|
||||
|
||||
encrypts :encrypted_password, :mode => :symmetric, :password => 'rulingcom'
|
||||
|
||||
belongs_to :user
|
||||
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
class Paper
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :keywords, default: "Material, Fracture Mechanism, Reliability Test, Solder Joints, Nano-material"
|
||||
field :title, default: "The performance and fracture mechanism of solder joints under mechanical reliability test"
|
||||
field :abstract, default: "The concept of microstructure engineering has gained increasingly attention with the goal to quantitatively link the operational parameters of an industrial process to the properties of its product. The key component of this concept is to accurately model the microstructure evolution along the processing path. Modelling of recrystallization in Cuinterconnects will be presented as an example of a conventional process model. Further, the potential of developing next generation process models will be discussed by using models across different length and time scale. The multi-scale modelling approach will be illustrated with a case study for phase transformation in Fe-Mn alloys."
|
||||
field :level, default: "SCI"
|
||||
field :coauthors, default: "Allen, Shelly, Eric, Manson, Chris, Clara, Anna, Albee, Vincent, Devin, Chunchi, Ika, Jaoshua, Ray, Matt, Lin, Spen"
|
||||
field :created_at, type: Date, default: ->{12.months.ago}
|
||||
|
||||
belongs_to :journal
|
||||
|
||||
|
||||
end
|
||||
@@ -0,0 +1,17 @@
|
||||
class Section
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :name
|
||||
|
||||
belongs_to :desktop
|
||||
has_many :groups, :autosave => true, :dependent => :destroy
|
||||
|
||||
before_create :initialize_group
|
||||
|
||||
def initialize_group
|
||||
self.groups.build
|
||||
self.groups.build
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
class Tile
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
field :data_category
|
||||
field :data_content
|
||||
field :position, type: Integer
|
||||
field :shape
|
||||
field :title
|
||||
|
||||
belongs_to :group
|
||||
|
||||
|
||||
end
|
||||
@@ -20,6 +20,9 @@ class User
|
||||
has_many :privilege_apps, :inverse_of => :privilege_users, :class_name => "AppAuth"
|
||||
|
||||
has_many :managing_apps,:class_name => "AppManager"
|
||||
has_one :desktop, :autosave => true, :dependent => :destroy
|
||||
has_many :other_accounts, :autosave => true, :dependent => :destroy
|
||||
has_many :journals, :autosave => true, :dependent => :destroy
|
||||
|
||||
belongs_to :role
|
||||
has_and_belongs_to_many :sub_roles
|
||||
@@ -49,6 +52,8 @@ class User
|
||||
Thread.current[:user] = user
|
||||
end
|
||||
|
||||
before_create :initialize_desktop
|
||||
|
||||
def avb_apps
|
||||
sub_role_ids_ary=self.sub_roles.collect{|t| t.id}
|
||||
query1 = AppAuth.any_in({sub_role_ids: sub_role_ids_ary}).excludes(blocked_user_ids: self.id)
|
||||
@@ -81,4 +86,8 @@ class User
|
||||
User.find(id) rescue nil
|
||||
end
|
||||
|
||||
def initialize_desktop
|
||||
self.build_desktop
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user