fix web resource frontend page

This commit is contained in:
Fu Matthew 2013-01-29 10:05:50 +08:00 committed by chris
parent e244493b55
commit bbd30759f5
2 changed files with 21 additions and 2 deletions

View File

@ -102,7 +102,7 @@ module ParserFrontEnd
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"
else else
"/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

View File

@ -351,7 +351,8 @@ namespace :migrate do
end end
task :make_default_widget_work_config => :environment do
task :make_default_widget_work_config_for_announcement => :environment do
a = ModuleApp.where(:key=>'announcement').first a = ModuleApp.where(:key=>'announcement').first
a.widgets[:default_widget] = ['typeA','typeC','typeB_style2','typeB_style3','typeB_style4'] a.widgets[:default_widget] = ['typeA','typeC','typeB_style2','typeB_style3','typeB_style4']
a.widgets = {"index"=>["1", "2"], "default_widget"=>["typeA", "typeC", "typeB_style2", "typeB_style3", "typeB_style4"]} a.widgets = {"index"=>["1", "2"], "default_widget"=>["typeA", "typeC", "typeB_style2", "typeB_style3", "typeB_style4"]}
@ -371,6 +372,24 @@ namespace :migrate do
a.save a.save
end end
task :make_default_widget_work_config_for_web_link => :environment do
a = ModuleApp.where(:key=>'web_resource').first
a.widgets = { "default_widget"=>["typeA", "typeC", "typeB_style2", "typeB_style3", "typeB_style4"]}
a.widget_fields = [
["title","web_link.default_widget.title"],
["web_link_with_title","web_link.default_widget.bulletin_category_with_title"]
]
a.get_default_widget = {:query=>'WebLink.all'}
a.widget_fields_link_method = {
"title"=>{:method => 'panel_web_resource_front_end_web_link_path',
:args=>:self},
"web_link_with_title"=>{
:method => 'panel_web_resource_front_end_web_link_path',
:args=>{:category_id => [:web_link_category,:id]}}
}
a.save
end
task :reorder_items => :environment do task :reorder_items => :environment do
reorder_children(Item.root) reorder_children(Item.root)