From 37309a452dbf7db6d686fa804ca6515e4aeaaf20 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 28 Dec 2012 11:37:37 +0800 Subject: [PATCH] Fix site map and menu order --- app/controllers/front_controller.rb | 2 +- app/models/item.rb | 2 +- lib/parsers/parser_common.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/front_controller.rb b/app/controllers/front_controller.rb index 2f58d9ed..0ef39633 100644 --- a/app/controllers/front_controller.rb +++ b/app/controllers/front_controller.rb @@ -39,7 +39,7 @@ class FrontController < ApplicationController res << "'>" i = nil i = 1 if menu.values["li_incremental_#{current}"] - children = current == 1 ? page.visible_children.reverse : page.visible_children + children = current == 1 ? page.visible_children : page.visible_children children.each do |child| res << menu_li(child, current_page, current, menu, i) i += 1 if i diff --git a/app/models/item.rb b/app/models/item.rb index 81366a21..1809e2b2 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -56,7 +56,7 @@ class Item end def show_in_sitemap_for(locale) - if !sitemap_enabled[locale].blank? + if sitemap_enabled && !sitemap_enabled[locale].blank? sitemap_enabled[locale].eql?('true') ? true : false else true diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index acdd43b8..4eb044b1 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -9,7 +9,7 @@ module ParserCommon res << "'>" i = nil i = 1 if menu.values["li_incremental_#{current}"] - children = current == 1 ? page.visible_children.reverse : page.visible_children + children = current == 1 ? page.visible_children : page.visible_children children.each do |child| res << menu_li(child, current_page, current, menu, i, edit) i += 1 if i