From 3f0addf04d4499e481abe1ee77f5b756b1b30fae Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 26 Mar 2013 16:29:35 +0800 Subject: [PATCH] Fix bug in setup_app_frontend_and_style --- app/controllers/admin/pages_controller.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index 2be56ad58..f9b9a0fe8 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -144,14 +144,13 @@ helper Admin::PagePartsHelper def setup_app_frontend_and_style if @module_app.nil? @item.module_app.app_pages.each{|name,data| @app_frontend_urls << [I18n.t(data["i18n"]),name]} + @frontend_styles = @item.module_app.app_pages[@item.frontend_style]["style"] if @frontend_styles.nil? && @item && @item.module_app.app_pages[@item.frontend_style] + @frontend_styles = @item.module_app.app_pages.first[1]["style"] if @frontend_styles.nil? && @item else @module_app.app_pages.each{|name,data| @app_frontend_urls << [I18n.t(data["i18n"]),name]} + @frontend_styles = @module_app.app_pages[params["frontend"]]["style"] rescue nil + @frontend_styles = @module_app.app_pages.first[1]["style"] if @frontend_styles.nil? end - - @frontend_styles = @module_app.app_pages[params["frontend"]]["style"] rescue nil - @frontend_styles = @item.module_app.app_pages[@item.frontend_style]["style"] if @frontend_styles.nil? && @item && @item.module_app.app_pages[@item.frontend_style] - @frontend_styles = @item.module_app.app_pages.first[1]["style"] if @frontend_styles.nil? && @item - @frontend_styles = @module_app.app_pages.first[1]["style"] if @frontend_styles.nil? end def reload_frontend_pages