fixed ordering of widgets and also some widget layout problem

This commit is contained in:
Harry Bomrah 2014-06-04 16:22:48 +08:00
parent b55e4b654b
commit 72a027c91c
3 changed files with 12 additions and 3 deletions

View File

@ -54,6 +54,9 @@ class PagePartsController < ApplicationController
@multiselect = @widget_settings['multiselect'] rescue true
@display_field = @widget_settings['display_field']
end
elsif @widget_settings.nil?
@widget_settings = {}
@widget_settings['override_category_with'] = nil
end
end
@no_orbit_bar = @no_side_bar = true
@ -78,6 +81,9 @@ class PagePartsController < ApplicationController
page_part.destroy
end
else
if final_params['categories'].nil?
final_params['categories'] = []
end
subpart.update_attributes(final_params)
end
render :json => {"success"=>true}.to_json
@ -107,6 +113,9 @@ class PagePartsController < ApplicationController
@multiselect = @widget_settings['multiselect'] rescue true
@display_field = @widget_settings['display_field']
end
elsif @widget_settings.nil?
@widget_settings = {}
@widget_settings['override_category_with'] = nil
end
render :layout => false
end
@ -117,7 +126,7 @@ class PagePartsController < ApplicationController
data = []
parts.each do |part|
partid = "data-pp=" + part.part_id.to_s
subparts = part.sub_parts
subparts = part.sub_parts.desc(:created_at)
subpart = []
subparts.each do |p|
subpart << {"module" => p.module, "widget" => p.widget_type, "id" => p.id.to_s, "kind" => p.kind}

View File

@ -177,7 +177,7 @@ class PagesController < ApplicationController
@part_partials = {}
parts.each do |part|
subparts = part.sub_parts
subparts = part.sub_parts.asc(:created_at)
partials = []
subparts.each do |subpart|
if subpart.kind == "module_widget"