From 47a63e3dab06016d543419f93354ae32b277c698 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Tue, 25 Dec 2012 10:45:08 +0800 Subject: [PATCH] fix widget. --- lib/parsers/parser_front_end.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb index 1cf2bc23..119c2706 100644 --- a/lib/parsers/parser_front_end.rb +++ b/lib/parsers/parser_front_end.rb @@ -102,9 +102,19 @@ module ParserFrontEnd when 'text' ret << part.content_translations[locale.to_s] rescue '' when 'module_widget' - url = "/panel/\#{part.module_app.key}/widget/\#{part.widget_path}?inner=true" + # url = "/panel/\#{part.module_app.key}/widget/\#{part.widget_path}?inner=true" + # options = "&part_id=\#{part.id}&category_id=\#{!part[:category].blank? ? part[:category].blank? : category}&tag_id=\#{!part[:tag].blank? ? part[:tag] : tag}&page=\#{params[:page]}&search_query=\#{params[:search_query]}&part_title=\#{Rack::Utils.escape(part_title).gsub(\"\+\", \"\%20\") rescue nil}" + # ret << "" + url = case part.widget_path + when 'default_widget' + "/panel/orbit_app/widget/\#{part.widget_style}?inner=true" + else + "/panel/\#{part.module_app.key}/widget/\#{part.widget_path}?inner=true" + end + options = "&part_id=\#{part.id}&category_id=\#{!part[:category].blank? ? part[:category].blank? : category}&tag_id=\#{!part[:tag].blank? ? part[:tag] : tag}&page=\#{params[:page]}&search_query=\#{params[:search_query]}&part_title=\#{Rack::Utils.escape(part_title).gsub(\"\+\", \"\%20\") rescue nil}" - ret << "" + ret << "" + when 'public_r_tag' ret << send("generate_#{part.public_r_tag}s", part.public_r_tag_object_id, page) else