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.delete_at(0)
|
||||
res = ''
|
||||
|
||||
if ancestors
|
||||
res << "<div class='category_list'>"
|
||||
res << "<ul class='list'>"
|
||||
ancestors.each do |node|
|
||||
res << "<li class='active'>"
|
||||
res << "<a herf='/#{node.path}'>#{node.title}</a>"
|
||||
res << "<ul class='breadcrumb'>"
|
||||
ancestors.each_with_index do |node, i|
|
||||
last = i == ancestors.size-1
|
||||
res << "<li class=#{'active' if last}>"
|
||||
if last
|
||||
res << node.title
|
||||
else
|
||||
res << "<a herf='/#{node.path}'>#{node.title}</a>"
|
||||
res << "<span class='divider'>/</span>"
|
||||
end
|
||||
res << "</li>"
|
||||
end
|
||||
res << "</ul>"
|
||||
res << "</div>"
|
||||
end
|
||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
|
||||
breadcrumb.swap(fragment)
|
||||
|
|
Loading…
Reference in New Issue