make default widget work with params[tag_id] params[category_id]

This commit is contained in:
Matthew K. Fu JuYuan 2013-05-29 16:23:31 +08:00 committed by Matt K. Fu
parent 5c94200b77
commit f2706ff2c1
1 changed files with 2 additions and 4 deletions

View File

@ -19,10 +19,8 @@ module ParserFrontEnd
end
def parse_page_content(page,args=nil)
try{
args["category_id"] = args["category_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if args["category_id"].is_a? String
args["tag_id"] = args["tag_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if args["category_id"].is_a? String
}
args["tag_id"] = args["tag_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if args["tag_id"].is_a? String
# tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
# category = params[:category_id].blank? ? page[:category] : params[:category_id]
body = Nokogiri::HTML(page.content)
@ -159,7 +157,7 @@ module ParserFrontEnd
categories_str = "&#{categories_str}" unless categories_str.blank?
tags_str = "&#{tags_str}" unless tags_str.blank?
options = "&part_id=\#{part.id}#{categories_str}#{tags_str}&page=\#{params[:page]}&search_query=\#{params[:search_query]}&clicked_field_name=\#{params[:clicked_field_name]}&part_title=\#{Rack::Utils.escape(part_title).gsub(\"\+\", \"\%20\") rescue nil}&item_type=page_part"
options = "&part_id=\#{part.id}#{categories_str}#{tags_str}&page=\#{params[:page]}&search_query=\#{params[:search_query]}&clicked_field_name=\#{params[:clicked_field_name]}&part_title=\#{Rack::Utils.escape(part_title).gsub(\"\+\", \"\%20\") rescue nil}&item_type=page_part&tag_id=\#{params[:tag_id]}&category_id=\#{params[:category_id]}"
ret << "<orbit_front path='#{url + options}' part_id=#{part.id} class='dymanic_load widget'></orbit_front>"
when 'public_r_tag'