Fix item looking for widget when no front end

This commit is contained in:
chris 2013-02-08 12:56:35 +08:00
parent 6d1f919bb7
commit 9e9620c04a
1 changed files with 5 additions and 6 deletions

View File

@ -36,12 +36,11 @@ helper Admin::PagePartsHelper
if @item.module_app if @item.module_app
@module_app = @item.module_app @module_app = @item.module_app
@frontend_path = @item.app_frontend_url
@frontend_path = @item.app_frontend_url ? @item.app_frontend_url : @module_app.widgets.keys[0] if @module_app && @module_app.widgets && @module_app.widgets.any?{|b| b.class == Array}
@frontend_style = @module_app.widgets[@frontend_path] if !@frontend_path.blank? && !@module_app.widgets.blank?
if @module_app && @module_app.widgets && @module_app.widgets.any?{|b| b.class == Array} end
@frontend_style = @module_app.widgets[@frontend_path] if !@frontend_path.blank? && !@module_app.widgets.blank?
end
case @item.module_app.key case @item.module_app.key
when 'announcement' when 'announcement'
@ -59,7 +58,7 @@ helper Admin::PagePartsHelper
end end
else else
@categories = nil @categories = nil
@module_app = @module_apps[0] @module_app = @module_apps[0]
end end
end end