Remove breadcrumb when home

This commit is contained in:
chris 2013-02-07 17:26:40 +08:00
parent 25d9a3d9b9
commit ec9c68f039
2 changed files with 2 additions and 0 deletions

View File

@ -4,6 +4,7 @@ class FrontController < ApplicationController
def show_breadcrumb def show_breadcrumb
@ancestors = Page.find(params[:id]).ancestors_and_self @ancestors = Page.find(params[:id]).ancestors_and_self
@ancestors = nil if @ancestors.size == 1
end end
def show_banner def show_banner

View File

@ -148,6 +148,7 @@ module ParserCommon
def parse_breadcrumbs_edit(body = nil, page = nil, edit=nil) def parse_breadcrumbs_edit(body = nil, page = nil, edit=nil)
body.css('breadcrumb').each do |breadcrumb| body.css('breadcrumb').each do |breadcrumb|
ancestors = Page.find(page.id).ancestors_and_self rescue nil ancestors = Page.find(page.id).ancestors_and_self rescue nil
ancestors = nil if ancestors.size == 1
res = '' res = ''
if ancestors if ancestors
res << "<ul class='breadcrumb'>" res << "<ul class='breadcrumb'>"