Fix bug in setup_app_frontend_and_style

This commit is contained in:
chris 2013-03-26 16:29:35 +08:00 committed by Matt K. Fu
parent 1709773b0a
commit 6af375efa4
1 changed files with 4 additions and 5 deletions

View File

@ -139,15 +139,14 @@ helper Admin::PagePartsHelper
def setup_app_frontend_and_style def setup_app_frontend_and_style
if @module_app.nil? if @module_app.nil?
@item.module_app.app_pages.each{|name,data| @app_frontend_urls << [I18n.t(data["i18n"]),name]} @item.module_app.app_pages.each{|name,data| @app_frontend_urls << [I18n.t(data["i18n"]),name]}
else
@module_app.app_pages.each{|name,data| @app_frontend_urls << [I18n.t(data["i18n"]),name]}
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[@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 = @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? @frontend_styles = @module_app.app_pages.first[1]["style"] if @frontend_styles.nil?
end end
end
def reload_frontend_pages def reload_frontend_pages
@item = Page.find params[:id] rescue nil @item = Page.find params[:id] rescue nil