diff --git a/app/models/communication/block/component/base.rb b/app/models/communication/block/component/base.rb index 683cc24fedcd467a0485a727e3029126a74cfaf0..290e1cb2de90bcc96c8867b0371445151af95a64 100644 --- a/app/models/communication/block/component/base.rb +++ b/app/models/communication/block/component/base.rb @@ -11,6 +11,6 @@ class Communication::Block::Component::Base end def data=(value) - @data = Osuny::Sanitizer.sanitize value, 'string' + @data = value end end diff --git a/app/models/communication/block/component/image.rb b/app/models/communication/block/component/image.rb index 1beff0ea8093621075a55123f0a2cb06ead2ce75..f4852c559040228d8be938ce97d911bd834ff3d9 100644 --- a/app/models/communication/block/component/image.rb +++ b/app/models/communication/block/component/image.rb @@ -1,2 +1,3 @@ class Communication::Block::Component::Image < Communication::Block::Component::Base + end diff --git a/app/models/communication/block/component/rich_text.rb b/app/models/communication/block/component/rich_text.rb index 2ba38a8ffcea9d44bcf6406dccb10cabb4707531..114d7b01aca9ee3c20443001768946c3314d8f90 100644 --- a/app/models/communication/block/component/rich_text.rb +++ b/app/models/communication/block/component/rich_text.rb @@ -1,5 +1,7 @@ class Communication::Block::Component::RichText < Communication::Block::Component::Base + def data=(value) @data = Osuny::Sanitizer.sanitize value, 'text' end + end diff --git a/app/models/communication/block/component/string.rb b/app/models/communication/block/component/string.rb new file mode 100644 index 0000000000000000000000000000000000000000..2d4302f3a600742d583a8c77b18016c25680b929 --- /dev/null +++ b/app/models/communication/block/component/string.rb @@ -0,0 +1,7 @@ +class Communication::Block::Component::String < Communication::Block::Component::Base + + def data=(value) + @data = Osuny::Sanitizer.sanitize value, 'string' + end + +end diff --git a/app/models/communication/block/component/text.rb b/app/models/communication/block/component/text.rb new file mode 100644 index 0000000000000000000000000000000000000000..a5fdf576725700081e139019a11d568226790147 --- /dev/null +++ b/app/models/communication/block/component/text.rb @@ -0,0 +1,7 @@ +class Communication::Block::Component::Text < Communication::Block::Component::Base + + def data=(value) + @data = Osuny::Sanitizer.sanitize value, 'string' + end + +end diff --git a/app/models/communication/block/template/chapter.rb b/app/models/communication/block/template/chapter.rb index 79d29bb1e3b036c936f040737496930241a284fa..a744759c10b7562d3b504926759b4b43b82c3605 100644 --- a/app/models/communication/block/template/chapter.rb +++ b/app/models/communication/block/template/chapter.rb @@ -1,7 +1,7 @@ class Communication::Block::Template::Chapter < Communication::Block::Template::Base has_rich_text :text has_rich_text :notes - # has_image :image + has_image :image def build_git_dependencies add_dependency image&.blob diff --git a/app/views/admin/communication/blocks/templates/chapter/_preview.html.erb b/app/views/admin/communication/blocks/templates/chapter/_preview.html.erb index 4f6bb76594d464166cd39b026a48b249dcb4c389..79f20d9198783f279000eaf1d1ef8d3021e97bdd 100644 --- a/app/views/admin/communication/blocks/templates/chapter/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/chapter/_preview.html.erb @@ -1,3 +1,3 @@ -<%#= render 'admin/communication/blocks/components/image/preview', property: :image %> +<%= render 'admin/communication/blocks/components/image/preview', property: :image %> <%= render 'admin/communication/blocks/components/rich_text/preview', property: :text %> <%= render 'admin/communication/blocks/components/rich_text/preview', property: :notes %>