Missing code in parser for displaying image in the fornt-end
This commit is contained in:
parent
ad9f9bbf5c
commit
2754f49fe9
|
@ -81,9 +81,11 @@ module Parser
|
|||
res
|
||||
end
|
||||
c.define_tag 'image' do |tag|
|
||||
asset = Asset.find(tag.attr['id'])
|
||||
if asset
|
||||
res = "<img src=#{asset.data.file.url} "
|
||||
image = page.custom_images.detect{|image| image.name.eql?(tag.attr['name']) }
|
||||
image = page.design.custom_images.detect{|image| image.name.eql?(tag.attr['name']) } unless image
|
||||
image = page.design.images.detect{|image| image.name.eql?(tag.attr['name']) } unless image
|
||||
if image
|
||||
res = "<img src=#{image.file.url} "
|
||||
tag.attr.each do |l|
|
||||
res << "#{l[0]}='#{l[1]}' "
|
||||
end
|
||||
|
|
Reference in New Issue