Commit 5b7676ff authored by hh1966's avatar hh1966
Browse files

Fix svg image export

parent e7897079
......@@ -151,8 +151,8 @@ module Export
fetch_literals(sample)
# collect the sample_svg_file and molecule_svg_file
@images << File.join('images', 'samples', sample.sample_svg_file)
@images << File.join('images', 'molecules', sample.molecule.molecule_svg_file)
fetch_image('samples', sample.sample_svg_file)
fetch_image('molecules', sample.molecule.molecule_svg_file)
end
end
......@@ -187,7 +187,7 @@ module Export
fetch_literals(reaction)
# collect the reaction_svg_file
@images << File.join('images', 'reactions', reaction.reaction_svg_file)
fetch_image('reactions', reaction.reaction_svg_file)
end
end
......@@ -255,7 +255,7 @@ module Export
fetch_literals(research_plan)
# collect the svg_file
@images << File.join('images', 'research_plans', research_plan.svg_file)
fetch_image('research_plans', research_plan.svg_file)
end
end
......@@ -363,6 +363,14 @@ module Export
end
end
def fetch_image(image_path, image_file_name)
unless image_file_name.nil? or image_file_name.empty?
if File.exist?(File.join('public', 'images', image_path, image_file_name))
@images << File.join('images', image_path, image_file_name)
end
end
end
def uuid(type, id)
unless id.nil?
# create an empty hash for the type if it does not exist yet
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment