Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
hh1966
chemotion_eln_server
Commits
5b7676ff
Commit
5b7676ff
authored
Apr 17, 2019
by
hh1966
Browse files
Fix svg image export
parent
e7897079
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/export/export_collections.rb
View file @
5b7676ff
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment