prototype/templates/html/helpers.rb

32 lines
829 B
Ruby
Raw Normal View History

module PDoc
module Generators
module Html
module Helpers
module BaseHelper
end
module LinkHelper
end
module CodeHelper
end
module MenuHelper
2009-09-15 23:27:35 +00:00
def menu(obj)
class_names = menu_class_name(obj)
li_class_names = obj.type == "section" ? "menu-section" : ""
html = <<-EOS
<div class='menu-item'>
#{auto_link(obj, false, :class => class_names_for(obj))}
</div>
EOS
unless obj.children.empty?
html << content_tag(:ul, obj.children.map { |n|menu(n) }.join("\n"), :class => li_class_names)
end
content_tag(:li, html, :class => class_names)
end
end
end
end
end
2009-09-15 23:27:35 +00:00
end