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]
|
||||
body = Nokogiri::HTML(page.content)
|
||||
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 = ''
|
||||
part = PagePart.find(front['part_id']) if front['part_id']
|
||||
ret << eval("\"#{front['path']}\"") rescue ''
|
||||
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
|
||||
front.swap(fragment)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue