Temporary fix: show for default widget

- the task migrate:recreate_page_parts must be run
	- "create_parts" in page.rb must be unprotected
This commit is contained in:
chris 2013-02-05 16:34:22 +08:00
parent 7105f103e1
commit 29b8fec89a
3 changed files with 32 additions and 27 deletions

View File

@ -11,6 +11,9 @@ class DefaultWidgetController< OrbitWidgetController
end end
def default_widget def default_widget
if !params[:id].blank?
redirect_to eval("#{@page_part.module_app.widget_fields_link_method['title']['method']}('#{params[:id]}', {inner: true})")
else
@tag_class = nil @tag_class = nil
@default_widget = @page_part.module_app.get_default_widget @default_widget = @page_part.module_app.get_default_widget
@ -35,7 +38,7 @@ class DefaultWidgetController< OrbitWidgetController
@tag_class = 'default_widget_typeC' @tag_class = 'default_widget_typeC'
render "typeC" render "typeC"
end end
end
end end
end end

View File

@ -69,12 +69,13 @@ class PagesController < ApplicationController
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => params[:tag_id]}) @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => params[:tag_id]})
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => ''}) unless @item @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => ''}) unless @item
elsif !params[:category_id].blank? elsif !params[:category_id].blank?
@item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action],category: params[:category_id]).any_in(tag: [nil,'']).first @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], category: params[:category_id]).any_in(tag: [nil,'']).first
elsif !params[:tag_id].blank? elsif !params[:tag_id].blank?
@item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action],tag: params[:tag_id]).any_in(category: [nil,'']).first @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], tag: params[:tag_id]).any_in(category: [nil,'']).first
end end
@item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action]).all_of("tag" => {"$in" => [nil,'']},"category" => { "$in" => [nil,'']}).first unless @item @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).all_of("tag" => {"$in" => [nil,'']},"category" => { "$in" => [nil,'']}).first unless @item
@item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action]).first unless @item @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).first unless @item
@item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').first unless @item
raise PageError,'Missing Frontend Page' if @item.nil? raise PageError,'Missing Frontend Page' if @item.nil?
end end

View File

@ -116,6 +116,7 @@ module ParserFrontEnd
if (content["main"] == "true" && !page.module_app.nil?) if (content["main"] == "true" && !page.module_app.nil?)
if page.app_frontend_url == 'default_widget' if page.app_frontend_url == 'default_widget'
url = "/panel/orbit_app/widget/#{page.frontend_style}?inner=true" url = "/panel/orbit_app/widget/#{page.frontend_style}?inner=true"
url << "&id=\#{params[:id] if params[:id] && !params[:id].eql?(page.id.to_s)}"
else else
url = "/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}\#{(\"/\" + params[:id]) if params[:id] && !params[:id].eql?(page.id.to_s)}\#{(\"/\" + params[:controller_action]) if params[:controller_action] && params[:id]}?inner=true" url = "/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}\#{(\"/\" + params[:id]) if params[:id] && !params[:id].eql?(page.id.to_s)}\#{(\"/\" + params[:controller_action]) if params[:controller_action] && params[:id]}?inner=true"
end end