Put missing changes for breadcrumb in page edit
This commit is contained in:
parent
61648d23e1
commit
f36bcb8801
|
@ -150,17 +150,20 @@ module ParserCommon
|
||||||
ancestors = Page.find(page.id).ancestors_and_self rescue nil
|
ancestors = Page.find(page.id).ancestors_and_self rescue nil
|
||||||
ancestors.delete_at(0)
|
ancestors.delete_at(0)
|
||||||
res = ''
|
res = ''
|
||||||
|
|
||||||
if ancestors
|
if ancestors
|
||||||
res << "<div class='category_list'>"
|
res << "<ul class='breadcrumb'>"
|
||||||
res << "<ul class='list'>"
|
ancestors.each_with_index do |node, i|
|
||||||
ancestors.each do |node|
|
last = i == ancestors.size-1
|
||||||
res << "<li class='active'>"
|
res << "<li class=#{'active' if last}>"
|
||||||
|
if last
|
||||||
|
res << node.title
|
||||||
|
else
|
||||||
res << "<a herf='/#{node.path}'>#{node.title}</a>"
|
res << "<a herf='/#{node.path}'>#{node.title}</a>"
|
||||||
|
res << "<span class='divider'>/</span>"
|
||||||
|
end
|
||||||
res << "</li>"
|
res << "</li>"
|
||||||
end
|
end
|
||||||
res << "</ul>"
|
res << "</ul>"
|
||||||
res << "</div>"
|
|
||||||
end
|
end
|
||||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
|
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
|
||||||
breadcrumb.swap(fragment)
|
breadcrumb.swap(fragment)
|
||||||
|
|
Loading…
Reference in New Issue