\ No newline at end of file
diff --git a/config/application.rb b/config/application.rb
index ccc4a65e..f0e40fcc 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -33,6 +33,7 @@ module Orbit
config.autoload_paths += %W(#{config.root}/app/models/meta)
config.autoload_paths += %W(#{config.root}/app/models/purchase)
config.autoload_paths += %W(#{config.root}/app/models/user)
+ config.autoload_paths += %W(#{config.root}/app/models/desktop)
# Include all helpers
# 'helper :all' must be removed in ApplicationController
diff --git a/config/routes.rb b/config/routes.rb
index 88a39f42..17e96a60 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -143,7 +143,17 @@ Orbit::Application.routes.draw do
resources :users
end
- match '/desktop/'=>'desktop#index'
+ resources :desktop_widgets do
+ collection do
+ get 'upload'
+ get 'delete'
+ post 'upload'
+ end
+ end
+
+namespace :desktop do
+
+ match "/"=>"desktop#index"
# Sinatra Routes start
@@ -178,46 +188,46 @@ Orbit::Application.routes.draw do
# Sinatra Routes end
- match '/desktop/desktop'=>'desktop#desktop'
- match '/desktop/app_manager'=>'desktop#app_manager'
- match '/desktop/sections'=>'desktop#sections'
- match '/desktop/settings'=>'desktop#settings'
- match '/desktop/get_desktop_settings/'=>'desktop#get_desktop_settings'
- match '/desktop/save_desktop_settings/'=>'desktop#save_desktop_settings'
- match '/desktop/getgroups/'=>'desktop#getgroups'
- match '/desktop/getsectionlist/'=>'desktop#getsectionlist'
- match '/desktop/settingthemes/'=>'desktop#settingthemes'
- match '/desktop/settingsections/'=>'desktop#settingsections'
- match '/desktop/getapplist/'=>'desktop#getapplist'
- match '/desktop/newpositions/'=>'desktop#newpositions'
- match '/desktop/settingconnection/'=>'desktop#settingconnection'
+ match '/desktop'=>'desktop#desktop'
+ match '/app_manager'=>'desktop#app_manager'
+ match '/sections'=>'desktop#sections'
+ match '/settings'=>'desktop#settings'
+ match '/get_desktop_settings/'=>'desktop#get_desktop_settings'
+ match '/save_desktop_settings/'=>'desktop#save_desktop_settings'
+ match '/getgroups/'=>'desktop#getgroups'
+ match '/getsectionlist/'=>'desktop#getsectionlist'
+ match '/settingthemes/'=>'desktop#settingthemes'
+ match '/settingsections/'=>'desktop#settingsections'
+ match '/getapplist/'=>'desktop#getapplist'
+ match '/newpositions/'=>'desktop#newpositions'
+ match '/settingconnection/'=>'desktop#settingconnection'
- match '/desktop/journal_p/'=>'desktop_publications#journal_p'
- match '/desktop/journal_p_list/'=>'desktop_publications#journal_p_list'
- match '/desktop/journal_p_add/'=>'desktop_publications#journal_p_add'
- match '/desktop_publications/getjournals' => 'desktop_publications#getjournals'
- match '/desktop/books' => 'desktop_publications#books'
- match '/desktop/books_list/'=>'desktop_publications#books_list'
- match '/desktop/books_add/'=>'desktop_publications#books_add'
+ match '/journal_p/'=>'desktop_publications#journal_p'
+ match '/journal_p_list/'=>'desktop_publications#journal_p_list'
+ match '/journal_p_add/'=>'desktop_publications#journal_p_add'
+ match '/books' => 'desktop_publications#books'
+ match '/books_list/'=>'desktop_publications#books_list'
+ match '/books_add/'=>'desktop_publications#books_add'
- match '/desktop/seminar_p' => 'desktop_publications#seminar_p'
- match '/desktop/seminar_p_list/'=>'desktop_publications#seminar_p_list'
- match '/desktop/seminar_p_add/'=>'desktop_publications#seminar_p_add'
+ match '/seminar_p' => 'desktop_publications#seminar_p'
+ match '/seminar_p_list/'=>'desktop_publications#seminar_p_list'
+ match '/seminar_p_add/'=>'desktop_publications#seminar_p_add'
- match '/desktop/research_d' => 'desktop_research#research_d'
- match '/desktop/research_d_list/' => 'desktop_research#research_d_list'
- match '/desktop/research_d_add' => 'desktop_research#research_d_add'
+ match '/research_d' => 'desktop_research#research_d'
+ match '/research_d_list/' => 'desktop_research#research_d_list'
+ match '/research_d_add' => 'desktop_research#research_d_add'
- match '/desktop/research_p' => 'desktop_research#research_p'
- match '/desktop/research_p_list/' => 'desktop_research#research_p_list'
- match '/desktop/research_p_add' => 'desktop_research#research_p_add'
+ match '/research_p' => 'desktop_research#research_p'
+ match '/research_p_list/' => 'desktop_research#research_p_list'
+ match '/research_p_add' => 'desktop_research#research_p_add'
+ match '/temp_func/'=>'desktop#temp_func'
+end
-
- match '/desktop/twitter/'=>'otheraccounts#twitter'
- match '/desktop/forgmail/'=>'otheraccounts#gmail'
- match '/desktop/getaccounts'=>'otheraccounts#getaccounts'
- match '/desktop/save_account_info/'=>'otheraccounts#saveaccountinfo'
+ match '/twitter/'=>'otheraccounts#twitter'
+ match '/forgmail/'=>'otheraccounts#gmail'
+ match '/getaccounts'=>'otheraccounts#getaccounts'
+ match '/save_account_info/'=>'otheraccounts#saveaccountinfo'
match '/desktop_appstore/appstore'=>'desktop_appstore#appstore'
match '/desktop_appstore/widgets'=>'desktop_appstore#widgets'
@@ -228,13 +238,14 @@ Orbit::Application.routes.draw do
match '/desktop_orbit/eventajaxload'=> 'desktop_orbit#eventajaxload'
match '/desktop_orbit/gettimelinespan' => 'desktop_orbit#gettimelinespan'
+ match '/desktop_publications/getjournals' => 'desktop_publications#getjournals'
#match '/desktop_orbit/eventajaxload' => 'desktop_publications#create_journal'
#match '/desktop_orbit/eventajaxload' => 'desktop_publications#delete_journal'
# match '/desktop_orbit/eventajaxload' => 'desktop_publications#update_journal'
- match '/desktop/temp_func/'=>'desktop#temp_func'
+
match '/panel/:app_name/front_end/:app_action/:id(/:controller_action)' => 'pages#show_from_link', :constraints => lambda { |request|
!request.query_string.include?("inner=true")
diff --git a/lib/parsers/parser_layout_widget.rb b/lib/parsers/parser_layout_widget.rb
new file mode 100644
index 00000000..6749dae3
--- /dev/null
+++ b/lib/parsers/parser_layout_widget.rb
@@ -0,0 +1,15 @@
+module ParserLayoutWidget
+ require 'nokogiri'
+
+ def parse_widget_for_images(widget)
+ widge = Nokogiri::HTML(widget.widget_layout.body)
+
+ widge.css('.widget_image').each do |page_image|
+ image = widget.images.where( file: File.basename(page_image['src']))[0]
+ image.update_attributes(:html_id => page_image['id'], :html_class => page_image['class'], :in_html => true) if image
+ end
+
+ end
+
+
+end
diff --git a/public/desktop_widgets/4fa7810ac88514014d7c59bc/index.html.erb b/public/desktop_widgets/4fa7810ac88514014d7c59bc/index.html.erb
deleted file mode 100755
index 2a69e24c..00000000
--- a/public/desktop_widgets/4fa7810ac88514014d7c59bc/index.html.erb
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_blue.png b/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_blue.png
deleted file mode 100755
index ea275d1b..00000000
Binary files a/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_blue.png and /dev/null differ
diff --git a/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_green.png b/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_green.png
deleted file mode 100755
index 393618c2..00000000
Binary files a/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_green.png and /dev/null differ
diff --git a/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_orange.png b/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_orange.png
deleted file mode 100755
index 84d32207..00000000
Binary files a/public/desktop_widgets/4fa7810ac88514014d7c59bc/temp/bg_orange.png and /dev/null differ
diff --git a/public/desktop_widgets/4fa7817cc88514014d7c59c2/index.html.erb b/public/desktop_widgets/4fa7817cc88514014d7c59c2/index.html.erb
deleted file mode 100644
index 9862a505..00000000
--- a/public/desktop_widgets/4fa7817cc88514014d7c59c2/index.html.erb
+++ /dev/null
@@ -1,45 +0,0 @@
-
-