Sha256: aa66f3402ddefb19e289f5df0979c625487014b32019f5c5ea59f97b1a728ce1

Contents?: true

Size: 1.34 KB

Versions: 42

Compression:

Stored size: 1.34 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_field_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_field_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.4.1 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.4.0 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.3.0 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.2.0 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.1.0 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.3 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.2 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.1 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.0 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.0.rc6 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.0.rc5 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.0.rc4 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.0.rc3 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.0.rc2 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.0.rc1 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.0.alpha.10 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.0.alpha.9 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.0.alpha.8 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.0.alpha.7 app/views/spotlight/custom_fields/form_group/_vocab.html.erb
blacklight-spotlight-3.0.0.alpha.6 app/views/spotlight/custom_fields/form_group/_vocab.html.erb