Sha256: 349e61513d242c8a34013e7d24b6e7e2334563e1121456de3bf968a740d3aa60

Contents?: true

Size: 1.29 KB

Versions: 60

Compression:

Stored size: 1.29 KB

Contents

<%= f.fields_for :sidecar, document.sidecar(current_exhibit) do |c| %>
  <%= c.fields_for :data do |d| %>
    <% if document.uploaded_resource? %>
      <%= d.fields_for :configured_fields do |e| %>
        <% Spotlight::Resources::Upload.fields(current_exhibit).each do |config| %>
          <%= e.send(config.form_field_type, config.field_name, value: (document.sidecar(current_exhibit).data["configured_fields"] || {})[config.field_name.to_s], label: uploaded_field_label(config)) %>
        <% end %>
      <% end %>
    <% end %>

    <%# Using `includes(:exhibit)` to ensure all fields are using the same exhibit object to take advantage of memoization %>
    <% current_exhibit.custom_fields.includes(:exhibit).each do |field| %>
      <% data = document.sidecar(current_exhibit).data %>
      <%= render partial: "spotlight/custom_fields/form_group/#{field.field_type}", locals: { f: d, field: field, value: data[field.slug.to_s] || data[field.field.to_s] }  %>

      <% unless field.configured_to_display? %>
        <p class="bg-warning form-text">
          <%= t(:'.blank_field_warning_html',
                link: link_to(t(:'spotlight.configuration.sidebar.metadata'), spotlight.edit_exhibit_metadata_configuration_path(current_exhibit))) %>
        </p>
      <% end %>
    <% end %>
  <% end %>
<% end %>

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
blacklight-spotlight-4.3.6 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.3.5 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.3.4 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.3.3 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.3.2 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.3.1 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.3.0 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.2.0 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.1.2 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.1.1 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.1.0 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.0.3 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.0.2 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.0.1 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-4.0.0 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-3.6.0.beta10 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-3.6.0.beta9 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-3.6.0.beta8 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-3.5.0.4 app/views/spotlight/catalog/_edit_sidecar.html.erb
blacklight-spotlight-3.6.0.beta7 app/views/spotlight/catalog/_edit_sidecar.html.erb