front_end widget breadcrumb done
This commit is contained in:
1 parent
2a61470f8b
commit
bca4478f68
4 files changed
+21
-7
No files matched your search
@@ -156,9 +156,7 @@ module ParserCommon
|
||||
res << "<ul class='list'>"
|
||||
ancestors.each do |node|
|
||||
res << "<li class='active'>"
|
||||
# root = "/"
|
||||
# res << "<a href='#{edit ? root + admin_page_path(child.id) : (child.class.to_s.eql?('Page') ? root + child.path : child.url)}'>#{child.title}</a>"
|
||||
res << "<a herf ='/' + node.path )}>#{node}</a>"
|
||||
res << "<a herf ='/#{node.path} )}>#{node}</a>"
|
||||
res << "</li>"
|
||||
end
|
||||
res << "</ul>"
|
||||
@@ -209,6 +207,7 @@ module ParserCommon
|
||||
''
|
||||
end
|
||||
end
|
||||
|
||||
# sitemap
|
||||
def parse_sitemaps_edit(body = nil, page = nil, edit=nil)
|
||||
sitemap = body.css('sitemap').first
|
||||
|
||||
@@ -11,6 +11,7 @@ module ParserFrontEnd
|
||||
parse_images(body, page)
|
||||
parse_menu(body, page)
|
||||
parse_sub_menu(body, page, site)
|
||||
parse_breadcrumb(body, page, site)
|
||||
parse_counter(body)
|
||||
i18n.merge!({locale => body.to_html})
|
||||
end
|
||||
@@ -92,6 +93,20 @@ module ParserFrontEnd
|
||||
end
|
||||
end
|
||||
|
||||
# page_breadcrumb
|
||||
def parse_breadcrumb(body, page, site)
|
||||
page_breadcrumb = body.css('.page_breadcrumb').first
|
||||
if page_breadcrumb
|
||||
res = "<div id='#{page_breadcrumb['id']}', class='#{page_breadcrumb['class']}'>"
|
||||
res << "<div class='dymanic_load' path='#{front_show_site_breadcrumb_path}'></div>"
|
||||
res << "</div>"
|
||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
|
||||
page_breadcrumb.swap(fragment)
|
||||
else
|
||||
''
|
||||
end
|
||||
end
|
||||
|
||||
# page_contents
|
||||
def parse_contents(body, page, edit=nil, locale)
|
||||
public_r_tags = []
|
||||
@@ -181,6 +196,6 @@ module ParserFrontEnd
|
||||
|
||||
# breadcrumb
|
||||
def generate_breadcrumbs(*args)
|
||||
"<div class='dymanic_load' path='#{front_show_breadcrumb_path({:menu_page_id => args[0], :page_id => args[1]})}'></div>"
|
||||
"<div class='dymanic_load' path='#{front_show_breadcrumb_path(args[1])}'></div>"
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user