diff --git a/app/helpers/admin/blocks_helper.rb b/app/helpers/admin/blocks_helper.rb index 3c99f60dd59e20704cf16d87d5d805b84abdbb60..354b7d7424a429d260fe4832a3d022b1897964f9 100644 --- a/app/helpers/admin/blocks_helper.rb +++ b/app/helpers/admin/blocks_helper.rb @@ -9,7 +9,9 @@ module Admin::BlocksHelper end def block_component_static(property, **options) - block_component_render :static, property, **options + render "admin/communication/blocks/components/static", + property: property, + **options end protected diff --git a/app/views/admin/communication/blocks/components/_edit.html.erb b/app/views/admin/communication/blocks/components/_edit.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/app/views/admin/communication/blocks/components/_preview.html.erb b/app/views/admin/communication/blocks/components/_preview.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/app/views/admin/communication/blocks/components/_static.html.erb b/app/views/admin/communication/blocks/components/_static.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..300d937bbe46096497dcb866ae1bac3116f4c3de --- /dev/null +++ b/app/views/admin/communication/blocks/components/_static.html.erb @@ -0,0 +1,14 @@ +<% +template ||= @block.template +component = template.public_send "#{property}_component" +value = template.public_send property +depth ||= 3 +indentation = ' ' * depth +local_assigns[:template] = template +local_assigns[:component] = component +local_assigns[:value] = value +local_assigns[:depth] = depth +local_assigns[:indentation] = indentation +partial = "admin/communication/blocks/components/#{component.kind}/static" +%> +<%= render partial, **local_assigns %> diff --git a/app/views/admin/communication/blocks/components/image/_static.html.erb b/app/views/admin/communication/blocks/components/image/_static.html.erb index a0a65ccdf1765b81cf55a015e86064501333da10..83fe9086eebfbf539c71bfe1b3d400463a4b37e2 100644 --- a/app/views/admin/communication/blocks/components/image/_static.html.erb +++ b/app/views/admin/communication/blocks/components/image/_static.html.erb @@ -1,9 +1,6 @@ <% -component = template.public_send "#{property}_component" blob = component.blob -depth ||= 3 list ||= false -indentation = ' ' * depth return unless blob %> <% if list %> diff --git a/app/views/admin/communication/blocks/components/rich_text/_static.html.erb b/app/views/admin/communication/blocks/components/rich_text/_static.html.erb index 7c487d79030a555cfbc23caf56bab55956983b95..c3125cb3df2878cc5425857e8b10addeb58f86c8 100644 --- a/app/views/admin/communication/blocks/components/rich_text/_static.html.erb +++ b/app/views/admin/communication/blocks/components/rich_text/_static.html.erb @@ -1,7 +1,2 @@ -<% -value = template.public_send property -depth ||= 3 -indentation = ' ' * depth -%> <%= indentation %><%= property %>: >- <%= indentation %> <%= prepare_html_for_static value, @university %> diff --git a/app/views/admin/communication/blocks/components/string/_static.html.erb b/app/views/admin/communication/blocks/components/string/_static.html.erb index 72a8e7fc8fc8d8e16cec809f916193467c9b0d86..49f91924168f207f7469702c8c0404409999e251 100644 --- a/app/views/admin/communication/blocks/components/string/_static.html.erb +++ b/app/views/admin/communication/blocks/components/string/_static.html.erb @@ -1,7 +1,2 @@ -<% -value = template.public_send property -depth ||= 3 -indentation = ' ' * depth -%> <%= indentation %><%= property %>: >- <%= indentation %> <%= prepare_text_for_static value, depth + 1 %> diff --git a/app/views/admin/communication/blocks/components/text/_static.html.erb b/app/views/admin/communication/blocks/components/text/_static.html.erb index 72a8e7fc8fc8d8e16cec809f916193467c9b0d86..49f91924168f207f7469702c8c0404409999e251 100644 --- a/app/views/admin/communication/blocks/components/text/_static.html.erb +++ b/app/views/admin/communication/blocks/components/text/_static.html.erb @@ -1,7 +1,2 @@ -<% -value = template.public_send property -depth ||= 3 -indentation = ' ' * depth -%> <%= indentation %><%= property %>: >- <%= indentation %> <%= prepare_text_for_static value, depth + 1 %>