Sha256: 59d3e5bb793b2f6e88494e2ef28e73debce5e47a6a55e7fe2feffe4590c95588
Contents?: true
Size: 1.64 KB
Versions: 17
Compression:
Stored size: 1.64 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| %> <div class="form-group"> <%= d.label field.field, field.label %> <% if field.field_type == 'vocab' %> <%= d.text_field_without_bootstrap field.field, value: document.sidecar(current_exhibit).data[field.field.to_s], class: "form-control field-#{field.slug}", readonly: field.readonly_field? %> <% else %> <%= d.text_area_without_bootstrap field.field, value: document.sidecar(current_exhibit).data[field.field.to_s], class: "form-control field-#{field.slug}", readonly: field.readonly_field? %> <% end %> <% unless field.configured_to_display? %> <p class="bg-warning help-block"> <%= t(:'.blank_field_warning_html', link: link_to(t(:'spotlight.configuration.sidebar.metadata'), spotlight.edit_exhibit_metadata_configuration_path(current_exhibit))) %> </p> <% end %> </div> <% end %> <% end %> <% end %>
Version data entries
17 entries across 17 versions & 1 rubygems