Desktop Widgtes updates..

This commit is contained in:
Harry Bomrah authored and chris committed 2012-11-06 10:36:34 +08:00
1 parent 3c85f3ef00
commit da5e7f670e
33 files changed
+217 -146

No files matched your search

+33 -3
View File
@@ -103,11 +103,41 @@ class DesktopController< ApplicationController
def getgroups
@section = Section.find(params["sectionid"])
@groups = @section.groups
a = Array.new
gr = Array.new
@groups.each do |group|
a << group.tiles
a = Array.new
t = group.tiles
t.each do |tile|
data_content = ""
jsfile = []
cssfile = ""
shape = "w1 h1"
if tile.data_category == "widget"
widge = DesktopWidget.find(tile.desktop_widget_id.to_s)
# data_content = widge.widget_layout.file
data_content = "desktop/widget_layout?id="+tile.desktop_widget_id.to_s
jsfile = widge.javascripts.collect{|js| js.file}
cssfile = widge.css_default.file
shape = widge.shape
title = widge.name
else
data_content = tile.data_content
title = tile.title
end
a << {"id"=>tile.id,"data_category"=>tile.data_category,"data_content"=>data_content,"js"=>jsfile,"css"=>cssfile,"shape"=>shape,"position"=>tile.position,"title"=>title}
end
gr << a
end
render :json =>a.to_json
render :json =>gr.to_json
end
def widget_layout
widget = DesktopWidget.find(params[:id])
link = '<link href="'+widget.css_default.file.to_s+'" media="screen" rel="stylesheet" type="text/css" />'
content = widget.widget_layout.body
dhtml = link + content
render :text => dhtml.html_safe
end
def getsectionlist
@@ -8,6 +8,7 @@ class DesktopPublicationsController< ApplicationController
end
def journal_p_add
debugger
render "desktop/journal_pages/add", :layout => false
end
@@ -31,7 +31,8 @@ class DesktopWidgetsController < OrbitBackendController
zip_file.entries.each do |entry|
case (path = entry.to_s)
when /\A(#{zip_name})\/(default\.css)\z/ #for default css
when /\A(#{zip_name})\/(default\.css)\z/
#for default css
dw.build_css_default(:file => get_temp_file(zip_file, dir, entry))
when /\A(#{zip_name})\/(widget\.html)\z/ #for layout html
dw.build_widget_layout(:file => get_temp_file(zip_file, dir, entry))