widget and gridster fixes
This commit is contained in:
1 parent
0781779ac0
commit
bc0477a5ed
5 files changed
+87
-60
No files matched your search
@@ -141,7 +141,9 @@ class DesktopController< ApplicationController
|
||||
link = "http://www.wikibooks.org"
|
||||
end
|
||||
end
|
||||
gr << {"id"=>tile.id,"data_category"=>tile.data_category,"data_content"=>data_content,"js"=>jsfile,"css"=>cssfile,"shape"=>shape,"position"=>tile.position,"title"=>title,"fullsize"=>fullsize,"link"=>link}
|
||||
gr << {"id"=>tile.id,"data_category"=>tile.data_category,"data_content"=>data_content,"js"=>jsfile,"css"=>cssfile,"shape"=>shape,"position"=>tile.position,"row"=>tile.row,"column"=>tile.column, "title"=>title,"fullsize"=>fullsize,"link"=>link}
|
||||
|
||||
|
||||
end
|
||||
# gr << a
|
||||
end
|
||||
@@ -194,29 +196,36 @@ class DesktopController< ApplicationController
|
||||
end
|
||||
|
||||
def newpositions
|
||||
@newpositions = params["newpos"]
|
||||
@section = Section.find(params["sectionid"])
|
||||
@groupids = params["groupids"]
|
||||
@groups = @section.groups
|
||||
z = 0
|
||||
@newpositions.each do |grp|
|
||||
x = 1
|
||||
grp.each do |tileid|
|
||||
if x != 1
|
||||
y = 1
|
||||
tileid.each do |id|
|
||||
@tile = Tile.find(id)
|
||||
@tile.update_attributes({:position => y})
|
||||
if @tile.group_id != @groupids[z]
|
||||
@tile.update_attributes({:group_id => @groupids[z]})
|
||||
end
|
||||
y = y + 1
|
||||
end
|
||||
z = z + 1
|
||||
end
|
||||
x = x + 1
|
||||
end
|
||||
@newpositions = params[:newpositions]
|
||||
|
||||
@newpositions.each do |t|
|
||||
@this_tile = t.last
|
||||
@tile = Tile.find(@this_tile['id'])
|
||||
@tile.update_attributes({:row => @this_tile['row'],:column => @this_tile['col']})
|
||||
end
|
||||
# @newpositions = params["newpos"]
|
||||
# @section = Section.find(params["sectionid"])
|
||||
# @groupids = params["groupids"]
|
||||
# @groups = @section.groups
|
||||
# z = 0
|
||||
# @newpositions.each do |grp|
|
||||
# x = 1
|
||||
# grp.each do |tileid|
|
||||
# if x != 1
|
||||
# y = 1
|
||||
# tileid.each do |id|
|
||||
# @tile = Tile.find(id)
|
||||
# @tile.update_attributes({:position => y})
|
||||
# if @tile.group_id != @groupids[z]
|
||||
# @tile.update_attributes({:group_id => @groupids[z]})
|
||||
# end
|
||||
# y = y + 1
|
||||
# end
|
||||
# z = z + 1
|
||||
# end
|
||||
# x = x + 1
|
||||
# end
|
||||
# end
|
||||
b = Array.new
|
||||
b << {"success"=>"true"}
|
||||
render :json=>b.to_json
|
||||
|
||||
Reference in new issue
Block a user