Fix orbit_front parser
This commit is contained in:
parent
0a0298aaad
commit
974a190eaf
|
@ -22,13 +22,13 @@ module ParserFrontEnd
|
||||||
tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
|
tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
|
||||||
body = Nokogiri::HTML(page.content)
|
body = Nokogiri::HTML(page.content)
|
||||||
body.css('orbit_front').each do |front|
|
body.css('orbit_front').each do |front|
|
||||||
if front['class'] && front['class'].include?('dymanic_load')
|
if front['value']
|
||||||
|
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div id='#{front['id']}' class='#{front['class']}'>#{eval(front['value']).to_s}</div>")
|
||||||
|
else
|
||||||
ret = ''
|
ret = ''
|
||||||
part = PagePart.find(front['part_id']) if front['part_id']
|
part = PagePart.find(front['part_id']) if front['part_id']
|
||||||
ret << eval("\"#{front['path']}\"") rescue ''
|
ret << eval("\"#{front['path']}\"") rescue ''
|
||||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load widget' path='#{ret}'></div>")
|
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load widget' path='#{ret}'></div>")
|
||||||
else
|
|
||||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div id='#{front['id']}' class='#{front['class']}'>eval('#{front['value']}'').to_s</div>" )
|
|
||||||
end
|
end
|
||||||
front.swap(fragment)
|
front.swap(fragment)
|
||||||
end
|
end
|
||||||
|
|
Reference in New Issue