Skip to content
Snippets Groups Projects
Commit 359cc96a authored by Arnaud Levy's avatar Arnaud Levy
Browse files

fix

parent eb00b534
No related branches found
No related tags found
No related merge requests found
......@@ -7,19 +7,24 @@ class Communication::Block::Template::Gallery < Communication::Block::Template
unless @images_with_alt
@images_with_alt = []
elements.each do |element|
blob = find_blob element, 'file'
next if blob.nil?
@images_with_alt << {
blob: blob,
alt: element['alt']
}.to_dot
@images_with_alt << image_with_alt(element)
end
@images_with_alt.compact!
end
@images_with_alt
end
protected
def image_with_alt(element)
blob = find_blob element, 'file'
return if blob.nil?
{
blob: blob,
alt: element['alt']
}.to_dot
end
def images
@images ||= images_with_alt.map { |hash| hash.blob }
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment