reset controller
This commit is contained in:
parent
0f05fc2e99
commit
3100742e40
|
@ -8,10 +8,8 @@ class SiteMenuWidgetsController < ApplicationController
|
||||||
else
|
else
|
||||||
pages = page.parent_page.sorted_published_child_pages
|
pages = page.parent_page.sorted_published_child_pages
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_json(pages)
|
def create_json(pages)
|
||||||
items = []
|
items = []
|
||||||
widget_title = []
|
|
||||||
pages.each do |page|
|
pages.each do |page|
|
||||||
item = {}
|
item = {}
|
||||||
if page.child_page.size > 0
|
if page.child_page.size > 0
|
||||||
|
@ -43,20 +41,10 @@ class SiteMenuWidgetsController < ApplicationController
|
||||||
end
|
end
|
||||||
items
|
items
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
page_part_id = PagePart.where(:page_id => pages.first.parent_page_id).last.id
|
|
||||||
|
|
||||||
widgets = SubPart.where(:page_part_id => page_part_id).collect do |sp|
|
|
||||||
{
|
|
||||||
"widget_title" => sp.title
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
items = create_json(pages)
|
items = create_json(pages)
|
||||||
{
|
{
|
||||||
"pages" => items,
|
"pages" => items,
|
||||||
"widget_title" => widgets
|
"extras" => {"widget_title" => "Sub Menu"}
|
||||||
}
|
}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue