Sha256: 52cad9b9bb7acd4911495a9c6505eea4b242196f1e97b0b078a609043117f3ff

Contents?: true

Size: 1.33 KB

Versions: 42

Compression:

Stored size: 1.33 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 <%= "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' 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" %>
      <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 h-100', data: { action: 'add-another', template_id: "spotlight-field-template-#{field.slug}" } %>
  <% end %>
</div>

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
blacklight-spotlight-3.0.0.alpha.5 app/views/spotlight/custom_fields/form_group/_text.html.erb
blacklight-spotlight-3.0.0.alpha.4 app/views/spotlight/custom_fields/form_group/_text.html.erb