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
|
res
|
||||||
end
|
end
|
||||||
c.define_tag 'image' do |tag|
|
c.define_tag 'image' do |tag|
|
||||||
asset = Asset.find(tag.attr['id'])
|
image = page.custom_images.detect{|image| image.name.eql?(tag.attr['name']) }
|
||||||
if asset
|
image = page.design.custom_images.detect{|image| image.name.eql?(tag.attr['name']) } unless image
|
||||||
res = "<img src=#{asset.data.file.url} "
|
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|
|
tag.attr.each do |l|
|
||||||
res << "#{l[0]}='#{l[1]}' "
|
res << "#{l[0]}='#{l[1]}' "
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue