parent
8041452be5
commit
f05b7db73a
|
@ -110,13 +110,17 @@ module ParserCommon
|
|||
def parse_sub_menus(body = nil, page = nil, id = nil)
|
||||
body.css('sub_menu').each do |sub_menu|
|
||||
res = ''
|
||||
res << "<ul>"
|
||||
res << "<div class='category_list'>"
|
||||
res << "<h3 class='h3'>#{page.i18n_variable[I18n.locale]}</h3>"
|
||||
res << "<ul class='list'>"
|
||||
page.children.each do |child|
|
||||
res << "<li>"
|
||||
res << "<a href='#{child.full_name}'>#{child.i18n_variable[I18n.locale]}</a>"
|
||||
res << "</li>"
|
||||
end
|
||||
res << "</ul>"
|
||||
res << "</h3>"
|
||||
res << "</div>"
|
||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
|
||||
sub_menu.swap(fragment)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue