<% # headmin/forms/blocks # # ==== Required parameters # * +form - Form object # * +names - Names of block templates that can be added # # ==== Optional parameters # * +paths - Directories where to look for block templates # # ==== Examples # Basic version. (looks in views/admin/blocks, views/blocks or views directory ) # <%= render "headmin/forms/blocks", form: form, names: %w(text image button) %#> # # Define one ore more path where the templates could be located: # <%= render "headmin/forms/blocks", form: form, names: %w(text image button), paths: %w(admin/pages/blocks) %#> # # Limit the types of blocks # <%= render "headmin/forms/blocks", form: form, names: %w(text text_image list) %#> blocks = Headmin::Form::BlocksView.new(local_assigns) @lookup_context.prefixes = @lookup_context.prefixes + blocks.prefixes %> <%= render "headmin/forms/repeater", blocks.repeater_options do |block_form, template| %> <% name = template || block_form.object.name %> <%= block_form.hidden_field :name, value: name %>
"> <%= render name, form: block_form %>
<% badge_style = blocks.badge_style(block_form.object) %> <%= t("blocks.#{name}", default: name).humanize %> <%= render "headmin/forms/blocks/modal", form: block_form, name: name %> <% end %>