From bca4478f68319dc6b2939bcdfbf714201753f961 Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Fri, 1 Feb 2013 17:07:16 +0800 Subject: [PATCH] front_end widget breadcrumb done --- app/controllers/front_controller.rb | 2 +- app/views/front/show_breadcrumb.html.erb | 4 ++-- lib/parsers/parser_common.rb | 5 ++--- lib/parsers/parser_front_end.rb | 17 ++++++++++++++++- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/controllers/front_controller.rb b/app/controllers/front_controller.rb index 15a9d986..3648f6a4 100644 --- a/app/controllers/front_controller.rb +++ b/app/controllers/front_controller.rb @@ -3,7 +3,7 @@ class FrontController < ApplicationController layout false def show_breadcrumb - @ancestors = Page.find(params[:menu_page_id]).ancestors_and_self.map{|m|m.title_translations[locale]}.delete_at(0) rescue [] + @ancestors = Page.find(params[:page_id]).ancestors_and_self @ancestors.delete_at(0) end diff --git a/app/views/front/show_breadcrumb.html.erb b/app/views/front/show_breadcrumb.html.erb index afba97b2..7b0fc912 100644 --- a/app/views/front/show_breadcrumb.html.erb +++ b/app/views/front/show_breadcrumb.html.erb @@ -1,9 +1,9 @@ <% if not @ancestors.empty? %>
diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index 0d139ba7..bd0b8643 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -156,9 +156,7 @@ module ParserCommon res << "