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

default layout

parent 2facdf7e
No related branches found
No related tags found
No related merge requests found
......@@ -99,12 +99,21 @@ class Communication::Block::Template::Base
data['elements']
end
def default_layout
self.class.layouts.first
end
def layout
data['layout']
end
def blob_with_id(id)
university.active_storage_blobs.find id
end
def default_data
{
'layout' => default_layout,
'elements' => []
}
end
......
......@@ -10,10 +10,6 @@ class Communication::Block::Template::Gallery < Communication::Block::Template::
add_dependency active_storage_blobs
end
def layout
data['layout'] || LAYOUTS.first
end
def images_with_alt
@images_with_alt ||= elements.map { |element|
extract_image_alt_and_credit element, 'file'
......
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