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

no components allowed

parent cb293f1d
No related branches found
No related tags found
No related merge requests found
class Communication::Block::Component::Image < Communication::Block::Component::Base
def data
# Loading the blob when needed, not saved in the database
@data['blob'] = template.blob_with_id @data['id'] if @data&.has_key? 'id'
@data
end
end
......@@ -87,6 +87,10 @@ class Communication::Block::Template::Base
[]
end
def elements
data['elements']
end
def blob_with_id(id)
university.active_storage_blobs.find id
end
......@@ -138,6 +142,7 @@ class Communication::Block::Template::Base
end
def components
return [] if self.class.fields.nil?
self.class.fields.map do |field|
send "#{field[:name]}_component"
end
......
......@@ -2,7 +2,7 @@ class Communication::Block::Template::Gallery < Communication::Block::Template::
LAYOUTS = [:grid, :carousel].freeze
has_select :layout, options: LAYOUTS, default: LAYOUTS.first
# has_select :layout, options: LAYOUTS, default: LAYOUTS.first
def build_git_dependencies
add_dependency active_storage_blobs
......
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