Changes for site map front end indentation

This commit is contained in:
chris 2012-12-19 17:26:38 +08:00
parent fcbba6660b
commit 83fb5230a4
1 changed files with 8 additions and 4 deletions

View File

@ -1,16 +1,20 @@
<div class="site-map">
<% @items.each_with_index do |item, i| %>
<% i = 1 %>
<% @items.each do |item| %>
<% if item.show_in_sitemap_for(I18n.locale.to_s) %>
<div class="map-block">
<h4><%= i+1 %> <a href='<%= item.path %>'><%= item.title %></a></h4>
<h4><%= i %> <a href='<%= item.path %>'><%= item.title %></a></h4>
<ul>
<% item.children.each_with_index do |child, ii| %>
<% ii = 1 %>
<% item.children.each do |child| %>
<% if child.show_in_sitemap_for(I18n.locale.to_s) %>
<li class="clear"><%= "#{i+1}-#{ii+1}" %> <a href='<%= child.path %>'><%= child.title %></a></span></li>
<li class="clear"><%= "#{i}-#{ii}" %> <a href='<%= child.path %>'><%= child.title %></a></span></li>
<% ii += 1 %>
<% end %>
<% end if item.children %>
</ul>
</div>
<% i += 1 %>
<% end %>
<% end %>
</div>