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