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