solved desktop conflict during cherry pick
This commit is contained in:
1 parent
874819266d
commit
2d616ab7a8
9 files changed
+198
-36
No files matched your search
@@ -117,8 +117,8 @@ class DesktopController< ApplicationController
|
||||
jsfile = []
|
||||
cssfile = ""
|
||||
shape = "w1 h1"
|
||||
fullsize = false
|
||||
link = ""
|
||||
fullsize = false
|
||||
if tile.data_category == "widget"
|
||||
widge = DesktopWidget.find(tile.desktop_widget_id.to_s)
|
||||
# data_content = widge.widget_layout.file
|
||||
@@ -128,9 +128,7 @@ class DesktopController< ApplicationController
|
||||
shape = widge.shape
|
||||
title = widge.name
|
||||
# binding.pry
|
||||
if not widge.fullsize.nil?
|
||||
fullsize = widge.fullsize
|
||||
end
|
||||
fullsize = widge.fullsize
|
||||
else
|
||||
data_content = tile.data_content
|
||||
title = tile.title
|
||||
@@ -194,6 +192,33 @@ class DesktopController< ApplicationController
|
||||
end
|
||||
render :json=>a.to_json
|
||||
end
|
||||
|
||||
def getapplistforManager
|
||||
@dwss = DesktopWidget.all
|
||||
@tiles = Array.new
|
||||
desktop = Desktop.find(params['desktopid'])
|
||||
sections = desktop.sections
|
||||
sections.each do |section|
|
||||
groups = section.groups
|
||||
groups.each do |group|
|
||||
@tiles += group.tiles
|
||||
end
|
||||
end
|
||||
@validtiles = Array.new
|
||||
@allWidgets = Array.new
|
||||
@dwss.each do |dw|
|
||||
@id = dw.id
|
||||
@validtiles = @tiles.select{|t| t.desktop_widget_id == @id}
|
||||
@sections = Array.new
|
||||
@validtiles.each do |vt|
|
||||
grp = Group.find(vt.group_id)
|
||||
sec = Section.find(grp.section_id);
|
||||
@sections << {"id"=>sec.id,"name"=>sec.name}
|
||||
end
|
||||
@allWidgets << {"id"=>dw.id, "data_category"=> "widget","title" => dw.name, "version" => dw.version, "author"=>dw.author, "last_update"=>dw.updated_at, "icon"=>dw.images.where(:name=>dw.icon).first.file.url, "sections" => @sections}
|
||||
end
|
||||
render :json=>@allWidgets.to_json
|
||||
end
|
||||
|
||||
def newpositions
|
||||
@newpositions = params[:newpositions]
|
||||
@@ -236,5 +261,27 @@ class DesktopController< ApplicationController
|
||||
feed = Net::HTTP.get_response(URI.parse("https://mail.google.com/mail/feed/atom")).body
|
||||
render :xml=>feed
|
||||
end
|
||||
|
||||
def appactivation
|
||||
@group = Section.find(params[:section_id]).groups.first
|
||||
@widget = DesktopWidget.find(params[:widget_id])
|
||||
status = params[:status]
|
||||
|
||||
case status
|
||||
when "true"
|
||||
tile = Tile.new(data_category: "widget", position: 8, desktop_widget_id: @widget.id)
|
||||
@group.tiles+=[tile]
|
||||
@group.save
|
||||
when "false"
|
||||
tile = @group.tiles.where("desktop_widget_id"=>@widget.id).first
|
||||
if tile != nil
|
||||
tile.destroy
|
||||
end
|
||||
end
|
||||
|
||||
b = Array.new
|
||||
b = {"success"=>"true"}
|
||||
render :json=>b.to_json
|
||||
end
|
||||
|
||||
end
|
||||
@@ -4,6 +4,7 @@ class DesktopWidgetsController < OrbitBackendController
|
||||
require 'zip/zip'
|
||||
|
||||
def index
|
||||
@desktopWidgets = DesktopWidget.all
|
||||
end
|
||||
|
||||
def upload
|
||||
@@ -21,6 +22,19 @@ class DesktopWidgetsController < OrbitBackendController
|
||||
temp_file.close
|
||||
end
|
||||
end
|
||||
def edit
|
||||
@dw = DesktopWidget.find(params[:id])
|
||||
end
|
||||
|
||||
def update
|
||||
@dw = DesktopWidget.find(params[:id])
|
||||
if(params[:desktop_widget])
|
||||
@imagefile = params[:desktop_widget][:image]
|
||||
@dw.images.build(:file => @imagefile)
|
||||
@dw.save
|
||||
end
|
||||
redirect_to action: "index"
|
||||
end
|
||||
|
||||
def unzip_widget(file, zip_name)
|
||||
Zip::ZipFile.open(file) { |zip_file|
|
||||
|
||||
Reference in new issue
Block a user