Sha256: eef1850e76d949346efb2a223d4543306d4bfa0f3ef882a590724a43ca698aa8

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

<% inline = local_assigns[:inline].presence %>
<% label_col = f&.label_col %>
<% control_col = f&.control_col %>
<% offset_col = label_col.sub('col', 'offset') %>

<div class="form-group mb-3 <%= "row" if inline %>">
  <% Array(value || '').each_with_index do |v, index| %>
    <%= f.label field.slug, field.label, namespace: "f#{index}", class: "col-form-label #{label_col if inline} #{'sr-only visually-hidden' if index > 0}" %>
    <div class="mb-3 <%= control_col if inline %>">
      <%= f.text_area_without_bootstrap field.slug, namespace: "f#{index}",multiple: field.is_multiple?, value: v, class: "form-control field-#{field.slug}", readonly: field.readonly_field? %>
    </div>
  <% end %>

  <% if field.is_multiple? && !field.readonly_field? %>
    <%= content_tag :template, id: "spotlight-field-template-#{field.slug}" do %>
      <%= f.label field.slug, field.label, class: "col-form-label #{label_col if inline} sr-only visually-hidden" %>
      <div class="mb-3 <%= "#{offset_col} #{control_col}" if inline %>">
        <%= f.text_area_without_bootstrap field.slug, multiple: field.is_multiple?, value: nil, class: "form-control field-#{field.slug}" %>
      </div>
    <% end %>
    <%= content_tag :button, t('helpers.action.add_another'), class: 'btn btn-info btn-sm col-auto h-100', data: { action: 'add-another', template_id: "spotlight-field-template-#{field.slug}" } %>
  <% end %>
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blacklight-spotlight-4.6.1 app/views/spotlight/custom_fields/form_group/_text.html.erb
blacklight-spotlight-4.6.0 app/views/spotlight/custom_fields/form_group/_text.html.erb
blacklight-spotlight-4.5.0 app/views/spotlight/custom_fields/form_group/_text.html.erb