Fix the styling of the sidebar on the blueprint layout.

This commit is contained in:
Chris Eppstein 2010-05-05 00:38:25 -07:00
parent 19bf4455f1
commit 29a9204cf7
2 changed files with 10 additions and 10 deletions

View File

@ -1,3 +1,5 @@
- render 'main' do
%aside(role="sidebar")= render 'partials/sidebar', :default_stylesheet => "_blueprint.scss", :omit_self => false, :heading_level => 2
%aside(role="sidebar")
%nav#local-nav
%ul=item_tree(reference_item(:stylesheet => "_blueprint.scss"), :depth => 2, :omit_self => false, :heading_level => 2)
%article= yield

View File

@ -68,15 +68,13 @@ def item_tree(item, options = {})
options[:heading_level] ||= 1 if options.fetch(:headings, true)
child_html = ""
if options.fetch(:depth,1) > 0
if item.children.any?
item.children.sort_by{|c| c[:crumb] || c[:title]}.each do |child|
child_opts = options.dup
child_opts[:depth] -= 1 if child_opts.has_key?(:depth)
child_opts[:heading_level] += 1 if child_opts[:heading_level]
child_opts.delete(:omit_self)
child_html << item_tree(child, child_opts)
end
end
child_opts = options.dup
child_opts[:depth] -= 1 if child_opts.has_key?(:depth)
child_opts[:heading_level] += 1 if child_opts[:heading_level]
child_opts.delete(:omit_self)
item.children.sort_by{|c| c[:crumb] || c[:title]}.each do |child|
child_html << item_tree(child, child_opts)
end
else
options.delete(:heading_level)
end